/* IELTS Lens V4 · 对话课样式（来自 prototype/styles.css，B「明亮练习室」风格）· 颜色、字体、间距只引用 design-system/tokens.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column; overflow-x: clip;
  background: var(--color-bg); color: var(--color-ink);
  font: 500 var(--text-md)/1.55 var(--font-body); -webkit-font-smoothing: antialiased;
}
:lang(zh-CN) .say, :lang(zh-CN) .why li, .why-more:lang(zh-CN) { line-height: var(--leading-zh); }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }
em { font-style: italic; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.app[hidden], .access-gate[hidden] { display: none !important; }

/* ── 课程访问门禁 ── */
.access-gate { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-6); background: var(--color-bg); }
.access-card { position: relative; width: min(100%, 460px); padding: var(--space-8); border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: 0 6px 0 var(--color-line); }
.access-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-12); font: 700 22px/1 var(--font-display); }
.access-lang { position: absolute; top: var(--space-6); right: var(--space-6); }
.access-kicker { margin-bottom: var(--space-2); color: var(--color-brand-edge); font-size: var(--text-xs); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.access-card h1 { max-width: 13ch; font: 600 var(--text-2xl)/var(--leading-tight) var(--font-display); text-wrap: balance; }
.access-copy { margin-top: var(--space-3); color: var(--color-muted); line-height: var(--leading-body); }
.access-form { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.access-form label { font-size: var(--text-sm); font-weight: 800; }
.access-form input { width: 100%; min-height: 48px; padding: 0 var(--space-4); border: 1.5px solid var(--color-edge); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-ink); font: 700 var(--text-md)/1 var(--font-body); }
.access-form input:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }
.access-form button { min-height: 48px; margin-top: var(--space-2); padding: 0 var(--space-5); border-radius: var(--radius-pill); background: var(--color-brand); box-shadow: 0 5px 0 var(--color-brand-edge); color: var(--color-on-brand); font-weight: 900; }
.access-form button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--color-brand-edge); }
.access-form button[disabled] { cursor: wait; opacity: .65; }
.access-status { min-height: 1.5em; margin-top: var(--space-4); color: var(--wrong-deep); font-size: var(--text-sm); font-weight: 700; }
@media (max-width: 479px) {
  .access-gate { padding: var(--space-4); }
  .access-card { padding: var(--space-6); }
  .access-brand { margin-bottom: var(--space-12); }
  .access-lang { top: var(--space-4); right: var(--space-4); }
  .access-card h1 { font-size: var(--text-xl); }
}


.app { flex: 1; min-height: 0; width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }

/* ── 顶栏 ── */
.top { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-8) var(--space-2); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 22px/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--color-brand); display: grid; place-items: center; box-shadow: 0 3px 0 var(--color-brand-edge); }
.brand-mark span { width: 14px; height: 14px; border: 3px solid var(--color-ink); border-radius: 50%; }
.task { flex: 1; min-width: 0; max-width: 640px; font-size: 15px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task b { color: var(--color-ink-2); font-weight: 800; }
.lang { display: flex; margin-left: auto; padding: 4px; border-radius: var(--radius-pill); background: #F3E9DF; font-weight: 800; font-size: 13px; }
.lang button { padding: 6px 14px; border-radius: var(--radius-pill); color: var(--color-muted); white-space: nowrap; }
.lang button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-ink); box-shadow: 0 2px 0 var(--color-line); }
.end-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--hit-min); padding: 0 var(--space-2); font-weight: 800; font-size: 14px; color: var(--color-muted); white-space: nowrap; }
.end-btn:hover { color: var(--color-ink); }

/* ── 旅程条（桌面） ── */
.journey { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 var(--space-8); padding: 14px var(--space-8) 18px; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: 0 4px 0 var(--color-line); }
.journey .track { position: absolute; left: calc(var(--space-8) + (100% - 2 * var(--space-8)) / 8); right: calc(var(--space-8) + (100% - 2 * var(--space-8)) / 8); top: 37px; height: 8px; border-radius: 8px; background: #F1E7DC; }
.journey .track i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; background: var(--color-ink); transition: width var(--dur-slow) var(--ease-out); }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dot { transition: --p .7s var(--ease-out); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; position: relative; background: var(--color-surface); border: 3px solid #E9DDD0; color: var(--color-muted); font: 700 19px/1 var(--font-display); transition: transform var(--dur-slow) var(--ease-press); }
.dot b { display: grid; place-items: center; font: inherit; }
.dot .ic { width: 22px; height: 22px; stroke-width: 3; }
.node:hover .dot { transform: scale(1.06); }
.node.now .dot { border: 0; padding: 5px; background: conic-gradient(var(--color-ink) 0 var(--p), rgba(30, 25, 20, .12) var(--p) 100%); }
.node.now .dot b { width: 100%; height: 100%; border-radius: 50%; background: var(--c); color: var(--color-ink); box-shadow: inset 0 -3px 0 var(--c-edge); }
.node.next .dot { border-color: var(--c); background: var(--c-tint); color: var(--c-deep); }
.node.done .dot { border: 0; background: var(--c); color: var(--color-ink); box-shadow: inset 0 -3px 0 var(--c-edge); }
.node.skipped .dot { border-style: dashed; }
.node-name { font: 600 16px/1.1 var(--font-display); }
.node-sub { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--color-muted); }
.node.now .node-sub { color: var(--c-deep); background: var(--c-tint); padding: 2px 9px; border-radius: var(--radius-pill); }
.node.next .node-sub { color: var(--c-deep); }
.strip { display: none; }

/* ── 主区：白色对话面板 + 报告 ── */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; padding: 18px var(--space-8) 0; min-height: 0; }
.convo { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--color-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 0 0 1px var(--color-line); }
.feed { flex: 1; overflow-y: auto; padding: 26px 40px calc(var(--dock-h) + var(--tts-h, 0px) + 24px); display: flex; flex-direction: column; gap: 18px; }
.feed > * { max-width: 680px; width: 100%; margin: 0 auto; }

