/* 自然拼读与词汇 播放器 — 与课程中心统一的清新绿学习工作台 */
:root {
  --maxw: 1320px;
  --brand-900: #06382a;
  --brand-800: #0a5c40;
  --brand-700: #0c7a52;
  --brand-600: #0f9d63;
  --brand-500: #16b877;
  --brand-100: #e0f7ec;
  --brand-50: #f1fbf6;
  --ink-900: #0f1a15;
  --ink-700: #34483e;
  --muted: #7a8981;
  --line: #e4e9e4;
  --bg: #f2f6f3;
  --surface: #fff;
  --stage: #10271e;
  --stage-2: #16352a;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --topbar-h: 62px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Avenir Next", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
  --shadow: 0 1px 2px rgba(15, 26, 21, .03), 0 14px 34px -26px rgba(15, 26, 21, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.6 var(--sans);
  color: var(--ink-700);
  background: radial-gradient(circle at 80% 0, #eaf7ef 0, transparent 32%), var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(22, 184, 119, .38); outline-offset: 3px; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 200; padding: 10px 16px; border-radius: 8px; color: #fff; background: var(--brand-700); }
.skip-link:focus { top: 12px; }

/* 顶栏 */
.topbar { height: var(--topbar-h); position: relative; z-index: 30; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-inner { max-width: var(--maxw); height: 100%; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 14px; }
.back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-700);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 26, 21, .04);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: color .16s, border-color .16s, background .16s, box-shadow .16s, transform .16s;
}
.back svg { width: 15px; height: 15px; transition: transform .16s; }
.back:hover { color: var(--brand-700); border-color: #bde5d1; background: var(--brand-50); box-shadow: 0 4px 12px -6px rgba(12, 122, 82, .35); }
.back:hover svg { transform: translateX(-2px); }
.back:active { transform: translateY(1px); box-shadow: none; }
.lesson-meta { min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
html.is-embedded .lesson-meta { display: none; }
.chip { flex: none; padding: 5px 7px; border-radius: 5px; color: var(--brand-700); background: var(--brand-100); font: 700 9px/1 var(--mono); letter-spacing: .12em; }
.lesson-meta h1 { min-width: 0; overflow: hidden; color: var(--ink-900); font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.lesson-en { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f0f4f1; }
.seg button { min-width: 58px; height: 30px; padding: 0 12px; border-radius: 7px; color: var(--muted); font-size: 12px; transition: .16s; }
.seg button:hover { color: var(--brand-700); }
.seg button.is-on { color: var(--brand-800); background: #fff; box-shadow: 0 1px 5px rgba(15, 26, 21, .1); font-weight: 700; }
.vline { width: 1px; height: 20px; margin: 0 3px; background: var(--line); }
.tbtn { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; transition: .15s; }
.tbtn:hover, .tbtn[aria-pressed="true"] { color: var(--brand-700); border-color: #bde5d1; background: var(--brand-50); }
.tbtn-icon { width: 32px; padding: 0; display: grid; place-items: center; }
.tbtn-icon svg { width: 15px; height: 15px; }

/* 三栏骨架 */
.shell { max-width: var(--maxw); height: calc(100dvh - var(--topbar-h)); margin: auto; padding: 14px 24px 16px; display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 16px; min-height: 0; }
.mobile-toolbar { display: none; }
.work { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }

/* 课程单词导航 */
.rail { min-height: 0; display: flex; flex-direction: column; padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); }
.rail-head { display: flex; align-items: center; gap: 8px; padding: 0 5px 13px; border-bottom: 1px solid #edf1ed; }
.rail-head > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.rail-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-700); background: var(--brand-100); }
.rail-icon svg { width: 17px; height: 17px; }
.rail-head b { display: block; color: var(--ink-900); font-size: 13px; }
.rail-head small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.count-pill { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: var(--brand-700); background: var(--brand-50); font: 700 10px/1.4 var(--mono); }
.rail-close { display: none; }
.word-list { flex: 1; min-height: 0; margin: 0; padding: 8px 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: #cddbd2 transparent; }
.word-list li { position: relative; display: grid; grid-template-columns: 23px minmax(0, 1fr) minmax(0, 76px); align-items: center; gap: 6px; min-height: 43px; margin: 2px 0; padding: 7px 8px; border-radius: 9px; cursor: pointer; transition: background .14s, color .14s; }
.word-list li:hover { background: #f4f8f5; }
.word-list .idx { color: #a1aea7; font: 500 9px/1 var(--mono); }
.word-list .en { color: var(--ink-900); font: 600 13px/1.35 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.word-list .zh { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.word-list .tick { display: none; position: absolute; right: 7px; width: 14px; height: 14px; border-radius: 50%; color: #fff; background: var(--brand-600); font-size: 9px; line-height: 14px; text-align: center; }
.word-list li.is-done .tick { display: block; }
.word-list li.is-done .zh { visibility: hidden; }
.word-list li.is-active { background: var(--brand-100); }
.word-list li.is-active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand-600); }
.word-list li.is-active .en, .word-list li.is-active .idx { color: var(--brand-800); }
.rail-foot { display: flex; align-items: center; gap: 7px; padding: 12px 6px 0; border-top: 1px solid #edf1ed; color: var(--brand-700); font-size: 11px; }
.done-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-100); }
.done-mark svg { width: 12px; height: 12px; }
.rail-local { margin-left: auto; color: #9aa79f; font-size: 9px; }

/* 主学习舞台 */
.stage-card { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0 26px 18px; border: 1px solid #1c3b2f; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #132e23, var(--stage) 52%, #0d2119); box-shadow: 0 22px 45px -32px rgba(6, 56, 42, .7); }
.stage-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.stage-glow { position: absolute; width: 440px; height: 440px; top: -230px; right: -130px; border-radius: 50%; background: #20b97a; filter: blur(90px); opacity: .16; pointer-events: none; }
.stage-head { position: relative; z-index: 1; min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #91aa9e; font-size: 10px; letter-spacing: .04em; }
.stage-status { display: inline-flex; align-items: center; gap: 6px; color: #a9c9b9; }
.stage-status i, .mobile-toolbar > span i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 4px rgba(22, 184, 119, .1); }
body.is-playing .stage-status i { animation: pulse 1.25s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(22, 184, 119, 0); } }
.stage-body { position: relative; z-index: 1; flex: 1; min-height: 0; display: grid; place-items: center; overflow-y: auto; padding: 14px 0; scrollbar-width: thin; scrollbar-color: #365446 transparent; }
.word-block { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage-kicker { margin-bottom: 8px; color: #72a28b; font: 600 9px/1.4 var(--mono); letter-spacing: .2em; }
.word { display: flex; flex-wrap: wrap; justify-content: center; color: #f5fbf7; font-family: var(--serif); font-size: calc(clamp(50px, 6.2vw, 104px) * var(--word-scale, 1)); font-weight: 650; line-height: 1.06; letter-spacing: -.045em; }
.word .chunk { position: relative; transition: color .14s; }
.word .chunk.on { color: #63e6a9; }
.word .chunk.on::after { content: ""; position: absolute; left: .04em; right: .04em; bottom: -.02em; height: .045em; border-radius: 4px; background: currentColor; opacity: .28; }
.word-meta { min-height: 25px; display: flex; justify-content: center; margin-top: 10px; }
.gloss { color: #b9cec3; font-size: 14px; }
.ipa-row { min-height: 34px; margin-top: 13px; color: #9fe4c0; font: 600 clamp(20px, 2.2vw, 28px)/1.4 var(--mono); letter-spacing: .04em; }
.examples { width: min(620px, 100%); margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.08); text-align: left; }
.examples-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #9bbbab; font-size: 10px; font-weight: 700; }
.examples-title small { color: #648573; font-size: 9px; font-weight: 400; }
.sentence-example { display: grid; grid-template-columns: 25px minmax(0, 1fr) 28px; align-items: center; gap: 9px; margin-top: 6px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.035); transition: border-color .15s, background .15s; }
.sentence-example:hover { border-color: rgba(99,230,169,.22); background: rgba(99,230,169,.055); }
.sentence-example__num { color: #5f8c73; font: 500 9px/1 var(--mono); }
.sentence-example__copy { min-width: 0; }
.sentence-example__en { color: #e2efe7; font: 500 14px/1.45 var(--serif); overflow-wrap: anywhere; }
.sentence-example__zh { margin-top: 2px; color: #88a494; font-size: 11px; line-height: 1.55; }
.sentence-example__speak { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; color: #82b99c; background: rgba(255,255,255,.04); transition: .15s; }
.sentence-example__speak svg { width: 13px; height: 13px; }
.sentence-example__speak:hover { color: #b8f3d4; border-color: rgba(99,230,169,.35); background: rgba(99,230,169,.1); }
body.no-zh .gloss, body.no-zh .word-list .zh, body.no-zh .sentence-example__zh, body.no-zh .sentence-zh, body.no-zh .sentence-translation { visibility: hidden; }

/* 句子模式 */
.sentence-wrap { width: min(680px, 100%); text-align: center; }
.sentence { display: flex; flex-wrap: wrap; justify-content: center; color: #edf7f1; font-family: var(--serif); font-size: clamp(25px, 2.7vw, 38px); font-weight: 500; line-height: 1.55; letter-spacing: -.02em; }
.sentence .tok { position: relative; padding: 0 .07em; border-radius: 5px; color: inherit; transition: .14s; }
.sentence .tok:hover { color: #7ce8b2; background: rgba(99,230,169,.1); }
.sentence .gap { white-space: pre; }
.sentence-zh { width: min(600px, 100%); margin: 22px auto 0; padding: 12px 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; color: #a7c2b2; background: rgba(255,255,255,.04); font-size: 12px; line-height: 1.8; text-align: left; }
.sentence-zh::before { content: '汉语备注：'; color: #70b28f; font-weight: 700; }
.sentence-translation { width: min(600px, 100%); margin: 10px auto 0; padding: 12px 15px; border: 1px solid rgba(99,230,169,.18); border-radius: 10px; background: rgba(99,230,169,.07); text-align: left; }
.sentence-translation > span { display: block; margin-bottom: 4px; color: #7ce8b2; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.sentence-translation p { margin: 0; color: #dcefe4; font-size: 14px; line-height: 1.75; }
.sentence-tip { margin-top: 18px; color: #759582; font-size: 12px; }
.sentence-empty { color: #9bb4a6; font: 16px/1.8 var(--sans); }
body:not(.mode-sentence) .sentence-wrap { display: none; }
body.mode-sentence .stage-kicker { margin-bottom: 18px; }

/* 播放控制 */
.stage-foot { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.controls { display: flex; align-items: center; gap: 13px; }
.ctrl { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: #b5cbbf; background: rgba(255,255,255,.045); transition: .15s; }
.ctrl svg { width: 16px; height: 16px; }
.ctrl:hover { color: #fff; border-color: rgba(99,230,169,.45); background: rgba(99,230,169,.1); transform: translateY(-1px); }
.ctrl:active { transform: scale(.95); }
.ctrl:disabled { opacity: .28; cursor: not-allowed; transform: none; background: transparent; border-color: rgba(255,255,255,.1); }
.ctrl-main { width: 54px; height: 54px; border: 0; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); box-shadow: 0 10px 24px -10px rgba(22,184,119,.65), inset 0 1px 0 rgba(255,255,255,.25); }
.ctrl-main:hover { color: #fff; background: linear-gradient(135deg, #27c586, var(--brand-600)); }
.ctrl-main svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.ctrl-main .icon-pause { display: none; }
body.is-playing .ctrl-main .icon-play { display: none; }
body.is-playing .ctrl-main .icon-pause { display: block; }
.hud { width: min(390px, 100%); display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hud-count { flex: none; color: #8da799; font: 500 9px/1 var(--mono); }
.hud-bar { flex: 1; height: 3px; overflow: hidden; border-radius: 4px; background: #294536; }
.hud-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1caa6d, #64dfa6); transition: width .3s; }
.hud-toggle { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 6px; color: #789585; font-size: 9px; }
.hud-toggle i { width: 5px; height: 5px; border-radius: 50%; background: #526e5e; }
.hud-toggle.is-on { color: #9ddbba; border-color: rgba(99,230,169,.2); background: rgba(99,230,169,.07); }
.hud-toggle.is-on i { background: #4ed698; }
.shortcut-hint { margin-top: 9px; color: #567662; font-size: 8px; }
.shortcut-hint kbd { padding: 1px 4px; border: 1px solid #34503f; border-radius: 3px; font: 8px/1.3 var(--mono); }
.shortcut-hint span { margin: 0 5px; }

/* 辅助卡片 */
.media-col { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cddbd2 transparent; }
.mcard { flex: none; padding: 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.mcard header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--ink-900); font-size: 11px; font-weight: 700; }
.mcard header > span { display: inline-flex; align-items: center; gap: 6px; }
.mcard header svg { width: 14px; height: 14px; color: var(--brand-600); }
.card-dot { width: 5px; height: 5px; border-radius: 50%; background: #cbd8cf; }
body.is-playing .card-dot { background: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.mouth-card.is-demoing .card-dot { background: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.media-frame { overflow: hidden; border-radius: 9px; background: #edf4ef; }
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.mouth-readout { display: flex; flex-direction: column; gap: 9px; padding: 12px; border: 1px solid #dcece2; border-radius: 12px; background: linear-gradient(180deg, #f9fdfb, #edf7f1); }
.mouth-position { align-self: flex-start; padding: 3px 8px; border: 1px solid #d5e9dd; border-radius: 999px; color: var(--brand-700); background: #fff; font-size: 9px; font-weight: 700; line-height: 1.3; }
.mouth-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; color: var(--ink-700); font-size: 11px; line-height: 1.65; }
.mouth-hint b { flex: none; color: var(--brand-700); font: 700 15px/1.4 var(--mono); }
.mouth-replay { width: 100%; height: 32px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cfe7d9; border-radius: 8px; color: var(--brand-700); background: var(--brand-50); font-size: 10px; font-weight: 700; transition: color .15s, border-color .15s, background .15s; }
.mouth-replay svg { width: 13px; height: 13px; }
.mouth-replay:hover { color: var(--brand-800); border-color: #9bd5b7; background: var(--brand-100); }
.mouth-replay.is-running { color: #fff; border-color: var(--brand-600); background: var(--brand-600); }
.mouth-note { color: #8ba096; font-size: 8px; line-height: 1.5; }
.mcard-tip { flex: 1 0 auto; }
.tip-text { color: #61736a; font-size: 11px; line-height: 1.85; }
.learning-steps { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf1ed; color: var(--muted); font-size: 8px; }
.learning-steps span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.learning-steps i { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: var(--brand-700); background: var(--brand-100); font: normal 700 8px/1 var(--mono); }
.learning-steps b { color: #bdc9c1; font-weight: 400; }
.guide-card { background: #edf8f1; border-color: #d9eee1; }
.guide-card header { margin-bottom: 5px; color: var(--brand-800); }
.guide-card p { color: #668273; font-size: 10px; line-height: 1.8; }
body.mode-sentence #mouthCard { display: none; }
.rail-backdrop { display: none; }

/* 查词弹层 */
.pop { position: fixed; z-index: 100; min-width: 170px; max-width: 270px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 20px 50px -20px rgba(6,56,42,.35); text-align: left; }
.pop b { display: block; color: var(--ink-900); font: 700 17px/1.4 var(--serif); }
.pop .ipa { display: inline-block; margin: 4px 0 6px; color: var(--brand-700); font: 11px/1.4 var(--mono); }
.pop .zh { display: block; color: var(--ink-700); font-size: 12px; }
.pop button { margin-top: 9px; padding: 5px 10px; border-radius: 6px; color: var(--brand-700); background: var(--brand-50); font-size: 10px; }
.load-error { position: fixed; z-index: 120; top: 80px; left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); padding: 14px 18px; border: 1px solid #f0c9c2; border-radius: 10px; color: #a33b2d; background: #fff4f1; box-shadow: var(--shadow); }

/* 平板：单词导航改为抽屉 */
@media (max-width: 1120px) {
  .lesson-en { display: none; }
  .shell { grid-template-columns: 200px minmax(0, 1fr); padding-inline: 18px; gap: 13px; }
  .work { grid-template-columns: minmax(0, 1fr) 246px; gap: 13px; }
  .word-list li { grid-template-columns: 21px minmax(0, 1fr) 64px; }
  .stage-card { padding-inline: 20px; }
}
@media (max-width: 980px) {
  .shell { height: calc(100dvh - var(--topbar-h)); grid-template-columns: minmax(0, 1fr); }
  .mobile-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 2px; }
  .mobile-toolbar > span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
  .rail-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-900); background: #fff; font-size: 11px; font-weight: 700; }
  .rail-toggle svg { width: 14px; height: 14px; color: var(--brand-600); }
  .rail-toggle span { padding: 1px 5px; border-radius: 5px; color: var(--brand-700); background: var(--brand-100); font: 700 9px/1.4 var(--mono); }
  .rail { position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: min(310px, 86vw); padding-top: 20px; border-radius: 0 18px 18px 0; box-shadow: 20px 0 50px -20px rgba(6,56,42,.3); transform: translateX(-105%); transition: transform .22s ease; }
  body.rail-open .rail { transform: translateX(0); }
  .rail-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
  .rail-close:hover { color: var(--brand-700); background: var(--brand-50); }
  .rail-close svg { width: 16px; height: 16px; }
  .count-pill { margin-left: auto; }
  .rail-backdrop { position: fixed; z-index: 70; inset: 0; display: block; background: rgba(8, 27, 19, .42); backdrop-filter: blur(2px); }
  body.rail-open { overflow: hidden; }
}

/* 窄屏：页面自然滚动，辅助卡片双列 */
@media (max-width: 800px) {
  body { overflow: auto; }
  .topbar-inner { padding-inline: 16px; gap: 10px; }
  .lesson-meta { padding-left: 0; border-left: 0; }
  .shell { height: auto; min-height: calc(100dvh - var(--topbar-h)); align-content: start; padding: 12px 16px 20px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .stage-card { min-height: 610px; }
  .media-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .mcard-tip, .guide-card { min-width: 0; }
  .guide-card { display: none; }
}
@media (max-width: 620px) {
  :root { --topbar-h: 108px; }
  .topbar-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 42px 46px; gap: 0 8px; padding: 5px 12px 8px; }
  .back { grid-column: 1; grid-row: 1; width: auto; height: 34px; padding: 0 10px 0 8px; border-radius: 9px; justify-self: start; }
  .back span { display: inline; font-size: 11px; }
  .lesson-meta { grid-column: 2; grid-row: 1; }
  .chip { display: none; }
  .lesson-meta h1 { font-size: 14px; }
  .tools { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  html.is-embedded { --topbar-h: 102px; }
  html.is-embedded .topbar-inner { display: grid; height: auto; padding: 5px 12px 8px; }
  html.is-embedded .topbar-inner::after { content: "互动学习"; grid-column: 2; grid-row: 1; justify-self: end; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
  html.is-embedded .tools { width: 100%; margin: 0; }
  .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; width: 100%; }
  .seg button { min-width: 0; width: 100%; height: 29px; padding: 0 6px; white-space: nowrap; }
  .vline { display: none; }
  .tbtn { height: 31px; }
  .shell { padding: 10px 11px 18px; gap: 10px; }
  .mobile-toolbar > span { font-size: 10px; }
  .stage-card { min-height: 590px; padding: 0 15px 15px; border-radius: 16px; }
  .stage-head { min-height: 46px; font-size: 10px; }
  .stage-status { font-size: 9px; }
  .word { font-size: calc(clamp(46px, 14vw, 74px) * var(--word-scale, 1)); }
  .stage-kicker { font-size: 9px; }
  .gloss { font-size: 12px; }
  .ipa-row { margin-top: 10px; font-size: 21px; }
  .examples { margin-top: 13px; padding-top: 10px; }
  .sentence-example { grid-template-columns: 20px minmax(0, 1fr) 26px; gap: 7px; padding: 8px; }
  .sentence-example__en { font-size: 12px; }
  .sentence-example__zh { font-size: 11px; }
  .sentence-example__speak { width: 26px; height: 26px; }
  .controls { gap: 12px; }
  .ctrl { width: 38px; height: 38px; }
  .ctrl-main { width: 52px; height: 52px; }
  .hud { gap: 8px; }
  .shortcut-hint { display: none; }
  .sentence { font-size: 26px; }
  .media-col { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #illusPane { display: none; }
  .mouth-card { display: block; }
  .mouth-card header { margin-bottom: 8px; }
  .mcard-tip { padding: 13px; }
  .learning-steps { justify-content: flex-start; gap: 10px; }
}
@media (max-height: 720px) and (min-width: 801px) {
  .shell { padding-top: 10px; padding-bottom: 12px; }
  .stage-card { padding-bottom: 12px; }
  .stage-head { min-height: 43px; }
  .stage-body { padding-block: 8px; }
  .stage-kicker { margin-bottom: 4px; }
  .word { font-size: calc(clamp(46px, 5.4vw, 86px) * var(--word-scale, 1)); }
  .ipa-row { margin-top: 8px; }
  .examples { margin-top: 9px; padding-top: 9px; }
  .sentence-example { padding-block: 6px; }
  .stage-foot { padding-top: 10px; }
  .controls .ctrl-main { width: 48px; height: 48px; }
  .hud { margin-top: 8px; }
  .shortcut-hint { display: none; }
  .guide-card { display: none; }
}
@media (max-width: 360px) {
  .mouth-hint b { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
