:root {
  --paper: #f7f6f2;
  --card: #fffefa;
  --white: #ffffff;
  --ink: #293b34;
  --muted: #7b8078;
  --soft-ink: #626b62;
  --line: #e7e7de;
  --orange: #df6648;
  --orange-dark: #bb4d32;
  --orange-wash: #fbede5;
  --green-wash: #eaf0e6;
  --serif: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, input, select { touch-action: manipulation; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #e9a68d; outline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .4; }
input, select { max-width: 100%; }
svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.65; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
.skip-link { position: fixed; z-index: 200; top: -70px; left: 20px; padding: 10px 16px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 16px; }
.app-shell { min-height: 100vh; }
.sidebar { width: 228px; position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; padding: 34px 19px 22px; background: #fbfaf7; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding-left: 9px; }
.brand-mark { width: 43px; height: 47px; display: grid; place-items: center; background: var(--orange); border-radius: 11px 11px 11px 3px; color: #fffaf5; font: 30px var(--serif); box-shadow: 0 3px 0 #d55d4014; }
.brand strong { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: 2px; display: block; line-height: 1.12; }
.brand-dot { color: var(--orange); }
.brand small { display: block; font-size: 8px; font-weight: 600; letter-spacing: 1.5px; margin-top: 7px; color: var(--soft-ink); }
.sidebar-caption { padding: 47px 13px 17px; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.sidebar-caption span { display: block; font-size: 7px; letter-spacing: 1px; margin-top: 3px; opacity: .85; }
.nav-list { display: grid; gap: 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; padding: 13px; min-height: 63px; border-radius: 10px; color: var(--soft-ink); transition: background .18s, color .18s; }
.nav-item > span:not(.nav-count):not(.nav-indicator) { font-size: 13px; font-weight: 600; line-height: 1.5; }
.nav-item small { display: block; font-size: 10px; font-weight: 400; opacity: .75; letter-spacing: .1px; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: #efefe7; }
.nav-item.active { background: var(--orange-wash); color: var(--orange-dark); }
.nav-indicator { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); margin-left: auto; }
.nav-count { margin-left: auto; font-size: 10px; font-weight: 600; line-height: 22px; min-width: 22px; text-align: center; background: #eaece4; border-radius: 5px; color: #7a8277; }
.sidebar-note { position: relative; margin: auto 11px 30px; padding-top: 48px; }
.note-seal { display: grid; place-items: center; width: 29px; height: 31px; color: #b27054; border: 1px solid #c99a80; border-radius: 3px; font: 21px var(--serif); transform: rotate(-7deg); margin-bottom: 17px; opacity: .8; }
.sidebar-note p { font-family: var(--serif); font-size: 18px; line-height: 1.9; color: #677263; letter-spacing: 1px; }
.sidebar-note > span:not(.note-seal) { display: block; font-family: Georgia, serif; font-style: italic; font-size: 10px; color: #8b9086; margin-top: 8px; }
.note-rule { height: 1px; width: 29px; background: #cfd4c7; margin: 23px 0 11px; }
.sidebar-note small { color: #8b9086; font-size: 7px; letter-spacing: .5px; }
.sidebar-foot { border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 20px 11px 0; font-size: 10px; color: #858c7f; }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #7c9a76; flex: 0 0 auto; }
main { min-width: 0; margin-left: 228px; }
.topbar { min-height: 82px; border-bottom: 1px solid var(--line); padding: 0 43px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 11px; }
.breadcrumb > span { color: #858b82; }
.breadcrumb svg { width: 12px; height: 12px; color: #9ea399; }
.breadcrumb strong { font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.language-badge { font-size: 10px; color: #737c70; }
.language-badge span { padding: 0 6px; color: #b9beb1; }
.avatar { border-radius: 50%; background: #e9eee2; border: 1px solid #e0e6d7; width: 34px; height: 34px; font-family: Georgia, serif; font-size: 15px; }
.page-content { width: 100%; max-width: 1264px; margin: 0 auto; padding: 33px 43px 26px; }
.hero { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 18px; align-items: center; min-height: 237px; margin-bottom: 30px; }
.hero-copy { padding: 4px 0; }
.eyebrow { color: var(--orange-dark); font-size: 9px; letter-spacing: 1.65px; font-weight: 650; display: flex; align-items: center; gap: 8px; line-height: 1.8; }
.eyebrow > span { width: 5px; height: 5px; background: var(--orange); border-radius: 50%; }
.eyebrow.muted { color: #8b9285; font-size: 8px; letter-spacing: 1.45px; }
.hero h1 { font-family: var(--serif); font-size: clamp(27px,3.05vw,43px); font-weight: 600; line-height: 1.45; letter-spacing: -1px; margin-top: 15px; white-space: nowrap; }
.hero h1 > span { color: var(--orange); }
.hero-copy > p { color: #747d70; font-size: 13px; line-height: 1.8; margin-top: 14px; }
.hero-copy > p span { color: #91978b; font-size: 11px; }
.text-button { display: inline-flex; align-items: center; gap: 11px; min-height: 40px; font-size: 11px; font-weight: 600; color: var(--orange-dark); padding: 5px 0; }
.text-button svg { width: 17px; height: 17px; }
.hero .text-button { margin-top: 18px; }
.text-button:hover { color: var(--orange); }
.text-button:hover svg { transform: translateX(3px); }
.text-button.subdued { color: #74816d; font-weight: 500; }
.hero-art { position: relative; height: 238px; width: 285px; }
.hero-art::before { content: ""; position: absolute; width: 194px; height: 194px; background: #e9eddf; border-radius: 50%; top: 19px; left: 36px; }
.art-orbit { position: absolute; border: 1px solid #d8ddce; border-radius: 50%; }
.orbit-one { width: 225px; height: 225px; top: 3px; left: 20px; }
.orbit-two { width: 248px; height: 156px; top: 49px; left: 10px; transform: rotate(-32deg); border-color: #d5dbcb; }
.art-caption { position: absolute; top: 39px; left: 79px; font-size: 7px; font-weight: 600; letter-spacing: 1.5px; color: #8e9880; }
.art-pinyin { position: absolute; left: 88px; top: 65px; font-family: Georgia, serif; font-size: 20px; color: #6a795e; letter-spacing: 4px; }
.art-hanzi { position: absolute; top: 91px; left: 63px; font-family: var(--serif); font-size: 66px; color: #42553c; line-height: 1.2; letter-spacing: 5px; transform: rotate(-5deg); }
.art-play { position: absolute; top: 142px; right: 29px; width: 49px; height: 49px; border-radius: 50%; background: var(--orange); color: #fff6eb; display: grid; place-items: center; border: 5px solid var(--paper); transition: transform .2s; }
.art-play:hover { transform: scale(1.08); }
.art-play svg { width: 19px; height: 19px; }
.art-speck { position: absolute; background: var(--orange); border-radius: 50%; }
.speck-one { width: 7px; height: 7px; top: 34px; left: 26px; }
.speck-two { width: 4px; height: 4px; right: 42px; top: 49px; background: #9cab8e; }
.art-tag { position: absolute; bottom: 18px; left: 48px; padding: 9px 16px; background: var(--card); border: 1px solid #e4e5db; border-radius: 6px; transform: rotate(-6deg); font-size: 10px; font-family: Georgia, serif; font-style: italic; color: #7a816f; display: flex; align-items: center; gap: 9px; box-shadow: 0 5px 13px #35452a06; }
.wave-bars { display: inline-flex; gap: 2px; height: 16px; align-items: center; }
.wave-bars i { width: 2px; height: 7px; background: #df8a6a; border-radius: 2px; }
.wave-bars i:nth-child(2), .wave-bars i:nth-child(4) { height: 12px; }
.wave-bars i:nth-child(3) { height: 16px; }
.progress-strip { background: #efeee6; border: 1px solid #e7e6da; border-radius: 11px; padding: 18px 23px; display: flex; align-items: center; gap: 15px; margin-bottom: 33px; }
.progress-icon { width: 41px; height: 41px; display: grid; place-items: center; background: #e5e7d9; color: #7c8c64; border-radius: 50%; }
.progress-copy strong { display: block; font-size: 12px; font-weight: 600; }
.progress-copy > span { display: block; font-size: 9px; color: #8b9281; margin-top: 2px; }
.progress-meter { width: 30%; margin-left: auto; }
.progress-caption { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 9px; color: #89927e; margin-bottom: 7px; }
.progress-caption strong { color: #6c7e56; font-size: 10px; }
.meter-track { height: 5px; border-radius: 8px; background: #dddfd0; overflow: hidden; }
.meter-track span { height: 100%; width: 0; border-radius: inherit; display: block; background: #81966d; transition: width .4s; }
.progress-lesson-count { border-left: 1px solid #d8ddce; padding-left: 25px; margin-left: 24px; display: flex; align-items: center; gap: 12px; }
.progress-lesson-count strong { font-family: Georgia, serif; font-size: 27px; font-weight: 400; color: #7a896a; line-height: 1; }
.progress-lesson-count span { font-size: 8px; color: #8a927f; line-height: 1.6; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 0 0 19px; }
.section-heading h2 { font-size: 19px; font-weight: 650; margin-top: 5px; letter-spacing: .2px; line-height: 1.5; }
.section-heading p { font-size: 11px; color: #8b9287; margin-top: 5px; }
.section-hint { color: #8b9285; font-size: 10px; padding-bottom: 3px; }
.topic-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.topic-card { position: relative; display: block; min-width: 0; padding: 16px 17px 14px; text-align: left; border: 1px solid var(--line); border-radius: 11px; background: var(--card); transition: border-color .2s, background .2s, transform .2s; }
.topic-card:hover { transform: translateY(-2px); border-color: #d1d8c9; }
.topic-card.active, .topic-card[aria-selected="true"] { background: #fcf0e8; border-color: #df997e; box-shadow: inset 0 0 0 1px #df997e20; }
.topic-icon { display: flex; align-items: center; justify-content: center; width: 33px; height: 33px; border-radius: 8px; background: #edf0e6; color: #748567; margin-bottom: 12px; font-size: 20px; }
.topic-icon svg { width: 18px; height: 18px; }
.topic-card:nth-child(2) .topic-icon { background: #eef0e7; color: #82916b; }
.topic-card:nth-child(3) .topic-icon { background: #f6eee1; color: #b69867; }
.topic-card:nth-child(4) .topic-icon { background: #ebecef; color: #9094a3; }
.topic-card.active .topic-icon, .topic-card[aria-selected="true"] .topic-icon { background: #f7dacc; color: var(--orange-dark); }
.topic-copy { display: block; }
.topic-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.7; }
.topic-en { display: block; font-size: 10px; color: #8b9287; line-height: 1.5; }
.topic-meta { display: block; margin-top: 10px; font-size: 8px; color: #969b90; }
.topic-arrow { position: absolute; top: 21px; right: 15px; color: #c2c7ba; }
.topic-arrow svg, svg.topic-arrow { width: 14px; height: 14px; }
.topic-card.active .topic-arrow, .topic-card[aria-selected="true"] .topic-arrow { color: var(--orange); }
.lesson-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(230px,1fr); gap: 18px; align-items: start; scroll-margin-top: 24px; }
.sentence-panel { min-width: 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 21px 25px 0; }
.panel-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lesson-label { display: inline-flex; font-size: 9px; font-weight: 500; color: var(--orange-dark); background: #fcf0e8; border-radius: 4px; padding: 3px 8px; }
.sentence-number { font-size: 9px; color: #989f94; letter-spacing: .8px; }
.sentence-toolbar { display: flex; align-items: center; justify-content: space-between; margin-top: 29px; gap: 8px; }
.tiny-label { color: #abb1a4; font-size: 7px; letter-spacing: 1.5px; font-weight: 500; }
.toggle-label { font-size: 9px; color: #8b9582; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 0; }
.toggle-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 24px; height: 14px; border-radius: 9px; background: #d3d8cd; position: relative; transition: background .2s; }
.toggle-track::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; left: 2px; top: 2px; background: white; box-shadow: 0 1px 3px #0002; transition: transform .2s; }
.toggle-label input:checked + .toggle-track { background: #9cae88; }
.toggle-label input:checked + .toggle-track::after { transform: translateX(10px); }
.toggle-label input:focus-visible + .toggle-track { outline: 3px solid #e9a68d; outline-offset: 3px; }
.sentence-ruby { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 5px; min-height: 103px; padding: 24px 0 9px; text-align: center; }
.word-token { padding: 7px 3px 5px; border-radius: 7px; line-height: 1.2; color: var(--ink); transition: background .18s, color .18s; min-width: 0; }
.word-token:hover, .word-token.is-playing { color: var(--orange-dark); background: #fff2e9; }
.word-token ruby, ruby.ruby-text { font-family: var(--serif); font-size: clamp(30px,3vw,45px); letter-spacing: 1px; ruby-align: center; }
.word-token rt, .ruby-text rt { font-family: var(--sans); color: var(--orange); font-size: 12px; letter-spacing: .7px; padding-bottom: 12px; line-height: 1.5; font-weight: 400; }
.sentence-ruby.hide-pinyin rt { visibility: hidden; }
.word-punctuation { font-family: var(--serif); font-size: clamp(30px,3vw,45px); margin-left: -5px; }
.sentence-translation { text-align: center; font-size: 13px; color: #899181; margin: 1px 0 23px; min-height: 21px; }
.sentence-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; padding: 10px 16px; font-size: 11px; font-weight: 550; transition: background .18s, transform .18s; line-height: 1.3; }
.primary-button { background: var(--orange); color: #fffaf6; border: 1px solid var(--orange); box-shadow: 0 3px 7px #dd6e4914; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.primary-button small { font-size: 9px; font-weight: 400; opacity: .8; }
.primary-button:hover { background: #d95a3b; border-color: #d95a3b; }
.primary-button.is-playing { background: var(--orange-dark); }
.secondary-button { border: 1px solid #e9e9e0; background: #fbfbf7; color: #65715e; }
.secondary-button > span { color: #9aa290; font-size: 9px; font-weight: 400; }
.secondary-button:hover { background: #f1f3e9; }
.icon-button { width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e9eae2; border-radius: 7px; color: #97a08f; background: white; flex: 0 0 auto; transition: background .18s, color .18s, border-color .18s; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { color: var(--orange); background: #fff5ed; border-color: #edcdbb; }
.save-main { width: 42px; height: 42px; border-color: transparent; background: #f7f7f2; margin-left: 1px; }
.is-saved { color: var(--orange-dark) !important; }
.is-saved svg use[href="#i-heart"] { fill: #f7d0bf; }
.learning-tip { display: flex; align-items: flex-start; justify-content: center; gap: 6px; color: #9ba390; font-size: 9px; margin: 21px 0 24px; }
.learning-tip svg { width: 12px; height: 12px; margin-top: 1px; }
.learning-tip small { display: block; font-size: 8px; color: #adb3a5; margin-top: 1px; }
.sentence-bottom { margin: 0 -25px; padding: 14px 23px; border-top: 1px solid #eff0e9; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fdfdfa; }
.learned-button { display: flex; align-items: center; gap: 8px; color: #7f8d72; font-size: 10px; padding: 4px 0; text-align: left; }
.learned-button small { font-size: 8px; font-weight: 400; display: block; color: #a3ac98; margin-top: 1px; }
.check-box { width: 17px; height: 17px; border: 1px solid #d7dece; border-radius: 5px; background: white; display: grid; place-items: center; }
.check-box svg { width: 13px; height: 13px; opacity: 0; }
.learned-button.is-learned .check-box { background: #809b68; border-color: #809b68; color: white; }
.learned-button.is-learned .check-box svg { opacity: 1; }
.sentence-pagination { display: flex; gap: 5px; }
.sentence-pagination .icon-button { width: 30px; height: 30px; }
.flip { transform: rotate(180deg); }
.word-panel { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 21px 19px 18px; }
.word-panel-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.mini-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #edf0e7; color: #8b9d79; }
.mini-icon svg { width: 14px; height: 14px; }
.word-panel h3 { font-size: 12px; font-weight: 600; line-height: 1.5; }
.word-panel-heading > div > span { font-size: 7px; letter-spacing: 1.2px; color: #a1aa97; display: block; margin-top: 2px; }
.soft-count { font-size: 9px; color: #99a48f; background: #f0f2e9; border-radius: 5px; margin-left: auto; padding: 1px 6px; }
.sentence-words { display: grid; }
.word-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 12px 0; border-bottom: 1px solid #eceee5; }
.word-row:first-child { padding-top: 5px; }
.word-row-main { min-width: 0; padding: 0; text-align: left; }
.word-hanzi { font-size: 17px; font-weight: 500; display: inline-block; margin-right: 9px; }
.word-pinyin { color: var(--orange); font-size: 10px; display: inline-block; }
.word-meaning { display: block; font-size: 10px; color: #939c89; line-height: 1.5; margin-top: 4px; }
.word-row-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.word-row-actions .icon-button { background: transparent; border: 0; width: 28px; height: 32px; }
.word-row-actions .icon-button svg { width: 14px; height: 14px; }
.sentence-note { margin-top: 15px; padding: 12px 12px; font-size: 10px; color: #7d8b71; background: #f0f3e9; border-radius: 7px; line-height: 1.8; }
.note-title { font-size: 9px; font-weight: 650; display: block; color: #7e916d; margin-bottom: 5px; }
.note-title svg { width: 12px; height: 12px; margin-right: 3px; }
.sentence-note:empty { display: none; }
.phrase-list-section { margin-top: 32px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading.compact h2 { font-size: 16px; }
.section-heading.compact h2 > span { font-size: 10px; color: #92a081; background: #e9eee2; padding: 2px 7px; margin-left: 7px; border-radius: 5px; vertical-align: middle; }
.section-heading.compact p { font-size: 10px; }
.phrase-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--card); }
.phrase-row { display: flex; align-items: center; gap: 17px; padding: 16px 22px; border-bottom: 1px solid #eeeee6; transition: background .18s; }
.phrase-row:last-child { border-bottom: 0; }
.phrase-row.is-current { background: #fcf0e7; }
.phrase-row:hover { background: #f8f8f1; }
.phrase-row.is-current:hover { background: #fbeadd; }
.phrase-index { font-family: Georgia, serif; font-size: 13px; color: #a5ae9b; min-width: 21px; }
.phrase-row.is-current .phrase-index { color: var(--orange); }
.phrase-row.is-learned .phrase-index { color: #7a9863; }
.phrase-index svg { width: 17px; height: 17px; }
.phrase-content { flex: 1; min-width: 0; text-align: left; padding: 0; }
.phrase-hanzi { display: block; font-size: 15px; font-weight: 500; letter-spacing: .4px; }
.phrase-pinyin { font-size: 10px; color: #c77c62; display: inline-block; margin-top: 2px; line-height: 1.65; }
.phrase-english { display: block; color: #9ca491; font-size: 10px; margin-top: 1px; }
.phrase-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.phrase-actions .icon-button { width: 32px; height: 32px; background: transparent; border-color: #e4e7da; }
.phrase-actions .icon-button:last-child { border-color: transparent; }
.phrase-row.is-playing, .word-row.is-playing, .word-card.is-playing { background: #fff1e4; outline: 1px solid #efba97; outline-offset: -1px; }
.filter-bar { display: flex; gap: 14px; margin-top: 24px; }
.search-field { flex: 1; min-width: 0; background: white; border: 1px solid #e0e4d8; border-radius: 8px; display: flex; align-items: center; gap: 12px; padding: 0 15px; min-height: 48px; }
.search-field svg { width: 18px; height: 18px; color: #9ba88d; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #a1a99a; }
.search-field:focus-within { outline: 2px solid #e9aa8b; outline-offset: 2px; }
.filter-bar select, #voice-select { border: 1px solid #e0e4d8; border-radius: 8px; background: white; color: #65745a; padding: 10px 34px 10px 13px; font-size: 11px; }
.filter-bar select { max-width: 230px; }
.results-caption { margin: 16px 0; color: #939e87; font-size: 11px; }
.wordbook-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.word-card { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; transition: border-color .2s, transform .2s; }
.word-card:hover { border-color: #cad5bf; transform: translateY(-2px); }
.word-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.word-card-main { width: 100%; display: block; padding: 7px 0 2px; text-align: left; border-radius: 6px; }
.word-card-main > span { display: block; }
.word-card-main:hover .word-card-hanzi { color: var(--orange-dark); }
.word-card-hanzi { font-family: var(--serif); font-size: 28px; line-height: 1.5; }
.word-card-pinyin { font-size: 13px; color: var(--orange); margin: 6px 0; }
.word-card-meaning { min-height: 38px; color: #87947a; font-size: 11px; line-height: 1.7; }
.word-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 17px; padding-top: 13px; border-top: 1px solid #edf0e5; }
.topic-chip { display: inline-flex; padding: 3px 7px; border-radius: 5px; background: #eff2e9; color: #91a180; font-size: 8px; max-width: 100%; }
.word-card-top .icon-button { border: 0; background: transparent; }
.saved-tabs { display: flex; gap: 5px; padding: 4px; width: fit-content; max-width: 100%; background: #ecefe4; border-radius: 8px; margin: 24px 0; }
.saved-tabs button { min-height: 35px; padding: 6px 17px; border-radius: 6px; font-size: 11px; color: #8c9980; }
.saved-tabs button.active { background: white; color: #526648; box-shadow: 0 2px 5px #26362108; }
.saved-phrase { background: var(--card); }
.saved-section-heading { display: flex; align-items: center; gap: 9px; margin: 25px 0 12px; color: #7d8c6f; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.saved-section-heading > span { font-size: 9px; letter-spacing: 0; background: #e9eee1; padding: 1px 6px; border-radius: 4px; }
#saved-content > h3 { font-size: 14px; margin: 26px 0 14px; }
.empty-state { padding: 55px 24px; text-align: center; border: 1px dashed #d7dfcc; border-radius: 14px; color: #8e9b80; background: #f8f9f3; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; background: #ebf0e2; border-radius: 50%; color: #9cae8c; margin: 0 auto 17px; }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { font-weight: 500; font-size: 16px; color: #6d805d; margin-bottom: 9px; }
.empty-state p { font-size: 12px; line-height: 1.9; }
.empty-state .text-button { margin-top: 15px; }
.page-footer { border-top: 1px solid var(--line); margin-top: 42px; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #a0a896; }
.page-footer > span { color: #8b9780; font-size: 9px; letter-spacing: 1.2px; font-weight: 600; white-space: nowrap; }
.page-footer > p { font-size: 9px; margin-right: auto; padding-left: 10px; }
.page-footer > p span { display: block; font-size: 8px; opacity: .8; }
.page-footer > button { display: flex; align-items: center; gap: 7px; font-size: 9px; padding: 8px 0; }
.page-footer > button svg { width: 11px; height: 11px; }
.status-dot.unavailable { background: #c19a68; }
.mobile-nav { display: none; }
.playback-bar { position: fixed; bottom: 25px; left: calc(50% + 114px); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 15px; width: min(440px,calc(100vw - 280px)); padding: 14px 18px; background: #344b3e; color: #f2f4e9; border-radius: 12px; box-shadow: 0 8px 35px #233b2d28; border: 1px solid #52684c; }
.playback-bar > div { flex: 1; min-width: 0; }
.playback-bar strong { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playback-bar > div > span { display: block; font-size: 9px; color: #c0ceb0; margin-top: 2px; }
.playback-bar .icon-button { background: #4b6253; border: 0; color: #dfe7d2; }
.playback-wave { display: flex; align-items: center; gap: 3px; height: 24px; flex: 0 0 auto; }
.playback-wave i { height: 9px; width: 3px; border-radius: 2px; background: #dba27e; animation: wave 1s ease-in-out infinite; }
.playback-wave i:nth-child(2) { animation-delay: .2s; }
.playback-wave i:nth-child(3) { animation-delay: .4s; }
@keyframes wave { 0%,100% { height: 7px; } 50% { height: 21px; } }
.toast { position: fixed; left: calc(50% + 114px); bottom: 30px; transform: translate(-50%,15px); background: #35483a; color: #fcfff6; font-size: 12px; line-height: 1.7; padding: 11px 19px; border-radius: 9px; box-shadow: 0 7px 22px #24322220; z-index: 120; max-width: min(540px,calc(100vw - 40px)); width: max-content; pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s; text-align: center; }
.toast.show, .toast.visible { opacity: 1; transform: translate(-50%,0); }
dialog { width: min(540px,calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid #e1e4d8; border-radius: 17px; padding: 28px; background: var(--card); color: var(--ink); box-shadow: 0 25px 90px #27392933; }
dialog::backdrop { background: #273a2d55; backdrop-filter: blur(3px); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-top h2 { font: 600 25px/1.5 var(--serif); margin-top: 7px; }
.dialog-top .icon-button { border-color: transparent; background: #f0f2e9; }
.dialog-intro { margin-top: 17px; color: #7f8d73; font-size: 12px; line-height: 1.9; }
.dialog-intro span { display: block; font-size: 10px; margin-top: 6px; color: #9aa58f; }
.field-label { display: block; font-size: 11px; color: #738665; margin: 23px 0 8px; font-weight: 550; }
#voice-select { width: 100%; min-height: 44px; }
.voice-detail { font-size: 11px; color: #8c9a7f; line-height: 1.8; margin: 10px 0 19px; }
.dialog-note { margin-top: 25px; padding: 16px; background: #f0f3e9; border-radius: 9px; }
.dialog-note strong { color: #768a66; font-size: 12px; font-weight: 600; }
.dialog-note p { font-size: 10px; color: #8a987d; line-height: 1.9; margin-top: 9px; }
.dialog-note p[lang="en"] { font-size: 10px; border-top: 1px solid #dfe5d5; padding-top: 10px; }

@media (min-width: 1650px) {
  .page-content { padding-top: 45px; }
  .hero { min-height: 252px; grid-template-columns: minmax(0,1fr) 310px; }
  .hero h1 { font-size: 47px; }
  .topic-card { padding: 19px 20px; }
}
@media (max-width: 1180px) {
  .sidebar { width: 205px; padding-left: 15px; padding-right: 15px; }
  main { margin-left: 205px; }
  .page-content { padding-left: 28px; padding-right: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .hero { grid-template-columns: minmax(0,1fr) 225px; gap: 0; }
  .hero h1 { font-size: 32px; }
  .hero-art { transform: scale(.86); transform-origin: right center; margin-left: -60px; }
  .progress-lesson-count { padding-left: 17px; margin-left: 9px; }
  .progress-strip { padding-left: 17px; padding-right: 17px; gap: 11px; }
  .progress-meter { width: 27%; }
  .lesson-layout { grid-template-columns: minmax(0,1.55fr) minmax(210px,1fr); gap: 13px; }
  .sentence-panel { padding-left: 19px; padding-right: 19px; }
  .sentence-bottom { margin-left: -19px; margin-right: -19px; padding-left: 17px; padding-right: 17px; }
  .word-panel { padding-left: 14px; padding-right: 14px; }
  .topic-card { padding: 14px 13px; }
  .topic-title { font-size: 12px; }
  .playback-bar, .toast { left: calc(50% + 102.5px); }
}
@media (max-width: 980px) and (min-width: 761px) {
  .sidebar { width: 180px; padding-left: 10px; padding-right: 10px; }
  main { margin-left: 180px; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 41px; font-size: 26px; }
  .brand strong { font-size: 23px; }
  .brand small { font-size: 6px; }
  .sidebar-caption { padding-top: 35px; font-size: 10px; }
  .sidebar-caption span { font-size: 6px; }
  .nav-item { padding: 10px; gap: 10px; }
  .nav-item > span:not(.nav-count):not(.nav-indicator) { font-size: 11px; }
  .nav-item small { font-size: 9px; }
  .sidebar-note p { font-size: 16px; }
  .sidebar-note small { font-size: 6px; }
  .page-content { padding: 26px 23px; }
  .topbar { min-height: 69px; padding: 0 23px; }
  .hero { grid-template-columns: minmax(0,1fr) 165px; min-height: 210px; margin-bottom: 22px; }
  .hero h1 { font-size: 25px; }
  .hero-art { transform: scale(.68); margin-left: -119px; height: 230px; }
  .hero-copy > p { font-size: 11px; }
  .hero-copy > p span { font-size: 9px; }
  .eyebrow { font-size: 7px; }
  .progress-copy > span { font-size: 8px; }
  .progress-lesson-count { display: none; }
  .progress-meter { width: 35%; }
  .topic-grid { gap: 8px; }
  .topic-card { padding: 13px 10px; }
  .topic-title { font-size: 11px; }
  .topic-en { font-size: 8px; }
  .topic-meta { font-size: 7px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .word-panel { padding: 17px 20px; }
  .sentence-words { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; }
  .word-row:first-child { padding-top: 12px; }
  .wordbook-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar select { min-height: 44px; }
  .page-footer > p { display: none; }
  .playback-bar, .toast { left: calc(50% + 90px); }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom,0px)); }
  .sidebar { display: none; }
  main { margin-left: 0; }
  .topbar { min-height: 65px; padding: 0 22px; }
  .breadcrumb { gap: 9px; font-size: 10px; }
  .language-badge { font-size: 9px; }
  .avatar { width: 32px; height: 32px; }
  .topbar-actions { gap: 12px; }
  .page-content { padding: 25px 22px 21px; }
  .hero { grid-template-columns: minmax(0,1fr) 185px; min-height: 218px; gap: 0; margin-bottom: 19px; }
  .hero h1 { font-size: 30px; white-space: normal; letter-spacing: -.7px; }
  .hero-art { transform: scale(.75); transform-origin: right center; margin-left: -100px; }
  .hero .text-button { margin-top: 13px; min-height: 44px; }
  .hero-copy > p { margin-top: 12px; font-size: 12px; }
  .hero-copy > p span { font-size: 10px; }
  .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .progress-strip { padding: 15px 17px; margin-bottom: 29px; gap: 11px; }
  .progress-icon { width: 34px; height: 34px; }
  .progress-icon svg { width: 19px; height: 19px; }
  .progress-copy strong { font-size: 11px; }
  .progress-copy > span { font-size: 8px; }
  .progress-meter { width: 30%; }
  .progress-lesson-count { display: none; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: 18px; }
  .section-hint { font-size: 9px; }
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; margin-bottom: 20px; }
  .topic-card { padding: 14px 16px 13px; }
  .topic-icon { width: 32px; height: 32px; float: left; margin: 3px 11px 0 0; }
  .topic-copy { min-height: 39px; }
  .topic-title { font-size: 12px; }
  .topic-en { font-size: 9px; }
  .topic-meta { margin-top: 9px; font-size: 8px; clear: both; }
  .topic-arrow { top: auto; bottom: 15px; right: 15px; }
  .lesson-layout { grid-template-columns: 1fr; gap: 16px; }
  .sentence-panel { padding: 21px 22px 0; }
  .sentence-toolbar { margin-top: 24px; }
  .sentence-ruby { min-height: 102px; padding-top: 23px; }
  .word-token { min-height: 44px; padding-left: 5px; padding-right: 5px; }
  .word-token ruby, ruby.ruby-text { font-size: 40px; }
  .word-token rt, .ruby-text rt { font-size: 13px; }
  .word-punctuation { font-size: 40px; }
  .sentence-translation { font-size: 13px; margin-bottom: 23px; }
  .primary-button, .secondary-button { min-height: 44px; font-size: 12px; padding: 11px 17px; }
  .primary-button small, .secondary-button > span { font-size: 10px; }
  .icon-button, .save-main { min-width: 44px; min-height: 44px; }
  .learning-tip { font-size: 10px; }
  .learning-tip small { font-size: 9px; }
  .sentence-bottom { margin: 0 -22px; padding: 12px 19px; }
  .learned-button { min-height: 44px; font-size: 11px; }
  .learned-button small { font-size: 9px; }
  .check-box { width: 20px; height: 20px; }
  .sentence-pagination { gap: 6px; }
  .sentence-pagination .icon-button { width: 44px; height: 44px; min-width: 44px; }
  .toggle-label { min-height: 44px; font-size: 10px; }
  .toggle-track { width: 28px; height: 16px; }
  .toggle-track::after { width: 12px; height: 12px; }
  .toggle-label input:checked + .toggle-track::after { transform: translateX(12px); }
  .word-panel { padding: 20px 21px; }
  .word-panel h3 { font-size: 13px; }
  .word-panel-heading > div > span { font-size: 8px; }
  .word-hanzi { font-size: 19px; }
  .word-pinyin { font-size: 12px; }
  .word-meaning { font-size: 11px; }
  .word-row-actions .icon-button { width: 44px; height: 44px; }
  .word-row-actions .icon-button svg { width: 17px; height: 17px; }
  .sentence-note { font-size: 11px; }
  .note-title { font-size: 10px; }
  .phrase-list-section { margin-top: 28px; }
  .phrase-row { padding: 15px 16px; gap: 11px; }
  .phrase-index { min-width: 17px; font-size: 12px; }
  .phrase-hanzi { font-size: 15px; }
  .phrase-pinyin { font-size: 11px; }
  .phrase-english { font-size: 10px; }
  .phrase-actions { gap: 1px; }
  .phrase-actions .icon-button { width: 44px; height: 44px; }
  .filter-bar { flex-wrap: wrap; gap: 10px; margin-top: 19px; }
  .search-field { flex-basis: 100%; }
  .filter-bar select { min-height: 44px; max-width: 100%; }
  .wordbook-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .word-card { padding: 17px; }
  .word-card-hanzi { font-size: 27px; }
  .word-card-pinyin { font-size: 12px; }
  .word-card-footer { margin-top: 12px; padding-top: 10px; }
  .topic-chip { font-size: 8px; }
  .word-card-footer .icon-button { min-width: 40px; min-height: 44px; }
  .saved-tabs button { min-height: 44px; padding: 8px 14px; }
  .export-button { padding: 10px 12px; font-size: 10px; flex: 0 0 auto; }
  .export-button svg { width: 15px; height: 15px; }
  #saved-view .section-heading { flex-wrap: wrap; align-items: center; }
  .page-footer { flex-wrap: wrap; margin-top: 29px; padding-top: 18px; gap: 9px 16px; }
  .page-footer > p { display: block; padding-left: 0; }
  .page-footer > button { min-height: 44px; margin-left: auto; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 60; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; background: #fffefaf5; border-top: 1px solid #e5e8db; padding: 7px 12px calc(7px + env(safe-area-inset-bottom,0px)); backdrop-filter: blur(12px); }
  .mobile-nav button { color: #93a185; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-height: 51px; border-radius: 8px; }
  .mobile-nav button svg { width: 21px; height: 21px; }
  .mobile-nav button > span { font-size: 9px; white-space: nowrap; }
  .mobile-nav button.active { background: #fcf0e7; color: var(--orange-dark); }
  .playback-bar { width: calc(100vw - 32px); max-width: 470px; bottom: calc(82px + env(safe-area-inset-bottom,0px)); left: 50%; border-radius: 11px; }
  .toast { left: 50%; bottom: calc(86px + env(safe-area-inset-bottom,0px)); font-size: 12px; }
  dialog { padding: 24px; border-radius: 14px; }
  .dialog-top .icon-button { min-width: 44px; }
  .dialog-intro { font-size: 12px; }
  .dialog-note p { font-size: 11px; }
}
@media (max-width: 480px) {
  .topbar { min-height: 59px; padding: 0 18px; }
  .topbar-actions { gap: 10px; }
  .language-badge { font-size: 8px; }
  .language-badge span { padding: 0 3px; }
  .avatar { width: 30px; height: 30px; }
  .page-content { padding: 23px 17px 18px; }
  .hero { display: block; position: relative; min-height: 201px; }
  .hero-copy { position: relative; z-index: 2; }
  .hero-art { display: none; }
  .hero h1 { font-size: 29px; margin-top: 16px; white-space: nowrap; }
  .hero-copy > p { font-size: 12px; line-height: 1.9; }
  .hero .text-button { margin-top: 13px; font-size: 11px; }
  .progress-strip { padding: 13px 13px; gap: 9px; }
  .progress-icon { width: 31px; height: 31px; }
  .progress-copy strong { font-size: 10px; }
  .progress-copy > span { font-size: 7px; }
  .progress-meter { width: 29%; }
  .progress-caption { font-size: 8px; gap: 4px; }
  .progress-caption strong { font-size: 9px; }
  .section-heading h2 { font-size: 17px; }
  .section-hint { font-size: 8px; max-width: 90px; text-align: right; }
  .topic-card { padding: 13px 12px; }
  .topic-icon { width: 29px; height: 29px; margin-right: 8px; margin-top: 3px; }
  .topic-icon svg { width: 16px; height: 16px; }
  .topic-title { font-size: 11px; }
  .topic-en { font-size: 8px; }
  .topic-meta { font-size: 7px; }
  .topic-arrow { right: 12px; bottom: 14px; }
  .sentence-panel { padding: 18px 17px 0; }
  .sentence-bottom { margin: 0 -17px; padding: 11px 15px; }
  .sentence-toolbar { margin-top: 18px; }
  .tiny-label { font-size: 6px; letter-spacing: 1.2px; }
  .word-token ruby, ruby.ruby-text { font-size: 34px; }
  .word-token rt, .ruby-text rt { font-size: 12px; }
  .word-punctuation { font-size: 34px; }
  .sentence-ruby { column-gap: 0; }
  .sentence-translation { font-size: 12px; }
  .sentence-actions { gap: 7px; }
  .sentence-actions .primary-button, .sentence-actions .secondary-button { padding: 10px 12px; gap: 6px; font-size: 11px; }
  .sentence-actions .primary-button small, .sentence-actions .secondary-button > span { font-size: 9px; }
  .learning-tip { font-size: 9px; margin-top: 19px; }
  .learning-tip small { font-size: 8px; }
  .word-panel { padding: 18px 18px; }
  .section-heading.compact h2 { font-size: 15px; }
  .section-heading.compact p { font-size: 8px; }
  .section-heading.compact .text-button { gap: 5px; font-size: 9px; min-height: 44px; }
  .phrase-row { padding: 13px 12px; gap: 8px; flex-wrap: wrap; }
  .phrase-content { flex-basis: calc(100% - 115px); }
  .phrase-index { min-width: 17px; font-size: 11px; }
  .phrase-actions { gap: 0; }
  .phrase-actions .icon-button { width: 40px; min-width: 40px; height: 44px; }
  .phrase-hanzi { font-size: 14px; }
  .phrase-pinyin { font-size: 10px; line-height: 1.7; }
  .phrase-english { font-size: 9px; line-height: 1.7; }
  .wordbook-grid { gap: 10px; }
  .word-card { padding: 13px; }
  .word-card-top { gap: 3px; }
  .word-card-hanzi { font-size: 24px; }
  .word-card-top .icon-button { min-width: 32px; width: 32px; height: 44px; }
  .word-card-pinyin { font-size: 11px; }
  .word-card-meaning { font-size: 10px; min-height: 36px; }
  .word-card-footer { flex-wrap: wrap; gap: 4px; }
  .word-card-footer .icon-button { margin-left: auto; }
  .topic-chip { font-size: 7px; padding: 3px 5px; }
  .saved-tabs { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .saved-tabs button { padding: 8px; font-size: 10px; }
  .page-footer > p { display: none; }
  .page-footer > button { font-size: 8px; }
  .playback-bar { padding: 11px 13px; gap: 12px; }
  .playback-bar .icon-button { min-width: 38px; min-height: 38px; }
  dialog { padding: 21px; }
  .dialog-top h2 { font-size: 23px; }
  .dialog-top .eyebrow { font-size: 7px; }
}
@media (max-width: 359px) {
  .topbar { padding: 0 13px; }
  .page-content { padding-left: 13px; padding-right: 13px; }
  .language-badge { display: none; }
  .hero h1 { font-size: 25px; letter-spacing: -.8px; }
  .hero .eyebrow { font-size: 7px; }
  .progress-strip { padding: 12px 11px; gap: 7px; }
  .progress-icon { display: none; }
  .progress-meter { width: 36%; }
  .section-hint { display: none; }
  .topic-card { padding: 12px 10px; }
  .topic-icon { float: none; margin: 0 0 9px; }
  .topic-copy { min-height: 35px; }
  .topic-meta { margin-top: 7px; }
  .sentence-panel { padding-left: 14px; padding-right: 14px; }
  .sentence-bottom { margin-left: -14px; margin-right: -14px; padding-left: 12px; padding-right: 12px; }
  .sentence-actions { gap: 5px; }
  .sentence-actions .primary-button, .sentence-actions .secondary-button { padding: 10px 10px; gap: 5px; }
  .sentence-actions .primary-button small, .sentence-actions .secondary-button > span { display: none; }
  .learned-button { font-size: 10px; }
  .learned-button small { font-size: 8px; }
  .sentence-pagination { gap: 3px; }
  .wordbook-grid { grid-template-columns: 1fr; }
  .word-card-hanzi { font-size: 29px; }
  .word-card-top .icon-button { min-width: 44px; }
  .word-card-meaning { min-height: auto; }
  .phrase-row { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .phrase-index { display: none; }
  .phrase-actions .icon-button { min-width: 38px; width: 38px; }
  .sentence-words .word-row-actions { gap: 0; }
  .word-row-actions .icon-button { width: 39px; min-width: 39px; }
  .word-panel { padding-left: 15px; padding-right: 15px; }
}
/* Character reader: the annotation rows belong to each character, not a word. */
.reading-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 17px;
  padding: 14px;
  background: #f8f9f3;
  border: 1px solid #e9ecdf;
  border-radius: 10px;
}
.reading-mode { min-width: 0; margin: 0; padding: 0; border: 0; }
.reading-mode legend {
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  color: #53674a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.reading-mode legend small { margin-left: 4px; color: #839177; font-size: 10px; font-weight: 400; }
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  padding: 3px;
  background: #eaeedf;
  border-radius: 7px;
}
.mode-option { position: relative; display: block; min-width: 0; cursor: pointer; }
.mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mode-option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 3px;
  border-radius: 5px;
  color: #748269;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  transition: background .18s, color .18s, box-shadow .18s;
}
.mode-option:hover > span { background: #f5f6ee; color: #4f6645; }
.mode-option input:checked + span { color: #a84b32; background: #fffdf8; box-shadow: 0 1px 4px #3a482b12; }
.mode-option input:focus-visible + span { outline: 3px solid #df9b7e; outline-offset: 2px; }
.mode-option input:disabled + span { cursor: not-allowed; opacity: .45; }
.reading-help { grid-column: 1 / -1; margin: 0; color: #65715e; font-size: 11px; line-height: 1.8; }
.reading-help > span { display: block; font-size: 10px; }
.reading-help small { font-size: 10px; color: #8b967f; }
.reading-help > small { display: block; margin-top: 2px; }
.tone-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 13px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf0e6;
  color: #87947a;
  font-size: 10px;
  line-height: 1.6;
}
.tone-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tone-legend b, .tone-legend strong, .tone-legend .tone-mark {
  display: inline-block;
  min-width: 13px;
  color: #b66d4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}
.sentence-ruby.character-reader {
  align-items: flex-end;
  justify-content: center;
  gap: 12px 9px;
  min-height: 0;
  padding: 22px 0 14px;
}
.character-word {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
.character-token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 46px;
  min-height: 54px;
  max-width: 100%;
  padding: 7px 5px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  line-height: 1;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.character-token:hover { background: #fff5eb; border-color: #f0d8c8; }
.character-token.is-selected, .character-token[aria-pressed="true"] {
  color: #9f4e32;
  background: #fdf0e5;
  border-color: #df9b78;
  box-shadow: 0 2px 5px #bd77521a;
}
.character-token:focus-visible { outline: 3px solid #d98b67; outline-offset: 3px; }
.character-token.is-playing { background: #fce5d5; border-color: #d98b67; }
.character-pinyin {
  display: block;
  min-height: 24px;
  padding-bottom: 5px;
  color: var(--orange-dark);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .15px;
  line-height: 19px;
  white-space: nowrap;
}
.character-tone {
  display: block;
  min-height: 25px;
  color: #65794f;
  font-family: Arial, "Noto Sans", sans-serif;
  font-size: 33px;
  font-weight: 600;
  line-height: 25px;
  text-align: center;
}
.character-hanzi { display: block; font-family: var(--serif); font-size: 41px; font-weight: 400; line-height: 1.2; }
.character-token.is-selected .character-tone, .character-token[aria-pressed="true"] .character-tone { color: #c07d51; }
.character-reader .annotation-hidden { visibility: hidden; }
.character-reader.pinyin-off .character-pinyin { display: none; }
.character-reader.tones-off .character-tone { display: none; }
.character-reader .word-punctuation {
  align-self: flex-end;
  margin: 0 0 0 -7px;
  padding: 0 0 10px;
  color: #6b7a61;
  font-size: 41px;
  line-height: 1.2;
}
.selection-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 3px 12px;
  margin: 0 0 13px;
  font-size: 10px;
  color: #87967a;
}
.selection-tools #selected-count { min-width: 0; line-height: 1.8; }
.selection-tools button { min-height: 36px; padding: 6px 0; font-size: 10px; color: #ad6648; }
.selection-tools button svg { width: 13px; height: 13px; }
.character-inspector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 4px 0 20px;
  padding: 11px 14px;
  background: #fff7ef;
  border: 1px solid #efdecd;
  border-radius: 9px;
}
.character-inspector-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; min-width: 0; }
.character-inspector-copy strong { color: #4f6046; font-family: var(--serif); font-size: 29px; font-weight: 500; line-height: 1.4; }
.character-inspector-copy #inspector-pinyin { color: #b86241; font-size: 13px; }
.character-inspector-copy #inspector-tone { color: #8c917c; font-size: 10px; }
.character-inspector-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; min-width: 0; }
.character-inspector-actions .text-button { min-height: 38px; gap: 6px; font-size: 10px; font-weight: 500; }
.character-inspector-actions .text-button svg { width: 15px; height: 15px; }
.character-inspector-note { flex-basis: 100%; margin: 2px 0 0; color: #7a735f; font-size: 10px; line-height: 1.7; }
.character-inspector-note > span { display: block; }
@media (max-width: 760px) {
  .reading-controls { gap: 13px; padding: 13px; margin-top: 15px; }
  .reading-mode legend { font-size: 12px; }
  .reading-mode legend small { font-size: 10px; }
  .mode-option > span { min-height: 44px; font-size: 11px; }
  .reading-help { font-size: 11px; }
  .tone-legend { gap: 5px 15px; font-size: 10px; }
  .sentence-ruby.character-reader { gap: 12px 9px; padding-top: 22px; }
  .character-token { min-width: 48px; min-height: 56px; padding: 7px 5px 9px; }
  .character-hanzi, .character-reader .word-punctuation { font-size: 40px; }
  .character-pinyin { font-size: 13px; }
  .selection-tools { font-size: 11px; margin-bottom: 12px; }
  .selection-tools button { min-height: 44px; font-size: 11px; }
  .character-inspector { padding: 11px 13px; }
  .character-inspector-copy #inspector-tone { font-size: 11px; }
  .character-inspector-actions .text-button { min-height: 44px; font-size: 11px; }
}
@media (max-width: 480px) {
  .reading-controls { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 12px; }
  .reading-mode legend { margin-bottom: 6px; font-size: 11px; }
  .reading-mode legend small { font-size: 10px; }
  .mode-option > span { padding: 7px 5px; font-size: 11px; }
  .reading-help { font-size: 10px; }
  .reading-help small { font-size: 9px; }
  .tone-legend { column-gap: 11px; font-size: 9px; }
  .tone-legend b, .tone-legend strong, .tone-legend .tone-mark { font-size: 18px; min-width: 11px; }
  .sentence-ruby.character-reader { gap: 11px 7px; padding: 21px 0 13px; }
  .character-word { gap: 1px; }
  .character-token { min-width: 45px; padding-left: 4px; padding-right: 4px; }
  .character-pinyin { font-size: 12px; letter-spacing: 0; min-height: 23px; padding-bottom: 4px; }
  .character-tone { min-height: 25px; line-height: 25px; font-size: 31px; }
  .character-hanzi, .character-reader .word-punctuation { font-size: 35px; }
  .character-reader .word-punctuation { margin-left: -7px; }
  .selection-tools { gap: 2px 10px; font-size: 10px; }
  .selection-tools button { font-size: 10px; }
  .character-inspector { gap: 5px 11px; padding: 10px 12px; }
  .character-inspector-copy strong { font-size: 27px; }
  .character-inspector-copy #inspector-pinyin { font-size: 12px; }
  .character-inspector-copy #inspector-tone { font-size: 10px; }
  .character-inspector-actions { column-gap: 11px; }
  .character-inspector-actions .text-button { font-size: 10px; }
}
@media (max-width: 359px) {
  .reading-controls { padding: 10px; }
  .tone-legend { column-gap: 10px; row-gap: 5px; }
  .sentence-ruby.character-reader { column-gap: 5px; }
  .character-token { min-width: 44px; padding-left: 3px; padding-right: 3px; }
  .character-hanzi, .character-reader .word-punctuation { font-size: 33px; }
  .character-inspector-actions { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