/* ── 动效：只有新出现的消息（.enter）才播放；切换语言、展开等重绘时静止 ── */
@property --p { syntax: '<percentage>'; inherits: true; initial-value: 0%; }
.enter { animation: pop-in .6s var(--ease-press) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.me.enter { animation-name: from-right; transform-origin: right bottom; }
@keyframes from-right { from { opacity: 0; transform: translateX(24px) scale(.94); } }
.chapter.enter span { animation: sticker .7s var(--ease-press) both; animation-delay: .1s; }
@keyframes sticker { from { opacity: 0; transform: translateY(-14px) rotate(-10deg) scale(.8); } }

/* 老师正在输入 */
.typing .dots { display: inline-flex; gap: 5px; padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--color-sunken); }
.typing .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-muted); animation: dot 1s ease-in-out infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* 改句卡编排：你说的 → 错词被划掉 → 箭头落下 → 好句子滑上来 → 改好的词弹出 → 讲解 */
.correction.enter .said { animation: pop-in .5s var(--ease-press) both; }
.correction.enter .x { animation: strike .35s var(--ease-out) both; animation-delay: calc(.45s + var(--k) * .15s); }
@keyframes strike { from { background-size: 0 2.5px; } }
.correction.enter .swap-arrow { animation: drop .55s var(--ease-press) both; animation-delay: .75s; }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(.6); } }
.correction.enter .better { animation: rise .55s var(--ease-press) both; animation-delay: .85s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.correction.enter .why li { animation: fade-up .4s var(--ease-out) both; animation-delay: calc(1.35s + var(--k) * .12s); }
.correction.enter .why-btn { animation: fade-up .4s var(--ease-out) both; animation-delay: 1.6s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

/* 老师 */
.t { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
:root { --av-edge: inset 0 0 0 1px rgb(30 25 20 / .08); }
.av { width: 36px; height: 36px; border-radius: 12px; background: var(--color-ink); display: grid; place-items: center; margin-top: 2px; }
.av span { width: 14px; height: 14px; border: 3px solid var(--color-brand); border-radius: 50%; }
.av.ghost { visibility: hidden; }
/* 老师头像：手绘女老师（图由 design-system/avatar/build.py 生成）。闭眼是一张透明图，盖在脸上 */
.av:not(.ghost) { position: relative; overflow: hidden; background: var(--color-bg) url(avatar/closed.webp) center / cover no-repeat; box-shadow: var(--av-edge); }
.av:not(.ghost) > span { display: none; }
.av:not(.ghost)::after { content: ''; position: absolute; inset: 0; background: url(avatar/blink.webp) center / cover no-repeat; opacity: 0; }
/* 只有最新那位老师会眨眼；一屏有好几个头像，一起眨会很假 */
.t:not(:has(~ .t > .av:not(.ghost))) > .av:not(.ghost)::after { animation: av-blink 7s infinite; }
/* 朗读时换嘴型（lip.js 按音量设 data-mouth）；正在说的头像放大一点，嘴才看得清。
   闭嘴的脸一直垫在底下：某张嘴型图浏览器还没准备好的那一瞬间，看到的是闭嘴的脸，不是空白 */
.av[data-mouth="small"] { background-image: var(--av-small, url(avatar/small.webp)), url(avatar/closed.webp); }
.av[data-mouth="half"] { background-image: var(--av-half, url(avatar/half.webp)), url(avatar/closed.webp); }
.av[data-mouth="wide"] { background-image: var(--av-wide, url(avatar/wide.webp)), url(avatar/closed.webp); }
.av[data-mouth="o"] { background-image: var(--av-o, url(avatar/o.webp)), url(avatar/closed.webp); }
.av:not(.ghost) { transform-origin: 50% 0; transition: transform var(--dur-base) var(--ease-out); }
.av.talking { transform: scale(1.33); z-index: 1; translate: 0 var(--face-y, 0px); transition: transform var(--dur-base) var(--ease-out), translate .35s var(--ease-out); }
/* 正在读的消息没有自己的头像时，它在竖线上的节点临时变成老师的脸（lip.js 加 .talking），
   浮在节点原来的位置上，不撑高这一行；--face-y 让脸跟着正在读的那一段往下走。
   前面加 body[data-talk]：要压过竖线节点自己的圆点样式 */
body[data-talk] .av.ghost.talking { visibility: visible; position: relative; z-index: 2; overflow: hidden; width: 36px; height: 36px; border-radius: 12px; background: var(--color-bg) url(avatar/closed.webp) center / cover no-repeat; box-shadow: var(--av-edge); animation: av-talk 1s ease-in-out infinite; }
body[data-talk] .av.ghost.talking[data-mouth="small"] { background-image: var(--av-small, url(avatar/small.webp)), url(avatar/closed.webp); }
body[data-talk] .av.ghost.talking[data-mouth="half"] { background-image: var(--av-half, url(avatar/half.webp)), url(avatar/closed.webp); }
body[data-talk] .av.ghost.talking[data-mouth="wide"] { background-image: var(--av-wide, url(avatar/wide.webp)), url(avatar/closed.webp); }
body[data-talk] .av.ghost.talking[data-mouth="o"] { background-image: var(--av-o, url(avatar/o.webp)), url(avatar/closed.webp); }
body[data-talk="rail"] .av.ghost.talking { margin: -4.5px auto -12.5px; }
body[data-talk="rail"] .t:has(.win) > .av.ghost.talking { margin: 5.5px auto -12.5px; }
@keyframes av-blink {
  0%, 34% { opacity: 0; } 34.01%, 35.8% { opacity: 1; } 35.81%, 86% { opacity: 0; }
  86.01%, 87.8% { opacity: 1; } 87.81%, 90.5% { opacity: 0; } 90.51%, 92.3% { opacity: 1; } 92.31%, 100% { opacity: 0; }
}
.t-body { min-width: 0; }
.who { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 2px; }
.say { font-size: var(--text-talk); line-height: 1.6; text-wrap: pretty; }
.say strong { font-weight: 800; }
.say em { font-weight: 700; }

/* ── 老师说话的三种呈现：原样 / 线索+荧光笔（推荐）/ 气泡 ── */
/* 线索：同一组老师消息用一条竖线串起来，每句开头一个小圆点 */
body[data-talk="rail"] .t { position: relative; }
body[data-talk="rail"] .t:has(+ .t)::before { content: ""; position: absolute; left: 16.5px; top: 0; bottom: -18px; width: 3px; border-radius: 3px; background: var(--color-rail); }
body[data-talk="rail"] .t:has(> .av:not(.ghost)):has(+ .t)::before { top: 44px; }
body[data-talk="rail"] .av.ghost { visibility: visible; position: relative; z-index: 1; width: 11px; height: 11px; margin: 8px auto 0; border-radius: 50%; background: var(--c, var(--color-brand)); box-shadow: 0 0 0 3px var(--color-surface); }
body[data-talk="rail"] .t:has(.win) > .av.ghost, body[data-talk="rail"] .t.typing > .av { margin-top: 18px; }
/* 荧光笔：每句老师的话里最重要的几个词（剧本用 **…** 标出），颜色跟随当前章节 */
body:not([data-talk="plain"]) .say strong { font-weight: 800; padding: 0 3px; margin: 0 -1px; border-radius: 3px;
  background: linear-gradient(transparent 52%, var(--c-tint, var(--color-brand-tint)) 52%) no-repeat 0 0 / 100% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
body:not([data-talk="plain"]) .t:not([style]) .say strong { background-image: linear-gradient(transparent 52%, var(--color-brand-tint) 52%); }
body:not([data-talk="plain"]) .enter .say strong { animation: hl .7s var(--ease-out) both; animation-delay: .45s; }
@keyframes hl { from { background-size: 0 100%; } }
/* 气泡：只包住老师的话，卡片仍在气泡外 */
body[data-talk="bubble"] .say { display: inline-block; max-width: 100%; padding: 10px 16px 11px; border-radius: 6px 20px 20px 20px; background: var(--color-talk); }
body[data-talk="bubble"] .av.ghost + .t-body .say { border-radius: 20px; }
body[data-talk="bubble"] .who { margin-bottom: 6px; }

/* 新消息提示（学生往上翻看时） */
.new-msg { position: absolute; left: 50%; bottom: calc(var(--dock-h) + var(--tts-h, 0px) + 16px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-bg); font-weight: 800; font-size: 14px; box-shadow: 0 4px 0 var(--color-ink-edge); z-index: 5; animation: pop-in .4s var(--ease-press) both; }
.new-msg[hidden] { display: none; }
.new-msg .ic { width: 16px; height: 16px; }
.dock { position: relative; }

/* 开场分数 */
.scores { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.overall { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 14px; border-radius: var(--radius-md); background: var(--color-brand-tint); }
.overall .num { font: 700 40px/1 var(--font-display); letter-spacing: -.02em; }
.overall small { display: block; font-size: 12.5px; font-weight: 800; color: #7A3412; line-height: 1.35; }
.chip { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; border-radius: var(--radius-md); background: var(--c-tint); color: var(--c-deep); min-width: 0; }
.chip .n { font: 700 22px/1 var(--font-display); }
.chip .l { font-size: 12.5px; font-weight: 800; margin-top: 3px; white-space: nowrap; }

/* 章节贴纸 */
.chapter { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.chapter::before, .chapter::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: repeating-linear-gradient(90deg, #EADBC9 0 8px, transparent 8px 14px); }
.chapter span { font: 600 18px/1 var(--font-display); background: var(--c); color: var(--color-ink); padding: 10px 20px; border-radius: var(--radius-pill); box-shadow: 0 4px 0 var(--c-edge); transform: rotate(-1.5deg); white-space: nowrap; }
.chapter span em { font-style: normal; opacity: .65; margin-left: 8px; font-size: 14px; }

/* 改句卡（签名组件） */
.fix { margin-top: 12px; position: relative; }
.card { border-radius: var(--radius-md); padding: 16px 18px 18px; position: relative; }
.card .lbl { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 8px; }
.card .sent { font-size: 18px; line-height: 1.75; font-weight: 600; }
.said { background: var(--color-sunken); color: var(--color-ink-2); }
.said .lbl { color: var(--color-muted); }
.better { background: var(--color-ink); color: var(--color-bg); margin-top: -6px; box-shadow: 0 6px 0 var(--color-ink-edge); }
.better .lbl { color: var(--color-lime); }
.swap-arrow { position: relative; z-index: 2; width: 40px; height: 40px; margin: -14px auto; border-radius: 50%; background: var(--color-brand); color: var(--color-ink); display: grid; place-items: center; box-shadow: 0 3px 0 var(--color-brand-edge); border: 3px solid var(--color-surface); }
.swap-arrow .ic { width: 16px; height: 16px; stroke-width: 3; }
.x { display: inline-block; padding: 0 9px; margin: 0 1px; border-radius: 9px; color: var(--wrong-deep); font-weight: 800; line-height: 1.5;
  background: linear-gradient(var(--wrong-deep), var(--wrong-deep)) left 9px top 54% / calc(100% - 18px) 2.5px no-repeat, var(--wrong-tint); }
.ok { display: inline-block; padding: 1px 12px 2px; margin: 0 2px; border-radius: 11px; background: var(--c); color: var(--color-ink); font-weight: 800; box-shadow: 0 3px 0 var(--c-edge); line-height: 1.45; transform: rotate(-2deg); }
.enter .ok { animation: pill .7s var(--ease-press) both; animation-delay: calc(1s + var(--k) * .15s); }
.sent .ok:nth-of-type(2n) { transform: rotate(2deg); }
@keyframes pill { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 100% { opacity: 1; } }
/* 词汇：原说法没有错，用虚线标出"可以更好"，不划掉 */
.x.soft { background: var(--color-surface); color: var(--color-ink-2); box-shadow: inset 0 -2px 0 var(--c-edge); border-radius: 6px; padding: 0 6px; }
/* 发音：句子里要练的那个词 */
.x.heard { background: var(--c-tint); color: var(--c-deep); }
/* 流利度：句中长停顿 */
.pause { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--c-tint); color: var(--c-deep); font-size: 14px; font-weight: 800; vertical-align: 2px; box-shadow: inset 0 0 0 1.5px var(--c); }
.pause .ic { width: 14px; height: 14px; }
.correction.enter .pause { animation: breathe-gap 1.6s var(--ease-out) 2; animation-delay: .6s; }
@keyframes breathe-gap { 50% { padding-left: 18px; padding-right: 18px; } }
/* 发音卡：音节 + 重音 + 音标 + 听一遍 */
.wordcard { margin-top: 10px; background: var(--c-tint); color: var(--c-deep); }
.syl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font: 600 26px/1.2 var(--font-display); }
.syl span { padding: 2px 4px; border-radius: 8px; }
.syl .sep { font-style: normal; opacity: .45; }
.syl .on { font-size: 34px; color: var(--color-ink); background: var(--c); box-shadow: 0 3px 0 var(--c-edge); padding: 2px 10px; }
.correction.enter .syl .on { animation: pill .7s var(--ease-press) both; animation-delay: .9s; }
.ipa { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 16px; font-weight: 700; }
.heard-ipa { color: var(--color-muted); font-weight: 600; }
.word-audio-note { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--color-muted); }
.word-audio-note:empty { display: none; }
.word-audio-note a { color: inherit; text-decoration: underline; }
.kind-word .swap-arrow, .kind-stress .swap-arrow { margin-top: -6px; }
.replay.playing .pl { animation: pulse .7s ease-in-out 2; }
.opt { font-style: normal; margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .14); color: var(--color-bg); letter-spacing: .04em; }
.replay { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-ink); font-weight: 800; font-size: 13px; letter-spacing: 0; text-transform: none; box-shadow: 0 3px 0 #DCCFC2, 0 0 0 2px #E9DDD0 inset; transition: transform var(--dur-fast) var(--ease-press), box-shadow var(--dur-fast); }
.replay:active { transform: translateY(3px); box-shadow: 0 0 0 #DCCFC2, 0 0 0 2px #E9DDD0 inset; }
.replay .pl { width: 22px; height: 22px; border-radius: 50%; background: var(--color-brand); display: grid; place-items: center; }
.replay .pl .ic { width: 11px; height: 11px; margin-left: 1px; }
.why { margin-top: 16px; display: grid; gap: 8px; }
.why li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; font-size: 16px; color: var(--color-ink-2); }
.why li > span:last-child { white-space: pre-line; }   /* 讲解是两句："你说……"一行，"改成……"一行 */
.why .k { font: 600 15px/1 var(--font-display); background: var(--c-tint); color: var(--c-deep); padding: 6px 11px; border-radius: 10px; min-width: 72px; text-align: center; }
.why.stack li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.why.stack .k { justify-self: start; text-align: left; line-height: 1.35; }
.why-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--color-sunken); font-weight: 800; font-size: 14px; transition: background-color var(--dur-base); }
.why-btn:hover { background: #EDE3D8; }
.why-btn .ic { width: 15px; height: 15px; }
.why-more { margin-top: 10px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--c-tint); color: var(--color-ink); font-size: 16px; line-height: 1.65; }

/* 学生录音：橙色气泡 */
.me { display: flex; justify-content: flex-end; }
.rec { max-width: 440px; background: var(--color-brand); color: var(--color-ink); border-radius: var(--radius-lg) var(--radius-lg) 8px var(--radius-lg); padding: 14px 16px 16px; box-shadow: 0 5px 0 var(--color-brand-edge); }
.rec .who { color: #5A230A; margin: 0 0 8px; }
.rec-top { display: flex; align-items: center; gap: 12px; }
.rec-play { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--color-ink); color: var(--color-brand); display: grid; place-items: center; transition: transform var(--dur-base) var(--ease-press); }
.rec-play:active { transform: scale(.88); }
.rec-play .ic { width: 14px; height: 14px; margin-left: 2px; }
.wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; min-width: 0; overflow: hidden; }
.wave i { flex: 1; max-width: 5px; min-width: 3px; border-radius: 3px; background: var(--color-ink); opacity: .82; }
.rec-time { font: 600 15px/1 var(--font-display); }
.rec p { margin-top: 10px; font-size: 16px; font-weight: 700; line-height: 1.5; }
.rec .none { font-weight: 600; opacity: .7; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--color-surface); font-weight: 800; font-size: 15px; box-shadow: 0 0 0 2.5px var(--color-edge) inset, 0 4px 0 var(--color-edge); }

