:root {
  --canvas: oklch(92.5% .012 82);
  --paper: oklch(97.8% .010 84);
  --paper-deep: oklch(89% .018 78);
  --ink: oklch(29% .010 72);
  --muted: oklch(51% .016 74);
  --earth: oklch(58% .045 66);
  --sage: oklch(72% .028 145);
  --line: oklch(82% .014 80);
  --dark: oklch(25% .009 77);
  --dark-soft: oklch(31% .009 77);
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 3px rgba(50,45,37,.12), 0 18px 42px rgba(50,45,37,.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(circle at 82% 8%, rgba(255,255,255,.34), transparent 30%),
    repeating-linear-gradient(90deg, rgba(79,72,61,.018) 0 1px, transparent 1px 5px);
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; }
button, .file-button { touch-action: manipulation; }
button { color: inherit; transition-property: transform, background-color, color, opacity; transition-duration: 160ms; }
button:active, .file-button:active { transform: scale(.96); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .file-button:focus-within, a:focus-visible {
  outline: 2px solid var(--earth);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .42; }
.skip-link { position: fixed; left: 16px; top: 10px; z-index: 50; transform: translateY(-140%); padding: 9px 12px; background: var(--ink); color: var(--paper); border-radius: var(--r-sm); }
.skip-link:focus { transform: translateY(0); }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0,1fr); }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  color: #ece8de;
  background-color: var(--dark);
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.026) 0 1px, transparent 1px 4px),
    linear-gradient(165deg, rgba(255,255,255,.025), transparent 42%);
  z-index: 10;
}
.brand { min-height: 52px; display: flex; align-items: center; gap: 12px; border: 0; padding: 0 6px; background: none; color: #f4f0e8; text-align: left; cursor: pointer; }
.brand img { display: block; width: 42px; height: 42px; border-radius: var(--r-sm); box-shadow: 0 2px 8px rgba(0,0,0,.24); }
.brand > span { font-weight: 760; font-size: 18px; }
.brand small { display: block; margin-top: 4px; color: #aaa69d; font-size: 10px; font-weight: 500; }
.local-badge { margin: 23px 4px 17px; padding: 10px 9px; display: grid; grid-template-columns: 8px 1fr; column-gap: 7px; border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.local-badge i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #91c9a5; }
.local-badge span { color: #d9e8df; font-size: 11px; }
.local-badge small { grid-column: 2; margin-top: 3px; color: #908d85; font-size: 10px; }
.primary-nav { display: grid; gap: 3px; }
.primary-nav button { position: relative; min-height: 43px; display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; border: 0; border-radius: var(--r-sm); padding: 0 10px; background: transparent; color: #b9c7c0; cursor: pointer; text-align: left; }
.primary-nav button > span { color: #77776f; font: 10px Georgia, serif; }
.primary-nav button b { min-width: 20px; color: #d9e8df; font-size: 10px; text-align: right; }
.primary-nav button.active { background: rgba(255,255,255,.095); color: #fff; }
.primary-nav button.active:after { content: ""; position: absolute; left: 10px; bottom: 8px; width: 12px; height: 1px; background: #a68a68; }
.rail-foot { margin-top: auto; padding: 16px 6px 0; border-top: 1px solid rgba(255,255,255,.12); }
.rail-foot strong { display: block; color: #f1ede5; font: 22px Georgia, serif; }
.rail-foot span { display: block; margin-top: 6px; color: #8f8c84; font-size: 11px; }

.workspace { min-width: 0; }
.topbar { height: 72px; padding: 0 clamp(20px,4vw,54px); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar strong { display: block; font-size: 13px; letter-spacing: .08em; }
.topbar > div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; gap: 8px; }
.top-actions button { min-height: 38px; border: 0; border-radius: var(--r-sm); padding: 0 12px; background: var(--paper-deep); cursor: pointer; font-size: 12px; }
.top-actions .privacy-state { background: transparent; }
.privacy-state i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #7daf91; }

main { min-width: 0; max-width: 1280px; margin: 0 auto; padding: clamp(22px,3.2vw,42px) clamp(16px,4vw,54px) 100px; }
main:focus { outline: none; }
.view { display: none; min-width: 0; }
.view.active { display: block; }
.landing-mode { padding-bottom: 0; }
.landing-mode .app-shell { display: block; }
.landing-mode .rail, .landing-mode .topbar, .landing-mode .mobile-nav, .landing-mode .mobile-more { display: none; }
.landing-mode main { max-width: none; padding: 0; }
.landing-view { min-height: 100vh; background: var(--paper); }
.landing-nav { min-height: 78px; max-width: 1440px; margin: 0 auto; padding: 14px clamp(20px,4.5vw,70px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.landing-brand { min-height: 50px; display: flex; align-items: center; gap: 11px; border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; }
.landing-brand img { width: 44px; height: 44px; border-radius: var(--r-sm); }
.landing-brand strong, .landing-brand small { display: block; }
.landing-brand strong { font-size: 16px; }
.landing-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.landing-nav-actions { display: flex; align-items: center; gap: 24px; }
.landing-nav-actions > span { color: var(--muted); font-size: 10px; }
.landing-nav-actions i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #7daf91; }
.landing-nav-actions button { min-height: 40px; border: 0; border-bottom: 1px solid var(--ink); padding: 0 2px; background: transparent; cursor: pointer; font-weight: 700; }
.landing-hero { height: min(650px,calc(100svh - 78px)); min-height: 540px; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(530px,.92fr) minmax(0,1.08fr); }
.landing-copy { padding: clamp(42px,5.4vw,78px) clamp(32px,5vw,74px) 38px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.landing-copy h1 { width: 100%; margin: 16px 0 20px; font: 700 clamp(42px,4.35vw,63px)/1.08 Georgia, "Songti SC", "Noto Serif SC", serif; letter-spacing: -.012em; }
.landing-copy h1 span { display: block; white-space: nowrap; }
.landing-copy > p { max-width: 35em; margin: 0 0 54px; color: var(--muted); font-size: 13px; line-height: 1.75; text-wrap: pretty; }
.landing-primary { width: min(100%,320px); min-height: 52px; display: flex; align-items: center; justify-content: space-between; border: 0; padding: 0 20px 0 23px; background: var(--ink); color: var(--paper); cursor: pointer; font-weight: 760; }
.landing-primary b { font: 24px Georgia, serif; }
.landing-quiet { min-height: 34px; margin-top: 7px; border: 0; border-bottom: 1px solid var(--line); padding: 0 1px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.landing-proof { width: 100%; margin-top: auto; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 7px 18px; color: var(--earth); font-size: 9px; }
.landing-proof span + span:before { content: "/"; margin-right: 22px; color: var(--line); }
.landing-art { position: relative; min-width: 0; margin: 0; overflow: hidden; background: var(--paper-deep); }
.landing-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 63% center; outline: 1px solid rgba(65,56,44,.1); outline-offset: -1px; }
.landing-art figcaption { position: absolute; left: 30px; right: 30px; bottom: 24px; display: flex; justify-content: space-between; gap: 20px; color: rgba(54,48,40,.62); font-size: 9px; }
.landing-art figcaption small { font-size: inherit; }
.landing-method { padding: clamp(92px,11vw,160px) clamp(24px,8vw,120px); display: grid; grid-template-columns: minmax(260px,.58fr) minmax(0,1.42fr); gap: clamp(50px,9vw,150px); background: var(--canvas); }
.landing-section-head h2, .landing-contents h2 { margin: 16px 0 0; font: 700 clamp(37px,4.3vw,62px)/1.14 Georgia, "Songti SC", serif; text-wrap: balance; }
.landing-method ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.landing-method li { min-height: 122px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.landing-method li > b { color: var(--earth); font: 12px Georgia, serif; }
.landing-method h3 { margin: 0 0 7px; font: 700 23px Georgia, "Songti SC", serif; }
.landing-method p { max-width: 45em; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.landing-method li > span { color: var(--earth); font-size: 10px; }
.landing-contents { min-height: 720px; padding: clamp(90px,10vw,150px) clamp(24px,8vw,120px); display: grid; grid-template-columns: minmax(280px,.82fr) minmax(0,1.18fr); gap: clamp(56px,10vw,170px); align-items: start; background: var(--paper); }
.landing-contents-copy { position: sticky; top: 55px; }
.landing-contents-copy > p { max-width: 35em; margin: 25px 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.landing-contents-copy > button { min-height: 45px; border: 0; border-bottom: 1px solid var(--ink); padding: 0; background: transparent; cursor: pointer; font-weight: 700; }
.landing-contents-copy > button span { margin-left: 12px; font-size: 18px; }
.landing-index { border-top: 1px solid var(--line); }
.landing-index button { width: 100%; min-height: 92px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 19px; border: 0; border-bottom: 1px solid var(--line); padding: 0 4px; background: transparent; cursor: pointer; text-align: left; }
.landing-index button > b { color: var(--earth); font: 11px Georgia, serif; }
.landing-index strong, .landing-index small { display: block; }
.landing-index strong { font: 700 20px Georgia, "Songti SC", serif; }
.landing-index small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.landing-index i { color: var(--earth); font: normal 9px Georgia, serif; letter-spacing: .1em; }
.landing-end { min-height: 560px; padding: clamp(82px,10vw,140px) clamp(24px,8vw,120px) 48px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; gap: 46px 80px; color: #e9e4da; background-color: var(--dark); background-image: repeating-linear-gradient(90deg,rgba(255,255,255,.024) 0 1px,transparent 1px 4px); }
.landing-end > div > span { color: #969187; font-size: 9px; letter-spacing: .14em; }
.landing-end h2 { max-width: 830px; margin: 17px 0 0; font: 700 clamp(42px,5.2vw,76px)/1.14 Georgia, "Songti SC", serif; color: #f0ece4; text-wrap: balance; }
.landing-end button { align-self: end; min-height: 52px; border: 0; border-bottom: 1px solid rgba(255,255,255,.42); padding: 0 2px; background: transparent; color: #eee9e0; cursor: pointer; font-weight: 700; }
.landing-end button span { margin-left: 22px; font-size: 20px; }
.landing-end > p { grid-column: 1/-1; margin: 0; color: #868178; font-size: 10px; }
.section-label { color: #6e655a; font-size: 10px; font-weight: 780; letter-spacing: .13em; }
.view-intro { margin: 3px 0 28px; max-width: 760px; }
.view-intro h1 { margin: 8px 0 10px; font: 700 clamp(31px,4vw,49px)/1.14 Georgia, "Songti SC", serif; text-wrap: balance; }
.view-intro p { max-width: 65ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; text-wrap: pretty; }
.compact-intro { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.compact-intro h1 { margin-bottom: 0; }
.word-discovery-actions { display: flex; align-items: center; gap: 8px; }
.random-word-button { min-width: 142px; min-height: 43px; display: grid; grid-template-columns: 24px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; border: 0; border-radius: var(--r-sm); padding: 6px 12px 6px 9px; background: var(--ink); color: var(--paper); cursor: pointer; text-align: left; }
.random-word-button > span { grid-row: 1/3; display: grid; place-items: center; width: 22px; height: 22px; color: #cbb79d; font-size: 17px; }
.random-word-button b { font-size: 12px; }
.random-word-button small { color: #aaa297; font-size: 9px; }
.paper-surface { background-color: var(--paper); background-image: repeating-linear-gradient(90deg, rgba(78,70,58,.025) 0 1px, transparent 1px 5px); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.dark-surface { color: #e9e4da; background-color: var(--dark); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.024) 0 1px, transparent 1px 4px); border-radius: var(--r-lg); }
.primary-button, .secondary-button, .file-button { min-height: 42px; border: 0; border-radius: var(--r-sm); padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; }
.primary-button { background: var(--ink); color: #f5f1e8; }
.secondary-button, .file-button { background: var(--paper-deep); color: var(--ink); }
.is-speaking { position: relative; }
.primary-button.is-speaking { background: var(--dark-soft); }
.secondary-button.is-speaking, button.is-speaking:not(.primary-button) { background-color: #d5cbbb; }
.speech-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.speech-control-icon { position: relative; width: 13px; height: 14px; display: inline-block; flex: 0 0 13px; }
.speech-control-icon.pause:before, .speech-control-icon.pause:after { position: absolute; top: 1px; bottom: 1px; width: 3px; content: ""; border-radius: 1px; background: currentColor; }
.speech-control-icon.pause:before { left: 2px; }
.speech-control-icon.pause:after { right: 2px; }
.speech-control-icon.play:before { position: absolute; top: 1px; left: 3px; content: ""; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.text-button { min-height: 40px; border: 0; padding: 0 4px; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }

.today-grid { min-height: 590px; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.55fr); }
.today-brief { position: relative; padding: clamp(34px,6vw,76px); display: flex; flex-direction: column; justify-content: center; border-radius: var(--r-lg) 0 0 var(--r-lg); }
.today-brief:before { content: ""; position: absolute; left: 12%; top: 0; bottom: 0; width: 14%; background: linear-gradient(90deg, transparent, rgba(117,104,84,.055), transparent); pointer-events: none; }
.today-brief > * { position: relative; }
.today-brief h1 { max-width: 730px; margin: 12px 0 15px; font: 700 clamp(38px,4.7vw,62px)/1.08 Georgia, "Songti SC", serif; text-wrap: balance; }
.today-brief p { max-width: 610px; margin: 0; color: var(--muted); line-height: 1.8; text-wrap: pretty; }
.today-outcome { margin: 30px 0 26px; display: grid; gap: 8px; }
.today-outcome span { font: 700 clamp(23px,2.4vw,34px)/1.28 Georgia, serif; }
.today-brief .primary-button { align-self: flex-start; }
.session-summary { margin-top: 14px; min-height: 18px; color: var(--muted); font-size: 12px; }
.today-plan { padding: 48px 30px 30px; border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.today-plan .section-label { color: #aaa297; }
.today-plan ol { list-style: none; margin: 28px 0; padding: 0; }
.today-plan li { position: relative; min-height: 86px; display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 12px; color: #a9a49a; }
.today-plan li:after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 7px; width: 1px; background: rgba(255,255,255,.13); }
.today-plan li:last-child:after { display: none; }
.today-plan li b { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; font: 11px Georgia, serif; }
.today-plan li span { font-size: 13px; font-weight: 700; }
.today-plan li small { display: block; margin-top: 5px; color: #817e77; font-weight: 500; line-height: 1.5; }
.today-plan > p { margin: 10px 0 0; color: #858077; font-size: 10px; line-height: 1.6; }

.session-panel { min-height: 530px; margin-top: 24px; padding: clamp(25px,5vw,58px); }
.session-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.session-progress { height: 3px; margin: 12px 0 42px; overflow: hidden; background: var(--paper-deep); }
.session-progress i { display: block; width: 0; height: 100%; background: var(--earth); transition-property: transform; transition-duration: 220ms; transform-origin: left; }
.learning-card { max-width: 760px; margin: auto; }
.learning-card h2 { margin: 8px 0 14px; font: 700 clamp(31px,4vw,48px)/1.16 Georgia, "Songti SC", serif; text-wrap: balance; }
.learning-card .english-focus { margin: 24px 0 8px; font: 700 clamp(31px,4.4vw,54px)/1.18 Georgia, serif; letter-spacing: -.018em; overflow-wrap: anywhere; }
.learning-card .ipa-line { color: #655e55; font: 20px/1.55 Georgia, serif; }
.learning-card .translation { margin-top: 8px; color: var(--muted); font-size: 15px; }
.learning-card .teaching-note { margin: 23px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.75; }
.recall-mask { min-height: 86px; margin: 24px 0; display: grid; place-items: center; background: var(--paper-deep); color: #7b746a; font: 700 25px Georgia, serif; letter-spacing: .15em; }
.rating-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rating-row button { min-height: 42px; border: 0; border-radius: var(--r-sm); padding: 0 15px; background: var(--paper-deep); cursor: pointer; }
.rating-row button:last-child { background: var(--ink); color: #f5f1e8; }
.capability-strip { margin: 36px 0 0; padding: 28px 4px; display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.3fr); gap: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capability-strip h2 { margin: 7px 0 0; font: 700 25px Georgia, "Songti SC", serif; }
.capability-list { display: grid; gap: 6px; align-content: center; }
.capability-list p { margin: 0; padding: 9px 0; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.capability-list p.stable { color: var(--ink); }
.daily-encouragement { margin-top: 22px; min-height: 150px; display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: clamp(22px,4vw,52px); padding: 24px clamp(8px,3vw,34px); border-bottom: 1px solid var(--line); }
.encouragement-mark { width: 82px; height: 82px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--earth); font: 700 34px Georgia, "Songti SC", serif; }
.daily-encouragement h2 { margin: 7px 0 8px; font: 700 25px Georgia, "Songti SC", serif; }
.daily-encouragement p { max-width: 68ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

.lookup-desk { position: relative; padding: clamp(20px,4vw,48px); overflow: hidden; }
.lookup-desk:after { content: "Aa"; position: absolute; right: 24px; top: 6px; color: rgba(79,71,59,.05); font: 700 112px Georgia, serif; pointer-events: none; }
.lookup-desk > * { position: relative; z-index: 1; }
.lookup-desk > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.lookup-desk textarea { width: 100%; min-height: 124px; display: block; resize: vertical; border: 0; border-bottom: 1px solid var(--line); padding: 13px 0; background: transparent; color: var(--ink); font: 700 clamp(25px,3.4vw,43px)/1.4 Georgia, "Songti SC", serif; }
.lookup-desk textarea::placeholder { color: #a39c91; }
.lookup-desk .translation-label { margin-top: 14px; }
.translation-input { width: min(560px,100%); min-height: 40px; display: block; border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; background: transparent; color: var(--ink); }
.translation-input::placeholder { color: #a39c91; }
.lookup-ipa { min-height: 34px; margin: 14px 0 3px; color: #60594f; font: 19px/1.55 Georgia, serif; overflow-wrap: anywhere; }
.lookup-words { min-height: 44px; display: flex; gap: 7px; overflow-x: auto; padding: 5px 0 11px; }
.lookup-words button { flex: 0 0 auto; min-height: 38px; border: 0; border-radius: var(--r-sm); padding: 5px 10px; background: var(--paper-deep); cursor: pointer; }
.lookup-words strong, .lookup-words span { display: block; }
.lookup-words strong { font: 600 12px Georgia, serif; }
.lookup-words span { margin-top: 2px; color: var(--muted); font: 12px Georgia, serif; }
.voice-settings { margin-top: 20px; padding-top: 16px; display: flex; align-items: end; gap: 10px; border-top: 1px solid var(--line); }
.segmented { flex: 0 0 auto; display: flex; padding: 3px; background: var(--paper-deep); border-radius: var(--r-sm); }
.segmented button { min-height: 34px; border: 0; border-radius: var(--r-xs); padding: 0 10px; background: transparent; cursor: pointer; font-size: 12px; }
.segmented button.active { background: var(--paper); }
.voice-settings label { min-width: 0; flex: 1; color: var(--muted); font-size: 10px; }
.voice-settings select { width: 100%; height: 36px; display: block; margin-top: 5px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); }
.voice-settings > button { min-height: 36px; border: 0; border-radius: var(--r-sm); padding: 0 12px; background: var(--ink); color: var(--paper); cursor: pointer; }
.history-section { margin-top: 28px; }
.section-row { display: flex; align-items: center; justify-content: space-between; }
.section-row h2 { margin: 0; font: 700 23px Georgia, "Songti SC", serif; }
.history-list { display: flex; gap: 8px; overflow-x: auto; padding: 13px 0 3px; }
.history-list button { flex: 0 0 auto; max-width: 260px; min-height: 40px; border: 0; border-radius: var(--r-sm); padding: 0 13px; background: var(--paper-deep); white-space: nowrap; overflow: hidden; text-overflow: clip; cursor: pointer; }
.empty-note { color: var(--muted); font-size: 13px; line-height: 1.7; }

.phonetic-toolbar { min-height: 54px; margin: -4px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.phonetic-groups { display: flex; gap: 5px; overflow-x: auto; padding: 5px 0 10px; }
.phonetic-groups button { flex: 0 0 auto; min-height: 39px; display: flex; align-items: center; gap: 7px; border: 0; border-radius: var(--r-sm); padding: 0 13px; background: rgba(255,255,255,.34); color: var(--muted); cursor: pointer; }
.phonetic-groups button strong { font-size: 13px; }
.phonetic-groups button span { font-size: 10px; opacity: .75; }
.phonetic-groups button.active { background: var(--ink); color: var(--paper); }
.phonetic-toolbar > p { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 11px; }
.master-detail { min-height: 620px; display: grid; grid-template-columns: minmax(220px,.5fr) minmax(0,1.5fr); gap: 22px; }
.lesson-index { max-height: 760px; display: grid; align-content: start; overflow-y: auto; padding-right: 5px; }
.lesson-index button { min-height: 52px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 0 8px; background: transparent; cursor: pointer; text-align: left; }
.lesson-index button strong { font: 600 17px Georgia, serif; }
.lesson-index button span { padding-left: 10px; font-size: 12px; }
.lesson-index button i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.lesson-index button.complete i { background: #7daf91; }
.lesson-index button.active { background: rgba(255,255,255,.35); }
.lesson-detail { min-width: 0; padding: clamp(28px,5vw,58px); }
.lesson-detail .sound-symbol { color: var(--earth); font: 700 clamp(37px,5vw,68px)/1 Georgia, serif; }
.lesson-detail h2 { margin: 17px 0 10px; font: 700 clamp(29px,3.6vw,43px)/1.16 Georgia, "Songti SC", serif; }
.lesson-detail .sound-focus { max-width: 62ch; color: var(--muted); line-height: 1.8; }
.phoneme-heading { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: clamp(20px,4vw,42px); }
.phoneme-heading .sound-symbol { min-width: 108px; text-align: center; }
.phoneme-heading h2 { margin: 7px 0 0; }
.accent-symbol { display: inline-block; margin-top: 7px; color: var(--earth); font: 13px Georgia, serif; }
.phoneme-listen { margin-top: 30px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 22px; padding: 22px; border: 1px solid rgba(118,100,77,.25); border-radius: var(--r-md); background: var(--paper-deep); }
.phoneme-listen strong { font-size: 13px; }
.phoneme-listen p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.phoneme-listen button { white-space: nowrap; }
.phoneme-truth { margin: 11px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.articulation-section, .example-section { margin-top: 31px; }
.articulation-section h3, .detail-section-title h3 { margin: 0; font: 700 20px Georgia, "Songti SC", serif; }
.articulation-grid { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.articulation-grid > div { min-width: 0; min-height: 104px; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.articulation-grid span, .contrast-card span { color: var(--earth); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.articulation-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.detail-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.detail-section-title span { color: var(--muted); font-size: 11px; }
.example-sounds { margin-top: 13px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.example-sounds button { position: relative; min-width: 0; min-height: 128px; display: grid; align-content: center; border: 0; border-radius: var(--r-md); padding: 15px; background: rgba(255,255,255,.45); cursor: pointer; text-align: left; }
.example-sounds small { position: absolute; top: 11px; left: 12px; color: var(--muted); font-size: 9px; }
.example-sounds strong { font: 700 clamp(22px,2.4vw,30px)/1.2 Georgia, serif; overflow-wrap: anywhere; }
.example-sounds span { margin-top: 5px; color: var(--muted); font: 13px/1.4 Georgia, serif; overflow-wrap: anywhere; }
.example-sounds mark { padding: 0 2px; background: transparent; color: var(--earth); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.example-sounds b { position: absolute; right: 12px; bottom: 11px; color: var(--earth); font-size: 10px; }
.notation-explain { grid-template-columns: minmax(0,1fr); }
.notation-examples { margin-top: 13px; display: grid; gap: 7px; }
.notation-examples button { min-height: 82px; display: grid; grid-template-columns: minmax(90px,.7fr) minmax(110px,.8fr) minmax(0,1.5fr) auto; align-items: center; gap: 14px; border: 0; border-bottom: 1px solid var(--line); padding: 12px 8px; background: transparent; cursor: pointer; text-align: left; }
.notation-examples small { color: var(--muted); font-size: 10px; }
.notation-examples strong { font: 700 20px Georgia, serif; }
.notation-examples span { color: var(--earth); font: 18px Georgia, serif; }
.notation-examples b { color: var(--muted); font-size: 10px; }
.contrast-card { margin-top: 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contrast-card strong { display: block; margin-top: 6px; font: 700 20px Georgia, serif; }
.contrast-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.contrast-card button { white-space: nowrap; }
.practice-order { margin-top: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.practice-order strong { margin-right: 4px; font-size: 11px; }
.practice-order span { padding: 7px 9px; border-radius: var(--r-xs); background: var(--paper-deep); color: var(--muted); font-size: 10px; }
.mouth-note { margin: 27px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.7; }
.pair-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pair-stage button { min-height: 106px; border: 0; border-radius: var(--r-md); background: var(--paper-deep); cursor: pointer; }
.pair-stage strong { display: block; font: 700 28px Georgia, serif; }
.pair-stage span { display: block; margin-top: 6px; color: var(--muted); font: 16px Georgia, serif; }
.lesson-complete { margin-top: 18px; }

.learning-track-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; margin-bottom: 17px; }
.learning-track-tabs button { min-width: 0; min-height: 74px; display: grid; align-content: center; gap: 6px; border: 0; border-radius: var(--r-sm); padding: 12px 14px; background: rgba(255,255,255,.36); cursor: pointer; text-align: left; }
.learning-track-tabs button span { color: var(--earth); font-size: 10px; }
.learning-track-tabs button strong { font: 700 14px Georgia, "Songti SC", serif; }
.learning-track-tabs button.active { background: var(--ink); color: var(--paper); }
.learning-track-tabs button.active span { color: #c9b8a3; }
.learning-track { padding: clamp(28px,5vw,56px); }
.track-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.track-head h2 { margin: 8px 0 10px; font: 700 clamp(29px,3.7vw,44px)/1.15 Georgia, "Songti SC", serif; }
.track-head p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.track-head button { white-space: nowrap; }
.track-steps { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.track-steps > div { min-height: 96px; display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 12px; padding: 14px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.track-steps > div > b { color: var(--earth); font: 12px Georgia, serif; }
.track-steps strong, .track-steps small { display: block; }
.track-steps strong { font: 700 16px Georgia, "Songti SC", serif; }
.track-steps small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.ai-term-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.ai-term-grid button { min-width: 0; min-height: 75px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); padding: 11px 5px; background: transparent; cursor: pointer; text-align: left; }
.ai-term-grid strong, .ai-term-grid small { display: block; }
.ai-term-grid strong { font: 700 16px Georgia, serif; overflow-wrap: anywhere; }
.ai-term-grid small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ai-term-grid button > b { color: var(--earth); font-size: 10px; }
.track-source, .collection-note { color: var(--muted); font-size: 10px; line-height: 1.7; }
.track-source { margin: 22px 0 0; }
.collection-note { margin: 12px 4px 0; }

.search-field { width: min(330px,100%); min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--paper); border-radius: var(--r-sm); box-shadow: 0 1px 3px rgba(50,45,37,.1); }
.search-field input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); }
.pack-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 3px 0 18px; }
.pack-tabs button { flex: 0 0 auto; min-height: 38px; border: 0; border-radius: var(--r-sm); padding: 0 12px; background: rgba(255,255,255,.35); color: var(--muted); cursor: pointer; }
.pack-tabs button.active { background: var(--ink); color: var(--paper); }
.pack-tabs button small { margin-left: 5px; opacity: .7; }
.library-layout { min-height: 620px; display: grid; grid-template-columns: minmax(300px,.9fr) minmax(0,1.1fr); gap: 22px; }
.library-list { min-width: 0; max-height: 680px; overflow: auto; padding-right: 5px; }
.library-row { width: 100%; min-height: 74px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); padding: 10px 8px; background: transparent; cursor: pointer; text-align: left; }
.library-row.active { background: rgba(255,255,255,.38); }
.library-row strong { display: block; font: 700 19px/1.3 Georgia, "Songti SC", serif; }
.library-row span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.library-row b { min-width: 44px; color: var(--muted); font-size: 10px; font-weight: 600; text-align: right; }
.library-detail { position: sticky; top: 92px; min-width: 0; align-self: start; padding: clamp(24px,4vw,46px); }
.detail-kicker { color: var(--muted); font-size: 11px; }
.library-detail h2 { margin: 8px 0 5px; font: 700 clamp(32px,4vw,48px)/1.2 Georgia, "Songti SC", serif; overflow-wrap: anywhere; }
.detail-ipa { color: #625a51; font: 20px/1.5 Georgia, serif; }
.detail-zh { margin-top: 8px; font-weight: 700; }
.detail-example { margin: 25px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-example strong { display: block; font: 700 21px/1.5 Georgia, serif; }
.detail-example span { display: block; margin-top: 7px; color: var(--muted); line-height: 1.6; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status-label { display: inline-block; margin-top: 19px; color: var(--muted); font-size: 11px; }

.review-stage { min-height: 420px; padding: clamp(26px,5vw,58px); }
.review-card { max-width: 720px; margin: auto; }
.review-card .prompt { margin: 20px 0; font: 700 clamp(28px,3.8vw,44px)/1.25 Georgia, "Songti SC", serif; text-wrap: balance; }
.review-card .answer { margin: 20px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-card .answer strong { display: block; font: 700 27px/1.4 Georgia, serif; }
.review-card .answer span { display: block; margin-top: 7px; color: var(--muted); }
.review-stats { margin-top: 22px; display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); }
.review-stats div { padding: 17px; background: var(--canvas); }
.review-stats strong { display: block; font: 700 25px Georgia, serif; }
.review-stats span { color: var(--muted); font-size: 11px; }

.paper-intro { margin-bottom: 20px; }
.paper-drop { min-height: 104px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 22px 25px; cursor: pointer; }
.paper-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.paper-drop-mark { width: 52px; height: 58px; display: grid; place-items: center; color: var(--paper); background: var(--ink); border-radius: var(--r-xs); font: 700 24px Georgia, serif; }
.paper-drop strong, .paper-drop small { display: block; }
.paper-drop strong { font: 700 20px Georgia, "Songti SC", serif; }
.paper-drop small { margin-top: 6px; color: var(--muted); font-size: 11px; }
.paper-drop b { min-height: 40px; display: grid; place-items: center; padding: 0 15px; color: var(--paper); background: var(--ink); border-radius: var(--r-sm); font-size: 12px; }
.paper-privacy { margin: 11px 4px 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.paper-empty { min-height: 300px; margin-top: 31px; display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: center; gap: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-empty > span { color: var(--line); font: 700 82px/1 Georgia, serif; }
.paper-empty h2 { margin: 0 0 8px; font: 700 27px Georgia, "Songti SC", serif; }
.paper-empty p { max-width: 62ch; margin: 0; color: var(--muted); line-height: 1.75; }
.paper-empty small { display: block; margin-top: 13px; color: var(--earth); line-height: 1.6; }
.paper-workspace { min-height: 680px; margin-top: 28px; display: grid; grid-template-columns: minmax(230px,.54fr) minmax(0,1.46fr); gap: 22px; }
.paper-outline { min-width: 0; }
.paper-meta { padding: 3px 8px 17px; border-bottom: 1px solid var(--line); }
.paper-meta h2 { margin: 7px 0; font: 700 20px/1.35 Georgia, "Songti SC", serif; overflow-wrap: anywhere; }
.paper-meta p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.paper-sections { max-height: 660px; overflow-y: auto; }
.paper-sections button { width: 100%; min-height: 66px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--line); padding: 9px 8px; background: transparent; cursor: pointer; text-align: left; }
.paper-sections button.active { background: rgba(255,255,255,.42); }
.paper-sections b { color: var(--earth); font: 10px Georgia, serif; }
.paper-sections span { display: -webkit-box; overflow: hidden; color: var(--muted); font: 12px/1.5 Georgia, serif; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.paper-reader { min-width: 0; padding: clamp(25px,4vw,48px); }
.paper-reader-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.paper-bilingual { --paper-english-width: 62%; margin: 27px 0 18px; display: grid; grid-template-columns: var(--paper-english-width) 13px minmax(0,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-bilingual > section { min-width: 0; }
.paper-original-panel { grid-column: 1; padding: 22px 20px 24px 0; }
.paper-translation-panel { grid-column: 3; padding: 22px 0 24px 20px; }
.paper-divider { position: relative; grid-column: 2; min-width: 13px; border: 0; outline: 0; background: transparent; cursor: col-resize; touch-action: none; }
.paper-divider:before { position: absolute; inset: 0 auto 0 6px; width: 1px; content: ""; background: var(--line); }
.paper-divider span { position: absolute; top: 50%; left: 50%; width: 9px; height: 36px; border: 1px solid rgba(92,82,68,.22); border-radius: 9px; background: var(--paper); box-shadow: 0 2px 8px rgba(66,57,45,.12); transform: translate(-50%,-50%); }
.paper-divider span:before { position: absolute; top: 10px; left: 3px; width: 1px; height: 14px; content: ""; background: var(--earth); box-shadow: 2px 0 0 var(--earth); opacity: .5; }
.paper-divider:focus-visible span { outline: 2px solid var(--ink); outline-offset: 3px; }
.paper-bilingual.translation-collapsed { grid-template-columns: minmax(0,1fr) 13px 0; }
.paper-bilingual.translation-collapsed .paper-translation-panel { display: none; }
body.resizing-paper { cursor: col-resize; user-select: none; }
.paper-language-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--earth); font-size: 10px; font-weight: 750; }
.paper-language-label small { color: var(--muted); font-weight: 500; }
.paper-text { margin: 18px 0 0; font: 18px/1.82 Georgia, "Songti SC", serif; text-wrap: pretty; }
.paper-translation { margin-top: 18px; color: #49423a; font: 15px/1.9 "Songti SC", "Noto Serif SC", serif; text-wrap: pretty; }
.paper-translation[contenteditable="true"] { min-height: 150px; border: 0; border-radius: var(--r-sm); padding: 13px; color: var(--ink); background: var(--paper-deep); outline: 1px solid var(--line); outline-offset: 0; white-space: pre-wrap; }
.paper-translation[contenteditable="true"]:focus { outline-color: var(--earth); box-shadow: inset 0 0 0 1px rgba(108,94,74,.13); }
.paper-translation[contenteditable="true"]:empty:before { content: "可以在这里粘贴或输入自己的中文翻译"; color: var(--muted); pointer-events: none; }
.paper-translation-actions { margin-top: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.paper-translation-note { margin: 0 0 20px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.paper-reader-actions { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.paper-sentences, .paper-vocabulary { margin-top: 28px; }
.paper-sentences > div:last-child { margin-top: 10px; }
.paper-sentences button { width: 100%; min-height: 66px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 0; border-bottom: 1px solid var(--line); padding: 9px 3px; background: transparent; cursor: pointer; text-align: left; }
.paper-sentences button b, .paper-sentences button small { color: var(--earth); font-size: 9px; }
.paper-sentences button span { font: 15px/1.65 Georgia, serif; }
.paper-word-grid { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 6px; }
.paper-word-grid button { min-height: 48px; display: grid; align-content: center; border: 0; border-radius: var(--r-xs); padding: 7px 10px; background: var(--paper-deep); cursor: pointer; text-align: left; }
.paper-word-grid strong, .paper-word-grid span { display: block; }
.paper-word-grid strong { font: 700 13px Georgia, serif; }
.paper-word-grid span { margin-top: 3px; color: var(--muted); font: 10px Georgia, serif; }
.paper-word-detail { min-height: 78px; margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-word-detail strong, .paper-word-detail span, .paper-word-detail small { display: block; }
.paper-word-detail strong { font: 700 21px Georgia, serif; }
.paper-word-detail span { margin-top: 3px; color: var(--earth); font: 13px Georgia, serif; }
.paper-word-detail small { margin-top: 5px; color: var(--muted); }

.resource-list { display: grid; }
.resource-item { min-height: 112px; display: grid; grid-template-columns: 150px minmax(0,1fr) auto; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 18px 5px; }
.resource-item .resource-level { color: var(--earth); font-size: 11px; font-weight: 750; }
.resource-item h2 { margin: 0 0 7px; font: 700 22px Georgia, "Songti SC", serif; }
.resource-item p { margin: 0; max-width: 65ch; color: var(--muted); font-size: 13px; line-height: 1.65; }
.resource-item small { display: block; margin-top: 6px; color: #8f887d; }
.resource-item button { min-height: 40px; border: 0; border-radius: var(--r-sm); padding: 0 14px; background: var(--ink); color: var(--paper); cursor: pointer; }

.privacy-grid { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); gap: 22px; }
.privacy-ledger { padding: clamp(25px,4vw,44px); }
.privacy-ledger dl { margin: 0; }
.privacy-ledger dl div { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.privacy-ledger dt { color: #aaa59a; font-size: 12px; }
.privacy-ledger dd { margin: 0; color: #f0ebe2; font: 600 15px Georgia, "Songti SC", serif; text-align: right; }
.data-actions { padding: clamp(25px,4vw,44px); }
.data-actions h2, .license-notes h2 { margin: 0 0 9px; font: 700 25px Georgia, "Songti SC", serif; }
.data-actions > p, .license-notes p { color: var(--muted); line-height: 1.75; }
.file-button { margin-left: 6px; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.danger-zone { margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.danger-zone h3 { margin: 0; font-size: 14px; }
.danger-zone p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.danger-zone button { min-height: 40px; border: 0; border-radius: var(--r-sm); padding: 0 13px; background: #eaded6; color: #6a4037; cursor: pointer; }
.license-notes { margin-top: 34px; padding: 27px 4px; border-top: 1px solid var(--line); }

dialog { width: min(460px,calc(100% - 32px)); border: 0; border-radius: var(--r-lg); padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 25px 80px rgba(30,27,22,.28); }
dialog::backdrop { background: rgba(30,28,24,.58); }
dialog form { padding: 30px; }
dialog h2 { margin: 8px 0 9px; font: 700 27px Georgia, "Songti SC", serif; }
dialog p { color: var(--muted); line-height: 1.7; }
.dialog-actions { margin-top: 21px; display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions button { min-height: 40px; border: 0; border-radius: var(--r-sm); padding: 0 14px; background: var(--paper-deep); cursor: pointer; }
.dialog-actions .primary-button { background: var(--ink); }
.paper-translation-dialog { width: min(520px,calc(100% - 32px)); }
.paper-translation-dialog form { background-image: repeating-linear-gradient(90deg, rgba(78,70,58,.025) 0 1px, transparent 1px 5px); }
.paper-batch-summary { margin-top: 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-batch-summary strong, .paper-batch-summary small { display: block; }
.paper-batch-summary strong { font: 700 18px Georgia, "Songti SC", serif; }
.paper-batch-summary small { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.random-word-dialog { width: min(650px,calc(100% - 32px)); overflow: hidden; }
.random-word-dialog article { position: relative; padding: clamp(26px,5vw,52px); background-image: repeating-linear-gradient(90deg, rgba(78,70,58,.025) 0 1px, transparent 1px 5px); }
.random-word-dialog article:after { content: "Aa"; position: absolute; right: 28px; top: 54px; color: rgba(94,82,67,.055); font: 700 132px/1 Georgia, serif; pointer-events: none; }
.random-card-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.random-card-head button { width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: var(--paper-deep); cursor: pointer; font-size: 23px; line-height: 1; }
#randomWordContent { position: relative; z-index: 1; min-height: 310px; display: flex; flex-direction: column; justify-content: center; }
.random-card-pack { color: var(--earth); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
#randomWordContent h2 { margin: 11px 0 2px; font: 700 clamp(48px,8vw,82px)/1 Georgia, serif; letter-spacing: -.022em; overflow-wrap: anywhere; }
.random-card-ipa { color: var(--earth); font: 20px/1.5 Georgia, serif; }
.random-card-meaning { margin: 12px 0 0; font: 700 21px Georgia, "Songti SC", serif; }
.random-card-example { max-width: 540px; margin-top: 28px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.random-card-example span, .random-card-example strong { display: block; }
.random-card-example span { margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.random-card-example strong { font: 700 19px/1.55 Georgia, serif; }
.random-card-status { margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.random-card-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; }
.motivation-dialog { width: min(570px,calc(100% - 32px)); overflow: hidden; }
.motivation-dialog article { position: relative; min-height: 500px; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px,7vw,70px); background-image: repeating-linear-gradient(90deg, rgba(78,70,58,.028) 0 1px, transparent 1px 5px); }
.motivation-dialog article:before { content: ""; position: absolute; left: 22%; top: 0; bottom: 0; width: 17%; background: linear-gradient(90deg, transparent, rgba(117,104,84,.055), transparent); pointer-events: none; }
.motivation-head { position: absolute; left: clamp(34px,7vw,70px); right: clamp(28px,5vw,48px); top: 25px; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.motivation-head button { width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: var(--paper-deep); cursor: pointer; font-size: 23px; line-height: 1; }
.motivation-mark { position: absolute; right: clamp(34px,7vw,66px); top: 96px; color: rgba(100,87,70,.07); font: 700 116px/1 "Songti SC", serif; pointer-events: none; }
#motivationContent, .motivation-dialog .primary-button { position: relative; z-index: 1; }
#motivationContent { max-width: 430px; }
#motivationContent h2 { margin: 13px 0 16px; font: 700 clamp(32px,5vw,47px)/1.18 Georgia, "Songti SC", serif; text-wrap: balance; }
#motivationContent p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; text-wrap: pretty; }
#motivationContent small { display: block; margin-top: 20px; color: var(--earth); font: 700 13px Georgia, "Songti SC", serif; }
.motivation-dialog .primary-button { align-self: flex-start; margin-top: 34px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%,18px); padding: 10px 15px; border-radius: var(--r-sm); background: var(--dark); color: #f1ede5; opacity: 0; pointer-events: none; transition-property: transform, opacity; transition-duration: 180ms; }
.toast.show { transform: translate(-50%,0); opacity: 1; }
.mobile-nav, .mobile-more { display: none; }

@media (hover:hover) {
  .primary-nav button:hover, .lesson-index button:hover, .library-row:hover { background-color: rgba(255,255,255,.055); }
  .pack-tabs button:hover, .secondary-button:hover, .history-list button:hover { background-color: oklch(86% .018 78); }
  .landing-index button:hover { background-color: var(--canvas); }
  .landing-primary:hover { background-color: var(--dark-soft); }
}

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  button, .toast { transition-duration: 0ms; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .rail { position: static; width: 100%; height: auto; padding: 15px 18px; display: block; }
  .brand { width: auto; }
  .brand small, .local-badge, .rail-foot { display: none; }
  .primary-nav { margin-top: 13px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .primary-nav button { min-width: 0; grid-template-columns: 1fr; place-items: center; padding: 0 4px; text-align: center; font-size: 11px; }
  .primary-nav button > span, .primary-nav button b, .primary-nav button.active:after { display: none; }
  .topbar { height: 64px; padding: 0 18px; }
  main { padding-top: 24px; }
  .today-grid { min-height: 0; grid-template-columns: minmax(0,1fr); }
  .today-brief { min-height: 520px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .today-plan { border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .today-plan ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
  .today-plan li { display: block; min-width: 0; min-height: 0; }
  .today-plan li:after { display: none; }
  .today-plan li b { margin-bottom: 8px; }
  .today-plan li small { overflow-wrap: anywhere; }
  .master-detail, .library-layout, .privacy-grid, .paper-workspace { grid-template-columns: minmax(0,1fr); }
  .lesson-index { max-height: none; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; overflow: visible; padding-right: 0; }
  .lesson-index button { min-width: 0; min-height: 67px; display: block; padding: 7px; text-align: center; background: rgba(255,255,255,.28); border: 0; }
  .lesson-index button strong { display: block; }
  .lesson-index button span { display: block; margin-top: 4px; padding: 0; font-size: 10px; overflow-wrap: anywhere; }
  .lesson-index button i { display: none; }
  .library-list { max-height: 440px; }
  .library-detail { position: static; }
  .paper-sections { max-height: 250px; }
  .learning-track-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .landing-mode .app-shell { display: block; }
  .landing-nav { padding-inline: 22px; }
  .landing-hero { height: auto; min-height: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .landing-copy { min-height: 480px; padding: 54px 42px 38px; }
  .landing-copy h1 { font-size: clamp(39px,6vw,51px); }
  .landing-art { min-height: 460px; }
  .landing-method, .landing-contents { grid-template-columns: minmax(0,1fr); gap: 55px; }
  .landing-contents-copy { position: static; }
  .landing-end { grid-template-columns: minmax(0,1fr); }
  .landing-end button { justify-self: start; }
}

@media (max-width: 620px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .rail { padding: 13px 16px; }
  .primary-nav { display: none; }
  .topbar { height: 60px; }
  .top-actions #globalSearchButton { display: none; }
  .top-actions button { padding: 0 4px; }
  main { padding: 20px 16px 64px; }
  .view-intro { margin-bottom: 21px; }
  .view-intro h1 { font-size: 31px; }
  .view-intro p { font-size: 14px; }
  .compact-intro { display: grid; align-items: stretch; gap: 17px; }
  .word-discovery-actions { display: grid; grid-template-columns: minmax(132px,.7fr) minmax(0,1.3fr); }
  .random-word-button { min-width: 0; }
  .search-field { width: 100%; }
  .today-brief { min-height: 500px; padding: 34px 22px; }
  .today-brief h1 { font-size: 38px; }
  .today-brief p { font-size: 14px; }
  .today-outcome span { font-size: 25px; }
  .today-plan { padding: 27px 21px 24px; }
  .today-plan ol { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 24px; }
  .session-panel { min-height: 510px; padding: 23px 20px; }
  .session-progress { margin-bottom: 30px; }
  .learning-card h2 { font-size: 31px; }
  .learning-card .english-focus { font-size: 34px; }
  .capability-strip { grid-template-columns: minmax(0,1fr); gap: 17px; }
  .daily-encouragement { grid-template-columns: 58px minmax(0,1fr); gap: 16px; padding-inline: 4px; }
  .encouragement-mark { width: 56px; height: 56px; font-size: 24px; }
  .lookup-desk { padding: 25px 17px; }
  .lookup-desk:after { font-size: 76px; }
  .lookup-desk textarea { min-height: 118px; font-size: 27px; }
  .action-row { display: grid; grid-template-columns: 1fr 1fr; }
  .action-row button { min-width: 0; padding: 0 8px; }
  .voice-settings { display: grid; grid-template-columns: 1fr auto; }
  .voice-settings label { grid-column: 1/-1; grid-row: 2; }
  .phonetic-toolbar { align-items: end; }
  .phonetic-toolbar > p { padding-bottom: 14px; }
  .lesson-index { margin: 0 -16px; display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 7px; }
  .lesson-index button { flex: 0 0 118px; min-height: 70px; }
  .lesson-detail { padding: 27px 20px; }
  .phoneme-heading { gap: 16px; }
  .phoneme-heading .sound-symbol { min-width: 72px; }
  .phoneme-listen, .contrast-card { grid-template-columns: minmax(0,1fr); }
  .phoneme-listen button, .contrast-card button { width: 100%; white-space: normal; }
  .articulation-grid { grid-template-columns: minmax(0,1fr); }
  .articulation-grid > div { min-height: 0; }
  .example-sounds { grid-template-columns: minmax(0,1fr); }
  .example-sounds button { min-height: 104px; }
  .notation-examples button { grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; }
  .notation-examples small, .notation-examples span { grid-column: 1; }
  .notation-examples b { grid-column: 2; grid-row: 1/4; }
  .paper-drop { grid-template-columns: 44px minmax(0,1fr); padding: 18px; }
  .paper-drop-mark { width: 44px; height: 50px; }
  .paper-drop b { grid-column: 2; justify-self: start; margin-top: 3px; }
  .paper-empty { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 34px 3px; }
  .paper-empty > span { font-size: 50px; }
  .paper-reader { padding: 25px 18px; }
  .paper-text { font-size: 18px; }
  .paper-bilingual, .paper-bilingual.translation-collapsed { grid-template-columns: minmax(0,1fr); }
  .paper-divider { display: none; }
  .paper-bilingual > section { grid-column: 1; padding: 18px 0 21px; }
  .paper-original-panel { grid-row: 1; }
  .paper-translation-panel { grid-row: 2; border-top: 1px solid var(--line); }
  .paper-bilingual.translation-collapsed .paper-translation-panel { display: none; }
  .paper-reader-actions button { min-width: 0; }
  .paper-sentences button { grid-template-columns: 22px minmax(0,1fr); }
  .paper-sentences button small { grid-column: 2; }
  .pair-stage button { min-height: 88px; }
  .library-layout { gap: 14px; }
  .library-list { max-height: 370px; }
  .library-detail { padding: 25px 20px; }
  .track-head { grid-template-columns: minmax(0,1fr); align-items: start; }
  .track-head button { justify-self: start; }
  .track-steps, .ai-term-grid { grid-template-columns: minmax(0,1fr); }
  .review-stats { grid-template-columns: 1fr; }
  .resource-item { grid-template-columns: minmax(0,1fr); gap: 9px; padding: 21px 4px; }
  .resource-item button { justify-self: start; }
  .privacy-grid { gap: 14px; }
  .file-button { margin: 8px 0 0; }
  .random-word-dialog article { padding: 24px 20px 26px; }
  .random-word-dialog article:after { right: 15px; top: 62px; font-size: 86px; }
  #randomWordContent { min-height: 300px; }
  #randomWordContent h2 { font-size: 48px; }
  .random-card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .random-card-actions button { min-width: 0; padding-inline: 8px; }
  .motivation-dialog article { min-height: 470px; padding: 72px 25px 35px; }
  .motivation-head { left: 25px; right: 20px; top: 18px; }
  .motivation-mark { right: 24px; top: 106px; font-size: 82px; }
  #motivationContent h2 { font-size: 34px; }
  #motivationContent p { font-size: 15px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; min-height: calc(58px + env(safe-area-inset-bottom)); padding: 0 7px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); background: var(--dark); box-shadow: 0 -5px 22px rgba(34,31,26,.14); }
  .mobile-nav button { min-width: 0; border: 0; background: transparent; color: #aaa69d; font-size: 11px; }
  .mobile-nav button.active { color: #f3efe7; }
  .mobile-more { position: fixed; left: 14px; right: 14px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 41; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; background: var(--paper); border-radius: var(--r-md); box-shadow: 0 18px 60px rgba(34,31,26,.25); }
  .mobile-more[hidden] { display: none; }
  .mobile-more button { min-height: 46px; border: 0; border-radius: var(--r-sm); background: var(--paper-deep); cursor: pointer; }
  .landing-mode { padding-bottom: 0; }
  .landing-nav { min-height: 68px; padding: 10px 16px; }
  .landing-brand img { width: 40px; height: 40px; }
  .landing-nav-actions > span { display: none; }
  .landing-nav-actions button { min-height: 38px; font-size: 11px; }
  .landing-hero { height: auto; min-height: 0; grid-template-rows: auto minmax(250px,1fr); }
  .landing-copy { padding: 25px 22px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
  .landing-copy h1 { width: 100%; margin: 12px 0 15px; font-size: clamp(27px,8vw,31px); line-height: 1.12; }
  .landing-copy h1 span { display: block; white-space: nowrap; }
  .landing-copy > p { max-width: 31em; margin-bottom: 38px; font-size: 12px; line-height: 1.7; }
  .landing-primary { width: 100%; }
  .landing-quiet { min-height: 34px; }
  .landing-proof { order: 7; margin-top: 15px; display: flex; gap: 5px 13px; font-size: 8px; }
  .landing-proof span + span:before { margin-right: 13px; }
  .landing-art { min-height: 300px; }
  .landing-art img { object-fit: contain; object-position: center; }
  .landing-art figcaption { left: 18px; right: 18px; bottom: 16px; }
  .landing-art figcaption small { display: none; }
  .landing-method, .landing-contents { padding: 80px 20px; gap: 40px; }
  .landing-section-head h2, .landing-contents h2 { font-size: 38px; }
  .landing-method li { min-height: 154px; grid-template-columns: 34px minmax(0,1fr); gap: 15px; }
  .landing-method li > span { grid-column: 2; margin-top: -22px; }
  .landing-method h3 { font-size: 21px; }
  .landing-index button { min-height: 88px; grid-template-columns: 31px minmax(0,1fr) auto; gap: 12px; }
  .landing-end { min-height: 600px; padding: 92px 22px 38px; gap: 42px; }
  .landing-end h2 { font-size: 43px; }
}

@media (max-width: 360px) {
  .brand > span { font-size: 17px; }
  .topbar strong { font-size: 12px; }
  .top-actions .privacy-state { font-size: 11px; }
  .today-brief h1 { font-size: 34px; }
  .today-outcome span { font-size: 23px; }
  .today-plan { padding-inline: 18px; }
  .pack-tabs button { padding: 0 10px; }
  .word-discovery-actions { grid-template-columns: minmax(0,1fr); }
  .random-word-button { width: 100%; grid-template-columns: 24px auto 1fr; grid-template-rows: auto; }
  .random-word-button > span { grid-row: 1; }
  .random-word-button small { text-align: right; }
  .phonetic-groups button { padding: 0 10px; }
  .phonetic-toolbar > p { font-size: 10px; }
  .pair-stage { grid-template-columns: 1fr; }
}