/* 结果：深色横幅 */
.win { position: relative; display: flex; align-items: center; gap: 14px; border-radius: var(--radius-md); padding: 14px 18px 14px 14px; }
.enter .win.achieved { animation: win-in .7s var(--ease-press) both; animation-delay: .1s; }
@keyframes win-in { 0% { transform: scale(.85); opacity: 0; } }
.enter .win.achieved .draw { stroke-dasharray: 24; animation: draw .45s var(--ease-out) both; animation-delay: .45s; }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.enter .win.needs_practice { animation: nudge .5s var(--ease-out) both; animation-delay: .1s; }
@keyframes nudge { 0% { opacity: 0; transform: translateX(-8px); } 60% { transform: translateX(3px); } 100% { opacity: 1; transform: none; } }
.enter .win.uncertain { animation: fade-up .4s var(--ease-out) both; }
.win .burst { display: none; }
.enter .win .burst { display: block; }
.badge { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.badge .ic { width: 24px; height: 24px; stroke-width: 3.2; }
.win h3 { font: 700 24px/1.05 var(--font-display); letter-spacing: -.01em; }
.win p { font-size: 15.5px; margin-top: 3px; }
.win.achieved { background: var(--color-ink); color: var(--color-bg); box-shadow: 0 5px 0 var(--color-ink-edge); }
.win.achieved .badge { background: var(--color-lime); color: var(--color-ink); }
.win.achieved h3 { color: var(--color-lime); }
.win.achieved p { color: #EDE3D8; }
.win.achieved p em { color: #fff; }
.win.needs_practice { background: var(--color-brand-tint); color: var(--color-ink); box-shadow: 0 5px 0 #F5C3A6; }
.win.needs_practice .badge { background: var(--color-brand); color: var(--color-ink); }
.win.needs_practice h3 { color: #7A3412; }
.win.uncertain { background: var(--color-sunken); color: var(--color-ink); box-shadow: 0 5px 0 var(--color-edge); }
.win.uncertain .badge { background: var(--color-surface); color: var(--color-muted); box-shadow: 0 0 0 2.5px var(--color-edge) inset; }
.win.uncertain h3 { color: var(--color-ink-2); }
.burst { position: absolute; left: 38px; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 3px; opacity: 0; animation: fly 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
.burst i:nth-child(3n) { border-radius: 50%; }
.burst i:nth-child(4n) { width: 5px; height: 14px; }
@keyframes fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); } }
.used { font-size: 13px; font-weight: 700; color: var(--color-muted); margin-top: 8px; padding-left: 4px; }

/* 勾选清单：章节小结卡 / 报告色块共用 */
.checks { background: var(--color-surface); border-radius: var(--radius-md); padding: 6px 6px 8px; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 12px; font-size: 15px; line-height: 1.45; color: var(--color-ink-2); }
.checks li + li { border-top: 2px dashed #F1E6D8; }
.checks .ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.checks .ck .ic { width: 13px; height: 13px; stroke-width: 3; }
.checks .done .ck { background: var(--color-ink); color: var(--color-lime); }
.checks .done { color: var(--color-ink); font-weight: 700; }
.checks .later .ck { background: var(--color-brand-tint); color: #7A3412; }
.checks .todo .ck { border: 2.5px solid #DCCDBD; }
.more { padding: 8px 6px 0; font-size: 13px; font-weight: 700; color: var(--color-muted); }

.wrap-card { margin-top: 14px; border-radius: var(--radius-lg); background: var(--c); box-shadow: 0 6px 0 var(--c-edge); padding: 4px 12px 14px; }
.wc-head { display: flex; align-items: center; gap: 12px; padding: 12px 6px; }
.wc-head .nm { font: 600 18px/1.1 var(--font-display); }
.wc-head .sc { margin-left: auto; font: 700 30px/1 var(--font-display); letter-spacing: -.02em; }
.state { display: inline-block; font: 800 12px/1.4 var(--font-body); letter-spacing: .07em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-pill); margin-left: 6px; vertical-align: 2px; background: var(--color-ink); color: var(--c); }
.wrap-card .more { color: var(--color-ink-2); }

/* 折叠的章节（结尾画面） */
.fold { border-radius: var(--radius-lg); background: var(--c-tint); box-shadow: 0 4px 0 var(--c); }
.fold-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 18px; text-align: left; }
.fold-row:disabled { cursor: default; }
.fold .pip { width: 14px; height: 14px; border-radius: 5px; background: var(--c); box-shadow: 0 2px 0 var(--c-edge); flex: none; }
.fold .nm { font: 600 17px/1.1 var(--font-display); }
.fold .detail { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--c-deep); }
.fold-body { padding: 0 12px 12px; }
.fold.skipped { background: var(--color-surface); box-shadow: 0 0 0 2px #E9DDD0 inset; }
.fold.skipped .pip { background: transparent; box-shadow: 0 0 0 2px var(--c) inset; }
.fold.skipped .detail { color: var(--color-muted); }

/* 结尾总结 */
.closing { margin-top: 12px; display: grid; gap: 14px; }
.closing .scores { margin-top: 0; }
.cl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cl-cols section { border-radius: var(--radius-md); padding: 14px 16px; background: var(--color-sunken); }
.cl-cols h4 { display: flex; align-items: center; gap: 8px; font: 600 16px/1.2 var(--font-display); margin-bottom: 8px; }
.cl-cols h4 .ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cl-cols h4 .ic { width: 13px; height: 13px; stroke-width: 3; }
.cl-cols .good h4 .ck { background: var(--color-ink); color: var(--color-lime); }
.cl-cols .keep h4 .ck { background: var(--color-brand-tint); color: #7A3412; }
.cl-cols li { padding: 4px 0; font-weight: 700; font-size: 15px; }
.cl-cols .skipped { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--color-muted); }
.cl-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--color-ink); color: var(--color-bg); box-shadow: 0 5px 0 var(--color-ink-edge); }
.cl-next .lbl { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--color-lime); }
.nx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nx-row .ic { color: #8E8379; }
.nx { font: 600 16px/1 var(--font-display); padding: 8px 14px; border-radius: var(--radius-pill); background: var(--c); color: var(--color-ink); box-shadow: 0 3px 0 var(--c-edge); }
.nx.plain { background: var(--color-surface); box-shadow: 0 3px 0 #8E8379; font-family: var(--font-body); font-weight: 800; font-size: 15px; }

/* ── 底部操作坞（面板内） ── */
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 12px 40px 14px; border-top: 2px solid #F3EADF; background: linear-gradient(var(--color-surface), #FFFBF6); }
.sheet-handle { display: none; }
.dock-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; max-width: 760px; margin: 0 auto; }
.dock-row > :first-child { justify-self: end; }
.dock-row > :last-child { justify-self: start; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 24px; border-radius: 18px; font: 600 18px/1 var(--font-display); letter-spacing: .005em; white-space: nowrap; user-select: none; transition: transform var(--dur-fast) var(--ease-press), box-shadow var(--dur-fast); }
.btn .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.btn-pri { background: var(--color-brand); color: var(--color-on-brand); box-shadow: 0 var(--press-depth) 0 var(--color-brand-edge); }
.btn-pri:hover { transform: translateY(-1px); box-shadow: 0 7px 0 var(--color-brand-edge); }
.btn-sec { background: var(--color-surface); color: var(--color-ink); box-shadow: 0 0 0 2.5px var(--color-edge) inset, 0 var(--press-depth) 0 var(--color-edge); }
.btn-pri:active { transform: translateY(var(--press-depth)); box-shadow: 0 0 0 var(--color-brand-edge); }
.btn-sec:active { transform: translateY(var(--press-depth)); box-shadow: 0 0 0 2.5px var(--color-edge) inset, 0 0 0 var(--color-edge); }
.skip-link { min-height: var(--hit-min); padding: 0 var(--space-2); font-weight: 800; font-size: 14px; color: var(--color-muted); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mic { width: var(--record-size); height: var(--record-size); border-radius: 50%; background: var(--color-ink); color: var(--color-brand); display: grid; place-items: center; box-shadow: 0 var(--press-depth) 0 var(--color-ink-edge), 0 0 0 6px var(--color-brand-tint); transition: transform var(--dur-fast) var(--ease-press), box-shadow var(--dur-fast); }
.mic .ic { width: 30px; height: 30px; stroke-width: 2.4; }
.mic:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--color-ink-edge), 0 0 0 6px var(--color-brand-tint); }
.mic.live { background: var(--color-brand); color: var(--color-ink); box-shadow: 0 var(--press-depth) 0 var(--color-brand-edge), 0 0 0 6px var(--color-brand-tint); animation: pulse 1.1s ease-in-out infinite; }
.dock.record .mic.idle { background: var(--color-brand); color: var(--color-ink); box-shadow: 0 var(--press-depth) 0 var(--color-brand-edge), 0 0 0 6px var(--color-brand-tint); animation: pulse 1.6s ease-in-out infinite; }
.mic.checking { background: var(--color-ink); box-shadow: 0 var(--press-depth) 0 var(--color-ink-edge), 0 0 0 6px var(--color-sunken); cursor: progress; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid rgba(255, 255, 255, .18); border-top-color: var(--color-brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mic.live .ic { animation: morph .3s var(--ease-press) both; }
@keyframes morph { from { transform: scale(.4) rotate(-45deg); opacity: 0; } }
.dock.busy .dock-row { opacity: .45; transition: opacity var(--dur-base); }
.dock .btn:disabled, .dock .mic:disabled { cursor: default; }
.out-note { font-size: 13px; font-weight: 800; color: var(--color-muted); text-align: center; letter-spacing: .04em; text-transform: uppercase; }
.dock-row { animation: none; }
.mic-cap { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--color-muted); letter-spacing: .05em; text-transform: uppercase; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-brand); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.live-wave { display: flex; align-items: center; gap: 3px; height: 34px; width: 150px; justify-self: start; }
.live-wave i { flex: 1; border-radius: 3px; background: var(--color-brand); animation: talk 900ms var(--ease-out) infinite alternate; }
.live-wave i:nth-child(3n) { animation-duration: 640ms; } .live-wave i:nth-child(4n+1) { animation-duration: 1120ms; } .live-wave i:nth-child(5n+2) { animation-delay: -300ms; }
@keyframes talk { from { transform: scaleY(.25); } }

/* ── 报告 ── */
.report { min-height: 0; overflow-y: auto; padding: 2px 4px 28px; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.scrim, .close-drawer { display: none; }
.r-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 4px 6px 2px; }
.r-head h2 { font: 600 20px/1 var(--font-display); }
.r-head .sub { font-size: 13px; color: var(--color-muted); font-weight: 700; margin-top: 4px; }
/* 练习结束后，右上角"结束练习"不再显示（底部有"回到主页，再录一段"） */
body.lesson-done #endBtn { display: none; }
/* 中途结束的确认框：和网站的卡片、按钮同一套样式 */
.confirm-layer { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(30, 25, 20, .38); animation: fr-fade var(--dur-base) var(--ease-out); }
.confirm { width: min(420px, 100%); padding: 24px 24px 22px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: 0 0 0 1px var(--color-line), 0 6px 0 var(--color-edge); animation: cf-pop var(--dur-slow) var(--ease-press); }
.confirm .av { margin: 0 0 14px; }
.confirm h3 { font: 600 22px/1.2 var(--font-display); }
.confirm p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--color-ink-2); }
:lang(zh-CN) .confirm p { line-height: var(--leading-zh); }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.cf-row .btn { min-height: 52px; padding: 0 14px; font-size: 17px; }
@keyframes fr-fade { from { opacity: 0; } }
@keyframes cf-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
/* "查看完整报告"：报告栏标题右边的文字按钮 */
.r-full { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 6px 0 12px; border-radius: var(--radius-pill); font-weight: 800; font-size: 13.5px; color: var(--color-ink); background: var(--color-surface); box-shadow: 0 0 0 1.5px var(--color-edge), 0 2px 0 var(--color-edge); white-space: nowrap; }
.r-full:hover { box-shadow: 0 0 0 1.5px var(--color-ink-2), 0 2px 0 var(--color-ink-2); }
.r-full .ic { width: 15px; height: 15px; }
/* 完整报告：整页盖在对话课上面 */
.fr-layer { position: fixed; inset: 0; z-index: 200; background: var(--color-bg); animation: fr-in var(--dur-base) var(--ease-out); }
.fr-layer iframe { width: 100%; height: 100%; border: 0; display: block; }
body.fr-open { overflow: hidden; }
@keyframes fr-in { from { opacity: 0; transform: translateY(8px); } }
.r-total { display: flex; align-items: center; gap: 16px; background: var(--color-brand); border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: 0 6px 0 var(--color-brand-edge); }
.r-total .num { font: 700 58px/.9 var(--font-display); letter-spacing: -.03em; }
.r-total .meta { font-weight: 800; font-size: 14px; line-height: 1.35; color: #3A1606; }
.r-total .cefr { margin-left: auto; font: 700 22px/1 var(--font-display); background: var(--color-ink); color: var(--color-lime); padding: 10px 14px; border-radius: 14px; }
.r-total .cefr small { display: block; font: 800 11.5px/1 var(--font-body); letter-spacing: .08em; color: #CFC3B7; margin-bottom: 4px; }
.r-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 6px; font-size: 12.5px; font-weight: 800; color: var(--color-muted); }
.r-legend span { display: inline-flex; align-items: center; gap: 6px; }
.r-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-now { background: var(--color-ink); }
.lg-next { background: var(--color-sunken); box-shadow: 0 0 0 2px var(--color-ink-2) inset; }
.lg-todo { background: var(--color-surface); box-shadow: 0 0 0 2px var(--color-edge) inset; }

.tile { border-radius: var(--radius-lg); transition: transform var(--dur-slow) var(--ease-press); }
.tile:hover { transform: translateY(-2px); }
.tile-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; text-align: left; }
.tile-h .nm { font: 600 18px/1.1 var(--font-display); }
.tile-h .one { font-size: 14px; font-weight: 700; opacity: .9; margin-top: 3px; }
.tile-h .sc { margin-left: auto; font: 700 30px/1 var(--font-display); letter-spacing: -.02em; }
.tile-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease-press); }
.tile-b > div { overflow: hidden; }
.tile.open .tile-b { grid-template-rows: 1fr; }
.tile.open .tile-b > div { padding: 0 12px 14px; }
.tile.bump { animation: bump .6s var(--ease-press); }
@keyframes bump { 30% { transform: translateY(-6px) scale(1.02); } }
.checks li.just { animation: flash 1.4s var(--ease-out); }
@keyframes flash { 0%, 40% { background: var(--c-tint, var(--color-brand-tint)); } }
.checks li.just .ck { animation: pop-ck .5s var(--ease-press) both; animation-delay: .2s; }
@keyframes pop-ck { from { transform: scale(0); } }
.checks li.just .draw { stroke-dasharray: 24; animation: draw .4s var(--ease-out) both; animation-delay: .45s; }
.tile.now { background: var(--c); color: var(--color-ink); box-shadow: 0 6px 0 var(--c-edge); }
.tile.done { background: var(--c-tint); color: var(--c-deep); box-shadow: 0 4px 0 var(--c); }
.tile.done .state { background: var(--c-deep); color: var(--c-tint); }
.tile.next { background: var(--c-tint); color: var(--c-deep); box-shadow: 0 0 0 2px var(--c) inset, 0 4px 0 var(--c); }
.tile.next .state { background: var(--c); color: var(--color-ink); }
.tile.todo, .tile.skipped { background: var(--color-surface); color: var(--c-deep); box-shadow: 0 0 0 2px var(--c-tint) inset, 0 4px 0 var(--c-tint); }
.tile.todo .state, .tile.skipped .state { background: #F3EBE3; color: var(--color-muted); }
.tile.skipped { box-shadow: 0 0 0 2px var(--color-edge) inset; }
.tile.todo .sc, .tile.skipped .sc { font-size: 26px; }

/* ── 平板 ── */
@media (min-width: 768px) and (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; padding: 16px 20px 0; }
  .journey { margin: 0 20px; }
  .top { padding: 14px 20px 6px; }
  .feed { padding: 22px 24px; }
  .dock { padding: 14px 20px 18px; }
  .dock-row { gap: 12px; }
  .btn { font-size: 16px; padding: 0 16px; }
  .task { display: none; }
}

/* ── 手机 ── */
@media (max-width: 767px) {
  body { display: block; height: auto; }
  .app { display: block; }
  .top { padding: 12px 16px 4px; gap: 10px; }
  .task { display: none; }
  .brand { font-size: 20px; }
  .end-btn span { display: none; }
  .journey { display: none; }
  .strip { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 6px; position: sticky; top: 0; z-index: 25; padding: 10px 16px 12px; background: var(--color-bg); }
  .seg { min-width: 0; }
  .seg .bar { height: 10px; border-radius: 6px; background: #EEE3D7; overflow: hidden; }
  .seg .bar i { display: block; height: 100%; background: var(--color-ink); border-radius: 6px; }
  .seg .lb { display: block; font-size: 12px; font-weight: 800; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-muted); }
  .seg.now .bar { background: var(--c); }
  .seg.now .lb { color: var(--c-deep); }
  .seg.next .bar { background: var(--c-tint); box-shadow: 0 0 0 2px var(--c) inset; }
  .seg.done .bar i { background: var(--c); }
  .seg.skipped .bar { background: transparent; box-shadow: 0 0 0 1.5px #DCCDBD inset; }
  .main { display: block; padding: 0; }
  .convo { border-radius: 0; box-shadow: none; background: transparent; }
  .feed { overflow: visible; padding: 8px 16px calc(var(--dock-h) + var(--tts-h, 0px) + 24px); gap: 16px; }
  .t { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  body[data-talk="rail"] .t:has(+ .t)::before { left: 13.5px; bottom: -16px; }
  body[data-talk="rail"] .t:has(> .av:not(.ghost)):has(+ .t)::before { top: 38px; }
  .new-msg { position: fixed; bottom: calc(var(--dock-h) + var(--tts-h, 0px) + 16px); }
  .av { width: 30px; height: 30px; border-radius: 10px; }
  .av.talking { transform: scale(1.2); }   /* 手机上头像和文字只隔 10px，少放大一点 */
  body[data-talk] .av.ghost.talking { width: 30px; height: 30px; border-radius: 10px; }
  body[data-talk="rail"] .av.ghost.talking { margin: -1.5px auto -9.5px; }
  body[data-talk="rail"] .t:has(.win) > .av.ghost.talking { margin: 8.5px auto -9.5px; }
  .av span { width: 12px; height: 12px; }
  .say { font-size: 16.5px; }
  .overall .num { font-size: 34px; }
  .chip { padding: 7px 11px; }
  .chip .n { font-size: 19px; }
  .card { padding: 14px 14px 16px; }
  .card .sent { font-size: 17px; }
  .card .lbl { flex-wrap: wrap; }
  .why li { gap: 10px; }
  .why .k { min-width: 62px; }
  .rec { max-width: 92%; }
  .win h3 { font-size: 21px; }
  .chapter span { font-size: 17px; }
  .cl-cols { grid-template-columns: 1fr; }

  .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 16px calc(14px + env(safe-area-inset-bottom)); background: var(--color-surface); border-top: 2px solid var(--color-line); }
  .sheet-handle { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; font: 600 16px/1 var(--font-display); }
  .sheet-handle .pip { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--color-brand)); box-shadow: 0 2px 0 var(--c-edge, var(--color-brand-edge)); }
  .sheet-handle .up { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--color-sunken); display: grid; place-items: center; transition: transform var(--dur-slow) var(--ease-press); }
  .sheet-handle .up .ic { width: 14px; height: 14px; }
  .dock-row { grid-template-columns: 1fr 1.35fr; gap: 12px; }
  .dock-row > :first-child, .dock-row > :last-child { justify-self: stretch; }
  .dock-row > span:empty { display: none; }
  .dock .btn { width: 100%; font-size: 17px; padding: 0 12px; }
  .dock .mic-wrap { display: none; }
  .dock.recording .dock-row, .dock.record .dock-row, .dock.checking .dock-row { grid-template-columns: 1fr auto 1fr; }
  .dock.recording .mic-wrap, .dock.record .mic-wrap, .dock.checking .mic-wrap { display: flex; }
  .dock.record .dock-row > span:empty, .dock.checking .dock-row > span:empty { display: block; }
  .dock.out .dock-row { grid-template-columns: 1fr 1.35fr; }
  .dock.out .dock-row > span:empty { display: none; }
  .sheet-handle.ping .pip { animation: ping 1s var(--ease-out) 2; }
  @keyframes ping { 50% { transform: scale(1.6); } }
  .dock .mic { width: 64px; height: 64px; }
  .dock .btn-sec { font-size: 15px; }
  .live-wave { width: 100%; }
  .dock.summary .dock-row { grid-template-columns: 1fr 1fr; }
  .dock.summary .skip-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; min-height: 32px; }
  .dock.summary .btn-sec { font-size: 15px; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(30, 25, 20, .38); opacity: 0; pointer-events: none; transition: opacity var(--dur-slow); }
  .report { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 84vh; overflow-y: auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--color-bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-sheet); transform: translateY(105%); visibility: hidden; transition: transform .5s var(--ease-press), visibility 0s linear .5s; }
  .report::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: #D9CBBE; margin: 0 auto 10px; }
  .close-drawer { display: grid; place-items: center; width: var(--hit-min); height: var(--hit-min); border-radius: 50%; background: var(--color-surface); box-shadow: 0 2px 0 var(--color-line); }
  body.sheet-open .report { transform: none; visibility: visible; transition: transform .5s var(--ease-press); }
  body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
  body.sheet-open .sheet-handle .up { transform: rotate(180deg); }
  .r-total .num { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .burst { display: none; }
}

/* ── 操作栏收起：往上翻看时只留右下角的主操作（麦克风或主按钮），"回到当前"移到左下角 ── */
.dock { animation: dock-full .26s var(--ease-press); }
.dock.mini { left: auto; right: 24px; bottom: 20px; padding: 0; border: 0; background: none; animation: dock-mini .26s var(--ease-press); }
.dock.mini .sheet-handle, .dock.mini .dock-row > :not(.mic-wrap):not(.btn-pri) { display: none; }
.dock.mini .dock-row { display: flex; align-items: center; gap: 10px; max-width: none; margin: 0; filter: drop-shadow(0 8px 16px rgba(30, 25, 20, .16)); }
.dock.mini .mic-wrap { display: flex; flex-direction: row-reverse; gap: 10px; }
.dock.mini .mic { width: 60px; height: 60px; }
.dock.mini .mic .ic { width: 26px; height: 26px; }
.dock.mini .mic-cap { padding: 9px 13px; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-ink); box-shadow: 0 0 0 1.5px var(--color-line), 0 3px 0 var(--color-line); }
.dock.mini .btn { width: auto; min-height: 50px; padding: 0 20px; font-size: 17px; }
body.dock-mini .new-msg { left: 24px; bottom: 31px; transform: none; }
@keyframes dock-full { from { opacity: 0; transform: translateY(10px); } }
@keyframes dock-mini { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@media (max-width: 767px) {
  .dock.mini { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); padding: 0; }
  body.dock-mini .new-msg { left: 16px; bottom: calc(29px + env(safe-area-inset-bottom)); }
  body.dock-mini:has(#newMsg:not([hidden])) .dock.mini .mic-cap { display: none; }   /* 手机上"回到当前"出现时只留麦克风，免得挤在一起 */
}
@media (prefers-reduced-motion: reduce) { .dock, .dock.mini { animation: none; } }

/* 电脑上整页不回弹：页面本身不滚动，只有对话区和报告各自滚动；两者滚到头也不把回弹传给整页 */
@media (min-width: 768px) {
  html, body { overscroll-behavior: none; }
  .feed, .report { overscroll-behavior: contain; }
}

/* ── [debug-export] 测试版专用：左下角悬浮"测试"按钮（token 用量 + 下载 ZIP）。上线前和 web/debug/ 一起删 ── */
.dbg { position: fixed; left: 12px; bottom: 12px; z-index: 300; font-size: 13px; }
.dbg-fab { touch-action: none; cursor: grab; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 10px; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-on-dark); font-weight: 700; box-shadow: 0 3px 10px rgba(30, 25, 20, .25); opacity: .82; }
.dbg-fab:hover, .dbg-fab[aria-expanded="true"] { opacity: 1; }
.dbg-fab b { font-weight: 800; color: var(--color-lime); }
.dbg-dot { width: 7px; height: 7px; border-radius: 50%; background: #8A8077; }
.dbg-dot.run { background: var(--color-lime); animation: dbg-blink 1s infinite; }
@keyframes dbg-blink { 50% { opacity: .3; } }
.dbg-pop { position: absolute; left: 0; bottom: calc(100% + 8px); width: 300px; max-height: 70vh; overflow: auto; padding: 14px 16px; border-radius: 16px; background: var(--color-surface); color: var(--color-ink); box-shadow: 0 0 0 1px var(--color-line), 0 10px 30px rgba(30, 25, 20, .2); }
.dbg-pop h3 { font: 600 16px/1.2 var(--font-display); margin-bottom: 8px; }
.dbg-pop dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; }
.dbg-pop dt { color: var(--color-muted); font-weight: 700; }
.dbg-pop dd { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.dbg-sub { margin-top: 10px; font-weight: 800; color: var(--color-muted); }
.dbg-pop ul { list-style: none; display: grid; gap: 2px; margin-top: 4px; }
.dbg-pop li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; font-size: 12.5px; }
.dbg-pop li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbg-pop li small { color: var(--color-muted); }
.dbg-dl { width: 100%; margin-top: 12px; min-height: 38px; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-on-dark); font-weight: 800; }
.dbg-dl[disabled] { opacity: .4; }
.dbg.dragging .dbg-fab { cursor: grabbing; opacity: 1; }
.dbg.below .dbg-pop { bottom: auto; top: calc(100% + 8px); }
.dbg.right .dbg-pop { left: auto; right: 0; }
.dbg-note { margin-top: 8px; font-size: 12.5px; color: var(--color-muted); line-height: 1.45; }
@media (max-width: 767px) { .dbg { left: auto; right: 8px; bottom: calc(var(--dock-h, 92px) + 64px); } .dbg-fab { min-height: 28px; padding: 0 10px 0 8px; font-size: 12px; opacity: .7; } .dbg-pop { left: auto; right: 0; width: min(300px, calc(100vw - 16px)); } }

/* 手机结尾页：两个按钮的文字都较长，上下排；主按钮（先是"完整报告"，看过后是"再录一段"）在上面占满一行 */
@media (max-width: 767px) {
  .dock.closing:not(.mini) .dock-row { grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; }
  .dock.closing:not(.mini) .dock-row > .btn { justify-self: stretch; width: 100%; }
  .dock.closing:not(.mini) .dock-row > .btn-pri { order: -1; }
}

/* 手机章节小结：没有"继续这一章"按钮时，主按钮占满一行（原来只占左半边） */
@media (max-width: 767px) {
  .dock.summary:not(.mini) .dock-row:has(> span:empty) > .btn-pri { grid-column: 1 / -1; }
  /* 窄屏（320）上英文按钮文字较长（如 Start with Pronunciation）：允许换成两行，不再被挤出屏幕 */
  .dock:not(.mini) .dock-row .btn { white-space: normal; line-height: 1.15; text-align: center; min-width: 0; }
}
/* 很窄的手机（≤360）录音时，"留到以后练"那一栏只有约 100px：去掉图标、收窄内边距，英文最多两行 */
@media (max-width: 360px) {
  .dock.record:not(.mini) .btn-sec .ic { display: none; }
  .dock.record:not(.mini) .btn-sec { padding: 0 8px; font-size: 14px; }
}

/* ── 老师朗读（边听边看）：参考 Apple Music 逐行歌词。正在说的那一小句带荧光笔、跟着声音填满，说完退回普通文字；
   录音栏上方一条"老师正在说"，没在读时缩成"老师朗读"开关。 ── */
.cl { border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(transparent 52%, var(--c-tint, var(--color-brand-tint)) 52%) no-repeat 0 100% / 0 100%; }
.cl.now, .cl.done { background-image: linear-gradient(transparent 16%, var(--c-tint, var(--color-brand-tint)) 16%, var(--c-tint, var(--color-brand-tint)) 96%, transparent 96%); }
.cl.done { background-size: 100% 0; animation: tts-settle var(--dur-slow) var(--ease-out) both; }
@keyframes tts-settle { from { background-size: 100% 100%; } to { background-size: 100% 0; } }
.tts-reading .cl:not(.on) { display: none; }
/* 结果卡片底色不同：深色"达标"卡用半透明荧光绿，浅橙"再试一次"卡用白色，荧光笔才看得见、字也读得清 */
.win.achieved .cl { --c-tint: color-mix(in srgb, var(--color-lime) 32%, transparent); }
.win.needs_practice .cl { --c-tint: var(--color-surface); }
.tts-reading .tts-off { display: none; }   /* voice.js 加减：加粗块里一个字都还没读到 */
.tts-reading strong { animation-delay: 0s !important; }
.tts-later { display: none !important; }
.why.tts-empty { display: none; }   /* voice.js 加减：讲解一条都还没轮到 */
.tts-in { animation: pop-in .45s var(--ease-press) both; }

/* 老师正在说：头像外面一圈淡橙光轻轻呼吸；线索上的小圆点向外扩一圈 */
.t.tts-speaking > .av:not(.ghost) { animation: av-talk 1s ease-in-out infinite; }
@keyframes tts-ring { 50% { transform: scale(1.28); } }
@keyframes av-talk { 50% { box-shadow: var(--av-edge), 0 0 0 3px color-mix(in srgb, var(--color-brand) 45%, transparent); } }
body[data-talk="rail"] .t.tts-speaking > .av.ghost { animation: tts-dot 1.1s ease-in-out infinite; }
@keyframes tts-dot { 50% { box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 7px var(--c-tint, var(--color-brand-tint)); } }

/* 每条老师消息末尾的小喇叭：电脑上悬停出现，手机上常驻；老师在自动读时先藏起来 */
.say-glue { white-space: nowrap; }
.say-play { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; margin: -6px 0 -4px 6px; vertical-align: middle; border-radius: 50%; background: var(--color-sunken); color: var(--color-ink-2); opacity: 0; transition: opacity var(--dur-base), background-color var(--dur-base); }
.say-play::after { content: ""; position: absolute; inset: -7px; }
.say-play .ic { width: 16px; height: 16px; }
.t.msg:hover .say-play, .say-play:focus-visible, .t.tts-speaking .say-play { opacity: 1; }
.say-play:hover, .t.tts-speaking .say-play { background: var(--color-brand-tint); color: var(--color-ink); }
@media (hover: none) { .say-play { opacity: 1; } }
body.tts-busy.tts-listen .say-play, .tts-reading .say-play { display: none; }

/* 第一次进对话课：问一次 */
.tts-ask .ask-card { margin-top: 8px; padding: 22px 22px 18px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: 0 0 0 1.5px var(--color-line), 0 5px 0 var(--color-line); }
.ask-card h2 { font: 600 var(--text-xl)/var(--leading-tight) var(--font-display); }
.ask-sub { margin-top: 6px; color: var(--color-muted); font-size: 15px; line-height: var(--leading-body); font-weight: 600; }
.ask-opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.ask-opt { display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px; border-radius: 20px; text-align: left; background: var(--color-surface); box-shadow: 0 0 0 2.5px var(--color-edge) inset, 0 var(--press-depth) 0 var(--color-edge); transition: transform var(--dur-fast) var(--ease-press), box-shadow var(--dur-fast); }
.ask-opt:hover { transform: translateY(-1px); }
.ask-opt:active { transform: translateY(var(--press-depth)); box-shadow: 0 0 0 2.5px var(--color-edge) inset, 0 0 0 var(--color-edge); }
.ask-opt:focus-visible { outline-offset: 4px; }
.ask-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--color-brand-tint); color: var(--color-ink); }
.ask-opt[data-voice-mode="text"] .ask-ic { background: var(--color-sunken); }
.ask-ic .ic { width: 24px; height: 24px; }
.ask-opt b { display: block; font: 600 19px/1.2 var(--font-display); }
.ask-opt small { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.5; font-weight: 600; color: var(--color-ink-2); }
.ask-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 20px; }
.ask-foot .replay { min-height: 36px; }
.ask-foot .replay[aria-pressed="true"] .pl { animation: tts-ring 1s ease-in-out infinite; }
.tts-ask.leaving { animation: tts-leave .32s var(--ease-out) both; }
@keyframes tts-leave { to { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* 录音栏上方："老师正在说"条 / "老师朗读"开关 */
.tts-dock { position: absolute; left: 0; right: 0; bottom: var(--dock-h); z-index: 5; display: flex; justify-content: center; padding: 16px 40px 10px; pointer-events: none; background: linear-gradient(transparent, var(--color-surface) 42%); }
.tts-dock[hidden], body.dock-mini .tts-dock { display: none; }
.tts-dock[data-state="pill"] { background: none; padding-top: 6px; }
.tts-inner { display: flex; justify-content: flex-end; width: 100%; max-width: 680px; pointer-events: auto; }
.tts-dock[data-state="pill"] .tts-bar, .tts-dock:not([data-state="pill"]) .tts-pill { display: none; }
.tts-bar { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: 0 0 0 1.5px var(--color-line), 0 4px 0 var(--color-line); animation: tts-bar-in var(--dur-slow) var(--ease-press) both; }
@keyframes tts-bar-in { from { opacity: 0; transform: translateY(8px); } }
.tts-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 3px 6px; }
.tts-lbl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; color: var(--color-muted); white-space: nowrap; }
.tts-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.tts-wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--color-brand); transform-origin: 50% 100%; transform: scaleY(.35); }
.tts-dock[data-state="play"] .tts-wave i { animation: tts-talk 760ms var(--ease-out) infinite alternate; }
.tts-dock[data-state="play"] .tts-wave i:nth-child(2) { animation-duration: 520ms; animation-delay: -200ms; }
.tts-dock[data-state="play"] .tts-wave i:nth-child(3) { animation-duration: 900ms; animation-delay: -420ms; }
.tts-dock[data-state="play"] .tts-wave i:nth-child(4) { animation-duration: 640ms; animation-delay: -90ms; }
.tts-dock[data-state="prep"] .tts-wave i { opacity: .5; animation: tts-prep 1s ease-in-out infinite; }
.tts-dock[data-state="prep"] .tts-wave i:nth-child(2) { animation-delay: .15s; }
.tts-dock[data-state="prep"] .tts-wave i:nth-child(3) { animation-delay: .3s; }
.tts-dock[data-state="prep"] .tts-wave i:nth-child(4) { animation-delay: .45s; }
@keyframes tts-prep { 50% { opacity: 1; } }
@keyframes tts-talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.tts-dock:is([data-state="stop"], [data-state="off"]) .tts-wave { display: none; }
.tts-dock:is([data-state="stop"], [data-state="off"]) .tts-ctl { display: none; }
.tts-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.tts-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--hit-min); height: var(--hit-min); padding: 0 12px; border-radius: 14px; background: var(--color-sunken); color: var(--color-ink); font-weight: 800; font-size: 14px; white-space: nowrap; transition: background-color var(--dur-base), transform var(--dur-fast) var(--ease-press); }
.tts-btn:hover { background: var(--color-line); }
.tts-btn:active { transform: scale(.94); }
.tts-btn.icon { width: var(--hit-min); padding: 0; }
.tts-btn .ic { width: 17px; height: 17px; }
.tts-btn.speed { min-width: 56px; font: 600 16px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tts-btn.quiet { background: none; color: var(--color-muted); }
.tts-btn.quiet:hover { background: var(--color-sunken); color: var(--color-ink); }
.tts-pill { display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit-min); padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-ink); font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: 0 0 0 1.5px var(--color-line), 0 3px 0 var(--color-line); }
.tts-pill .pl { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--color-sunken); }
.tts-pill .ic { width: 15px; height: 15px; }
.tts-pill:hover { box-shadow: 0 0 0 1.5px var(--color-edge), 0 3px 0 var(--color-edge); }
.tts-pill .sw { position: relative; width: 34px; height: 20px; border-radius: var(--radius-pill); background: var(--color-line); transition: background-color var(--dur-base); }
.tts-pill .sw i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-surface); box-shadow: 0 1px 2px var(--color-edge); transition: transform var(--dur-base) var(--ease-press); }
.tts-pill[aria-pressed="true"] .pl { background: var(--color-brand-tint); }
.tts-pill[aria-pressed="true"] .sw { background: var(--color-brand); }
.tts-pill[aria-pressed="true"] .sw i { transform: translateX(14px); }

@media (max-width: 767px) {
  .tts-dock { position: fixed; z-index: 29; padding: 14px 16px 8px; background: linear-gradient(transparent, var(--color-bg) 40%); }
  .tts-bar { gap: 8px; padding: 6px 6px 6px 7px; }
  .tts-info { padding: 2px; }
  .tts-bar { flex: 1 1 auto; }
  /* 手机上读的时候只留声波图标，"老师正在说"几个字放不下（读屏软件照样能读到）；停下、没声音这类提示照常显示 */
  .tts-dock:is([data-state="play"], [data-state="prep"], [data-state="pause"]) .tts-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tts-dock:is([data-state="play"], [data-state="prep"], [data-state="pause"]) .tts-ctl { margin-left: auto; }
  .tts-ctl { gap: 4px; }
  .tts-btn .tl { display: none; }
  .tts-btn:not(.speed) { width: var(--hit-min); padding: 0; }
  .tts-btn.speed { min-width: 50px; padding: 0 8px; }
  .tts-btn.quiet { width: 36px; min-width: 36px; }
  .tts-ask .ask-card { padding: 18px 16px 16px; }
  .ask-card h2 { font-size: 22px; }
  .ask-opts { grid-template-columns: minmax(0, 1fr); }
  .ask-opt { gap: 12px; padding: 16px 14px; }
  .ask-ic { width: 40px; height: 40px; border-radius: 14px; }
  .ask-opt small { font-size: 14px; text-wrap: pretty; }
}
@media (prefers-reduced-motion: reduce) {
  .tts-wave i { transform: scaleY(.6); }
  .t.tts-speaking > .av, body[data-talk="rail"] .t.tts-speaking > .av.ghost, .av::after { animation: none; }
}
