/* Wren 英语网站 · 组件（设计说明书第 5 节第 2 步）
   只用 tokens.css 里的变量（tests/test_components.py 会查：这里不许写死颜色）；以后开发 M1–M8 直接沿用这里的 class。
   动画只动 transform 和 opacity，不循环；「减弱动态效果」打开时 tokens.css 把位移、缩放变成 0 / 1，
   最后一段再把撒花、翻卡、弹簧这类整段换成淡入淡出。 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-tap-highlight-color: transparent;
}
/* 纸的颗粒只铺在高清的手机屏上：电脑屏（Windows 125% / 150% 缩放）上 4px 的点会糊成杂点，看着「底色迷糊」（10/5），
   而且底部按钮条那一块没有颗粒，宽屏上会露出一个方块。讲义页不铺（lesson-web.css） */
@media (max-width: 899.98px) and (min-resolution: 2dppx), (max-width: 899.98px) and (-webkit-min-device-pixel-ratio: 2) {
  body { background-image: radial-gradient(var(--grain) 1px, transparent 1.2px); background-size: 4px 4px; }
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[aria-disabled="true"] { cursor: default; }
[hidden] { display: none !important; }
p, h1, h2, h3, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-fill { fill: currentColor; stroke: none; }
.nw { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 页面外壳：单栏、最宽 560、左右 16；有底部导航的页面 body 加 has-tabbar，底下留出导航的高度 */
/* overflow-x: clip：从右边滑进来、拖题卡时内容会暂时伸出去，裁在这里，页面不会变宽、不能横着滚（clip 不影响吸顶吸底）。
   所以进场动效动的是 .page 里面的块，不是 .page 自己 */
.page { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter) var(--sp-10); overflow-x: clip; }
body.has-tabbar .page { padding-bottom: calc(var(--nav-h) + var(--sp-6)); }
/* 一页里一块一块往下排 */
.stack > * + * { margin-top: var(--sp-4); }

/* ============ 框架（第 3 步）：页面标题、进到下一层的顶栏、当按钮用的链接 ============ */
a { color: var(--accent); }
a.btn, a.tile, a.list-row, a.audio-chip, a.back-link { text-decoration: none; }
a.tile, a.list-row { color: inherit; }
/* 四个板块的页面标题 */
.page-title { padding-top: max(var(--sp-6), env(safe-area-inset-top)); font-size: var(--fs-title); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
/* 讲义、练习页、测验这些「下一层」：顶上一条，左边返回，中间标题；不显示底部导航 */
.topbar { position: sticky; top: 0; z-index: var(--z-nav); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--sp-2);
  padding: 4px var(--gutter); padding-top: max(4px, env(safe-area-inset-top)); background: var(--nav-bg); box-shadow: inset 0 -1px 0 var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); margin-left: -6px; justify-self: start; color: var(--accent); font-size: var(--fs-body); }
.back-link .ic { width: 22px; height: 22px; }
.topbar-title { font-size: var(--fs-body); font-weight: var(--fw-semibold); text-align: center; text-wrap: balance; }
.topbar-end { justify-self: end; }

/* 练习页一题一卡：左右切换，带一点跟手感（components.js 里的 qdeck）。竖着划照常滚页面 */
.qdeck { position: relative; touch-action: pan-y; }
.qdeck > [data-q] { transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) ease; }
.qdeck > [data-q].is-dragging { transition: none; }
.qdeck-nav { position: sticky; bottom: 0; z-index: var(--z-sticky); margin: var(--sp-4) calc(-1 * var(--gutter)) 0;
  padding: 24px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 30px); pointer-events: none; }
.qdeck-nav .btn { pointer-events: auto; }

/* ---------- 文字 ---------- */
.greeting { font-size: var(--fs-title); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.en { font-family: var(--font-en); font-size: var(--fs-en); line-height: var(--lh-tight); }
.en-lg { font-family: var(--font-en); font-size: var(--fs-en-lg); line-height: var(--lh-tight); }
.gloss { font-size: var(--fs-sm); color: var(--text-2); }          /* 英文下面的中文释义：小一号、灰 */
.meta { font-size: var(--fs-sm); color: var(--text-2); }
/* 标题两行时尽量匀开，不留一个字孤零零在第二行（iOS 17.5 起支持，旧的忽略） */
.greeting, .lesson-title, .card-title, .empty-title, .list-title { text-wrap: balance; }
.lesson-note, .empty-text, .notice-body { text-wrap: pretty; }

/* ---------- 通用动效 ---------- */
[data-press] { transition: transform var(--dur-press) var(--ease-out); }
[data-press].is-pressed { transform: scale(var(--press-scale)); }
.rise { animation: rise var(--dur-enter) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } to { opacity: 1; transform: none; } }
/* 进入下一层（今天 → 讲义）、换下一题：从右边进来 */
.enter-next { animation: slidein var(--dur-enter) var(--ease-out) both; }
@keyframes slidein { from { opacity: 0; transform: translateX(var(--slide)); } to { opacity: 1; transform: none; } }
/* 回到上一题：从左边进来 */
.enter-prev { animation: slideback var(--dur-enter) var(--ease-out) both; }
@keyframes slideback { from { opacity: 0; transform: translateX(calc(-1 * var(--slide))); } to { opacity: 1; transform: none; } }

/* ============ 卡片 ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px var(--sp-4) var(--sp-4); box-shadow: var(--shadow-card); }
.card-kicker { font-size: var(--fs-sm); color: var(--accent); font-weight: var(--fw-semibold); }
.card-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }

/* 今天这课的大卡片：右上角是这课主题的小插画（design/ill/，按主题复用） */
.lesson-head { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: var(--sp-2); align-items: center; }
.lesson-title { font-size: var(--fs-h1); font-weight: var(--fw-semibold); line-height: var(--lh-tight); margin-top: var(--sp-1); }
.lesson-art { width: 104px; height: 62px; }
.lesson-art svg { width: 100%; height: 100%; }
.lesson-note { margin-top: var(--sp-2); }
/* 首页课卡片不显示「已经做完 N 格」（10/5 晓巍定）：格子直接接在简介下面 */
.lesson-note + .tiles { margin-top: var(--sp-4); }

/* 四个格子：讲义 / 听力 / 练习页 / 测验。图标放在淡绿圆底上（借 B）；做完了圆底变实心绿、右下角挂一个勾 */
/* 一行放几格看字有多大：最小宽度用 em，微信把字调大或屏幕窄（放大显示）时自动变成一列 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8.5em, 100%), 1fr)); gap: 10px; }
.tile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  min-height: 64px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-sunk); text-align: left; }
.disc { position: relative; grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-round); background: var(--disc); color: var(--disc-ink); }
.disc .ic { width: 22px; height: 22px; }
.tile.is-done .disc { background: var(--disc-done); color: var(--disc-done-ink); }
.tile-name { font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1.3; }
.tile-state { font-size: var(--fs-sm); color: var(--todo); line-height: 1.35; }
.tile.is-half .tile-state { color: var(--half); }
/* 还没做、能点进去的那一格：虚线框提醒「从这里接着」 */
.tile-next { border-style: dashed; border-color: var(--accent); }
.tile-next.is-done { border-style: solid; border-color: var(--line); }

/* 勾 */
.tick { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-round); overflow: hidden;
  background: var(--done); color: var(--done-ink); flex: none; }
.tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* 挂在圆底右下角的小勾：浅底深绿勾，压在实心绿圆底上也分得清 */
.disc .tick { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; background: var(--surface); color: var(--done); box-shadow: 0 0 0 2px var(--done); }
.disc .tick svg { width: 13px; height: 13px; stroke-width: 3; }
/* 交练习页时勾「画」出来：圆点弹出 + 一块同色遮片往右移开（只动 transform） */
.tick-anim { opacity: 0; transform: scale(.5); transition: opacity var(--dur-press) ease, transform var(--dur-spring) var(--ease-spring); }
.tick-cover { position: absolute; inset: 0; background: var(--done); transform: translateX(0); }
.disc .tick-cover { background: var(--surface); }
.is-done .tick-anim { opacity: 1; transform: none; }
.is-done .tick-anim .tick-cover { transform: translateX(105%); transition: transform 340ms var(--ease-in-out) 140ms; }

/* 今天这句：每天一句短句，不算练习页（绝不能是当天练习页要她写的句子） */
.sentence { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-md) var(--r-md) 0; }
.sentence-label { font-size: var(--fs-sm); color: var(--accent-text); margin-bottom: 2px; }

/* 列表行（往期、这周其他的） */
.list { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.list-row .list-main { flex: 1; min-width: 0; }
.list-row .list-main > span { display: block; }
.list-row .list-title { font-size: var(--fs-body); font-weight: var(--fw-medium); }
.list-row .ic-chev { width: 20px; height: 20px; color: var(--text-2); }

/* ============ 按钮 ============ */
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 56px; padding: 0 var(--sp-5);
  border-radius: var(--r-btn); font-size: var(--fs-lg); font-weight: var(--fw-semibold); text-align: center; }
/* 主按钮：一屏只有一个，放在下半屏 */
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-inset); }
.btn-primary.is-pressed { background: var(--accent-press); }
.btn-primary[aria-disabled="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.btn-primary[aria-disabled="true"] .ic { display: none; }
/* 次按钮：同一屏里不抢主按钮 */
.btn-secondary { min-height: var(--tap); background: var(--surface); color: var(--accent-text); border: 1.5px solid var(--line-strong); font-size: var(--fs-body); }
/* 文字按钮：「看讲义」「跳过」这种轻的动作 */
.btn-text { width: auto; min-height: var(--tap); padding: 0 var(--sp-2); color: var(--accent); font-size: var(--fs-body); }
.btn-inline { width: auto; display: inline-flex; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

/* 主按钮吸在底部导航上面（真实页面里用；内容从它后面滚过去时有一段渐变，渐变那段不挡点按） */
.cta-band { position: sticky; bottom: var(--nav-h); z-index: var(--z-sticky); margin: 18px calc(-1 * var(--gutter)) 0;
  padding: 24px var(--gutter) 10px; background: linear-gradient(to bottom, transparent, var(--bg) 30px); pointer-events: none; }
.cta-band .btn { pointer-events: auto; }

/* ============ 选项按钮 ============ */
/* 感受题：四个大按钮单选。选中：淡绿底 + 深绿边 + 勾 + 轻微放大，一眼看得出（不要 M0 测试页那种淡的） */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8.5em, 100%), 1fr)); gap: 10px; }
.option { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 64px; padding: 0 14px 0 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface); font-size: var(--fs-body); text-align: left;
  transition: transform var(--dur-select) var(--ease-out), background-color var(--dur-select) ease, border-color var(--dur-select) ease; }
.opt-mark { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-round); flex: none;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.opt-mark::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); opacity: 0; transform: scale(.4);
  transition: opacity var(--dur-select) ease, transform var(--dur-select) var(--ease-spring); }
.opt-mark svg { position: relative; width: 16px; height: 16px; fill: none; stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(.4); transition: opacity var(--dur-select) ease, transform var(--dur-select) var(--ease-spring); }
.option[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: var(--fw-semibold); transform: scale(var(--select-scale)); }
.option[aria-checked="true"] .opt-mark::before, .option[aria-checked="true"] .opt-mark svg { opacity: 1; transform: none; }
.option[aria-checked="true"].is-pressed { transform: scale(var(--press-scale)); }

/* 测验选项：点了就锁住，马上显示对错。只有正确的那个打勾；选错的不打叉、不用红、不放大：陶土色 +「你选的」 */
.quiz-q { text-align: center; padding: var(--sp-2) 0 var(--sp-4); }
.quiz-big { font-size: var(--fs-h1); font-weight: var(--fw-semibold); }
.quiz-options { display: grid; gap: 10px; }
.quiz-options .option { min-height: 56px; justify-content: flex-start; font-family: var(--font-en); font-size: var(--fs-en-sm); }
.quiz-options .option .opt-note { margin-left: auto; font-family: var(--font-ui); font-size: var(--fs-sm); }
.quiz-options .option[aria-checked="true"] { transform: none; font-weight: var(--fw-regular); background: var(--surface); border-color: var(--line-strong); color: inherit; }
.quiz-options .option[aria-checked="true"] .opt-mark::before, .quiz-options .option[aria-checked="true"] .opt-mark svg { opacity: 0; transform: scale(.4); }
.quiz-options .option.is-right { background: var(--accent-soft); border-color: var(--done); color: var(--accent-text); font-weight: var(--fw-semibold); }
.quiz-options .option.is-right .opt-mark::before, .quiz-options .option.is-right .opt-mark svg { opacity: 1; transform: none; }
.quiz-options .option.is-picked-wrong { background: var(--note-soft); border-color: var(--note); color: var(--note); }
.quiz-options .option.is-picked-wrong .opt-mark { box-shadow: inset 0 0 0 1.5px var(--note); }
.quiz-options[data-locked] .option { cursor: default; }
.quiz-explain { margin-top: var(--sp-3); }
/* 正式网站（M4）：中文的选项（英译中、「不用填」）不是英文学习内容，用界面字体；
   点了、等服务器回话的那一下：只把边描成深绿虚线（不是「对的」那种淡绿底 + 勾），回来了再摆对错 */
.quiz-options .option:not([lang="en"]) { font-family: var(--font-ui); font-size: var(--fs-lg); }
.quiz-options .option.is-pending { border-color: var(--accent); border-style: dashed; }
/* 句子里的空：一道下划线，宽度和要填的词多长无关 */
.quiz-blank { display: inline-block; width: 2.4em; margin: 0 .15em; border-bottom: 2px solid var(--text); vertical-align: baseline; }
/* 卡片底下「在对答案…」「连上网就出对错」；框里是中文字的那一句（陶土色，不用红） */
.quiz-wait:not(:empty) { margin-top: var(--sp-2); }
.quiz-zh { margin-top: var(--sp-2); color: var(--note); }
/* 对完答案、点了「想不起来」的框：只读了，不再写「打后面的字母」 */
.input[readonly]::placeholder { color: transparent; }

/* ============ 自制音频播放器 ============ */
/* 一个大的播放 / 暂停键 + 能点能拖的进度条 + 「听了第几遍」（设计原则 5），不用浏览器自带的小控件 */
.player { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px var(--sp-4) 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.play { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-round); background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-inset); }
.play .ic { width: 28px; height: 28px; }
.play .i-pause { display: none; stroke-width: 2.8; }
.play.is-playing .i-play { display: none; }
.play.is-playing .i-pause { display: block; }
.play[aria-disabled="true"] { background: var(--line); color: var(--text-2); }
.player-title { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
/* 进度条：48px 高好按，里面一条 6px 的线。竖着划还能滚页面（pan-y），不会误拖进度 */
.track { position: relative; height: var(--tap); touch-action: pan-y; cursor: pointer; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 21px; height: 6px; border-radius: var(--r-bar); background: var(--line); }
.track-fill { position: absolute; left: 0; right: 0; top: 21px; height: 6px; border-radius: var(--r-bar); background: var(--accent); transform: scaleX(0); transform-origin: left; }
.track-knob { position: absolute; left: -9px; top: 15px; width: 18px; height: 18px; border-radius: var(--r-round); background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-raise); transform: translateX(0); }
.player-meta { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: lining-nums tabular-nums; margin-top: -4px; }
.player-count { color: var(--accent-text); font-weight: var(--fw-semibold); }
/* 讲义播放器下面一行两个开关（11/25 晚）：慢一点、循环这一段；样子照练一练听力卡的「慢一点」。整行横跨播放键和进度条两栏 */
.player-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0; margin: -6px 0 -6px calc(-1 * var(--sp-3)); }
.player-tools .listen-slow { font-size: var(--fs-body); }   /* 手机 375 宽两个开关放得下一行（字大了就折成两行） */

/* 讲义页底部的音频条：课包里每个 mp3 一个按钮，点了展开播放器 */
.audio-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4) calc(var(--sp-2) + env(safe-area-inset-bottom)); background: var(--nav-bg);
  box-shadow: inset 0 1px 0 var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* 两个按钮放不下（字调大了、屏幕窄）就自动换到第二行，字不断开 */
.audio-chip { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 10px;
  border-radius: var(--r-btn); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-body); font-weight: var(--fw-semibold); white-space: nowrap; }
.audio-chip .ic { width: 20px; height: 20px; }

/* ============ 录音按钮 ============ */
/* 录 / 停 / 试听 / 重录，显示秒数。录音中只有一个静止的小圆点，不闪（不要循环动画） */
.recorder { display: grid; justify-items: center; gap: 10px; padding: var(--sp-5) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: center; }
.rec-btn { display: grid; place-items: center; width: 76px; height: 76px; border-radius: var(--r-round); background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-inset); }
.rec-btn .ic { width: 32px; height: 32px; }
.rec-btn .i-stop { display: none; }
.recorder[data-state="rec"] .rec-btn { background: var(--note); color: var(--surface); }
.recorder[data-state="rec"] .rec-btn .i-mic { display: none; }
.recorder[data-state="rec"] .rec-btn .i-stop { display: block; }
.rec-status { font-size: var(--fs-body); font-variant-numeric: lining-nums tabular-nums; }
.rec-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: var(--r-round); background: var(--note); vertical-align: 1px; }
.rec-limit { position: relative; width: 100%; max-width: 280px; height: 4px; border-radius: var(--r-bar); background: var(--line); overflow: hidden; }
.rec-limit i { position: absolute; inset: 0; background: var(--note); transform: scaleX(0); transform-origin: left; transition: transform 1s linear; }
.recorder:not([data-state="rec"]) .rec-limit { display: none; }
.rec-done { display: none; width: 100%; }
.rec-done-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: var(--sp-3); font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--accent-text); }
.recorder[data-state="done"] .rec-done { display: block; }
.recorder[data-state="done"] .rec-btn, .recorder[data-state="done"] .rec-status { display: none; }
.recorder .notice { width: 100%; text-align: left; }
/* 正式网站的真录音多出来的：「还是用这条 / 用刚才那条」一行、「传好了没有」一行 */
.rec-alt { width: 100%; max-width: 360px; }
.rec-up { margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.rec-up:empty { display: none; }

/* ============ 输入框 ============ */
/* 英文框：autocapitalize / autocorrect / spellcheck / autocomplete 全关（开发说明书 3.4），她怎么打就怎么存 */
.q-note { color: var(--text-2); margin: var(--sp-1) 0 var(--sp-3); }           /* 题目说明：「不翻讲义……」 */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--sp-4); }
.field-hint { font-size: var(--fs-body); }
.field-hint .num { color: var(--text-2); margin-right: 4px; }
.en-prompt { font-family: var(--font-en); font-size: var(--fs-en-sm); line-height: var(--lh-tight); }   /* 「看英文，写中文」的那个英文 */
.input { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-family: var(--font-ui); font-size: var(--fs-body); line-height: 1.4; -webkit-appearance: none; appearance: none; }
.input-en { font-family: var(--font-en); font-size: var(--fs-en-sm); }
.input-en::placeholder { font-family: var(--font-ui); font-size: var(--fs-body); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-2); opacity: 1; }
textarea.input { min-height: 140px; resize: vertical; }
.input-min { width: 96px; text-align: center; font-variant-numeric: lining-nums tabular-nums; }
/* 两个分钟数：输入框上下对齐 */
.time-grid { display: grid; grid-template-columns: auto 96px auto; gap: 10px 12px; align-items: center; justify-content: start; }
/* 「草稿存好了」放在正在填的那张卡片里（键盘弹起来时屏幕底部看不见） */
.saved { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); opacity: 0; transition: opacity var(--dur-base) ease; }
.saved.is-shown { opacity: 1; }

/* ============ 进度条 ============ */
/* 练习页一题一卡：顶上「第 3 / 8 题」 */
.qprogress { display: grid; gap: 6px; }
.qprogress-text { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: lining-nums tabular-nums; }
.bar { position: relative; height: 6px; border-radius: var(--r-bar); background: var(--line); overflow: hidden; }
.bar i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-slow) var(--ease-in-out); }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* ============ 标签 ============ */
.tag { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); line-height: 1.3; white-space: nowrap; }
.tag .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.tag-todo { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--todo); }
.tag-half { background: var(--half-soft); color: var(--half); }
.tag-done { background: var(--accent-soft); color: var(--accent-text); }
.tag-plain { background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); }
/* 连续上课天数小标（不是按钮的样子：浅底、细边；节点那天才亮一下） */
.streak { position: relative; display: inline-flex; flex: none; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--accent); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; }
.streak b { font-family: var(--font-num); font-size: 22px; font-weight: var(--fw-semibold); font-variant-numeric: lining-nums; }

/* ============ 空状态 ============ */
/* 不催、不空荡：一张默认小插画或一个圆底图标 + 一句温和的话 + 一个可以去的地方 */
.empty { display: grid; justify-items: center; gap: 6px; padding: var(--sp-8) var(--sp-4) var(--sp-6); text-align: center; }
.empty-art { width: 160px; height: 96px; margin-bottom: var(--sp-2); }
.empty-art svg { width: 100%; height: 100%; }
/* 空状态里没有插画时用的大圆底图标 */
.disc-lg { width: 64px; height: 64px; margin-bottom: var(--sp-2); }
.disc-lg .ic { width: 30px; height: 30px; }
.empty-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.empty-text { color: var(--text-2); max-width: 26em; }
.empty .btn { margin-top: var(--sp-3); }

/* ============ 提示条 ============ */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: var(--fs-body); line-height: 1.5; }
.notice > .ic { margin-top: 1px; }
.notice-body { flex: 1; min-width: 0; }
.notice-info { background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--line); }
.notice-info > .ic { color: var(--accent); }
.notice-ok { background: var(--accent-soft); color: var(--accent-text); }
.notice-note { background: var(--note-soft); color: var(--note); }
.notice .btn { margin-top: 10px; }
.notice-close { display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -12px -14px -12px 0; color: var(--text-2); flex: none; }
.notice-close .ic { width: 20px; height: 20px; }
/* 一闪而过的提示（存好、已复制这类），不挡操作。键盘弹起来时别用它（会被键盘挡住），改在卡片里提示 */
.toast { position: fixed; left: 50%; bottom: var(--toast-bottom); z-index: var(--z-toast); width: max-content; max-width: calc(100% - 32px); padding: 10px 16px;
  border-radius: var(--r-btn); background: var(--toast-bg); color: var(--toast-fg); font-size: var(--fs-body); box-shadow: var(--shadow-raise);
  opacity: 0; transform: translate(-50%, var(--rise)); pointer-events: none; transition: opacity var(--dur-base) ease, transform 280ms var(--ease-out); }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ============ 底部导航（A 的样式：贴底、细线、毛玻璃） ============ */
/* 四个板块是四个页面，所以格子一般是 <a href>；设计稿里也可以是 <button> */
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--nav-bg);
  box-shadow: inset 0 1px 0 var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tabbar-fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); max-width: var(--max-w); margin: 0 auto; }
.tabbar > :is(a, button) { position: relative; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: var(--fs-nav); color: var(--nav-off); text-decoration: none; }
.tabbar > [aria-current="page"] { color: var(--nav-on); font-weight: var(--fw-semibold); }
/* 选中的那格顶上一小条：不只靠颜色区分（色弱也看得出） */
.tabbar > :is(a, button)::before { content: ""; position: absolute; top: -6px; left: 50%; width: 24px; height: 3px; margin-left: -12px; border-radius: 0 0 3px 3px;
  background: var(--nav-on); transform: scaleX(0); transition: transform var(--dur-base) var(--ease-out); }
.tabbar > [aria-current="page"]::before { transform: none; }
/* 选中的图标弹一下：页面打开时给当前那格加 bounce（components.js 里做） */
.tabbar > .bounce .ic { animation: tabbounce 360ms var(--ease-spring); }
@keyframes tabbounce { 0% { transform: scale(1); } 40% { transform: scale(var(--bounce-scale)); } 100% { transform: scale(1); } }

/* ============ 电脑宽屏（≥ 900px，Wren 主要用 Windows 电脑 + Edge）============ */
/* 四个板块的导航挪到顶上：一条横栏，图标和字并排、字用正文大小；选中那格的小条在下边。主按钮条贴屏幕底（底下没有导航了） */
@media (min-width: 900px) {
  .tabbar-fixed { top: 0; bottom: auto; max-width: none; grid-template-columns: repeat(4, max-content); justify-content: center; column-gap: var(--sp-2);
    padding: 6px var(--gutter); box-shadow: inset 0 -1px 0 var(--line); }
  .tabbar-fixed > :is(a, button) { flex-direction: row; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-btn); font-size: var(--fs-body); }
  /* 选中那格的小条：和「图标 + 字」一样宽，在它正下方 */
  .tabbar-fixed > :is(a, button)::before { top: auto; bottom: -6px; left: var(--sp-4); right: var(--sp-4); width: auto; margin-left: 0; border-radius: 3px 3px 0 0; }
  body.has-tabbar .page { padding-top: calc(var(--tap) + 12px); padding-bottom: var(--sp-10); }
  /* 主按钮条贴屏幕底：一条实底的工具栏，按钮靠右、按字的长短，不再是一整条拉满的大按钮（那是手机拇指的做法） */
  .cta-band { bottom: 0; display: flex; justify-content: flex-end; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
  .cta-band .btn { width: auto; min-width: 280px; }
  /* 练习页、测验的「上一题 / 下一题」：同样是一条实底工具栏，上一题在左、下一题在右（中间放键盘说明，app.css）。
     实底了就整条接点按，免得点到压在下面看不见的输入框 */
  .cta-band, .qdeck-nav { pointer-events: auto; }
  .qdeck-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-4);
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
  .qdeck-nav .btn-row { display: contents; }
  .qdeck-nav .btn { grid-row: 1; width: auto; min-width: 168px; }
  .qdeck-nav [data-qprev] { grid-column: 1; }
  .qdeck-nav :is([data-qnext], [data-submit], [data-see-score], [data-to-result]) { grid-column: 3; }
  /* 顶栏、导航不透明：半透明加模糊在电脑屏上会把滚上去的字透成一片灰影（10/5 视觉复查） */
  .tabbar-fixed, .topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  /* 进步曲线放大到一栏宽时，线和点不跟着变粗 */
  .curve-line, .curve-axis, .curve-dot { vector-effect: non-scaling-stroke; }
  .curve-dot { r: 3px; }
}

/* 电脑上鼠标移上去有反馈（手机没有悬停，不加） */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not([aria-disabled="true"]):hover, .play:not([aria-disabled="true"]):hover, .rec-btn:hover { background: var(--accent-press); }
  .recorder[data-state="rec"] .rec-btn:hover { background: var(--note); }
  .btn-secondary:not([aria-disabled="true"]):hover, a.tile:hover, .options .option:not([aria-disabled="true"]):hover,
  .quiz-options:not([data-locked]) .option:hover { border-color: var(--accent); }
  .audio-chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
  .tabbar > :is(a, button):hover { color: var(--nav-on); background: var(--surface-sunk); }
  :is(a, button).list-row:not([aria-disabled="true"]):hover .list-title, .back-link:hover, .btn-text:not([aria-disabled="true"]):hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ============ Lucas 学习小助手（10/12；小助手方案.md 第 1、12 节，设计稿 Lucas设计稿/*.dc.html）============
   入口条、顶栏的「问一问」、胶囊小按钮、切换、聊天气泡、「在想」、发送键、场景卡、底部小卡、面板（手机从底部滑出 / 电脑右侧栏）。
   照稿做，按 README 改正：字不小于 15、能点的不矮于 48、整句英文 24–32（中文里夹的英文跟着中文的字号，只标 lang="en"）、
   「在想」三个点是静止的（不循环）、「为什么？」用次按钮（一屏常有好几条「再看一眼」）。
   Lucas 说的英文用无衬线，和讲义、词汇本一样（方案第 12 节第 10 条）：面板、展开的「为什么」、Lucas 的整页（.lucas-sans） */
.lucas-sans, .lucas-panel, .lucas-why { --font-en: var(--font-ui); --lh-tight: 1.4; }
.en.en-sm { font-size: var(--fs-en-sm); }   /* 例句、对话里的一句：英文学习内容的下限 24 */

/* 头像：圆底一个衬线大写 L（不加 .en：它不是要学的英文） */
.lucas-avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-round); background: var(--disc); color: var(--disc-ink);
  font-family: var(--font-num); font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: 1; }
.lucas-avatar-sm { width: 28px; height: 28px; font-size: var(--fs-sm); }
.lucas-avatar-lg { width: 72px; height: 72px; font-size: var(--fs-num-xl); }

/* 首页的入口：「今天这句」下面一整行次按钮（不抢主按钮）：左边头像、两行字、右边箭头；休息日不放 */
.ask-entry { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 64px; padding: 10px var(--sp-4); border-radius: var(--r-btn);
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent-text); text-align: left; text-decoration: none; }
.ask-entry-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ask-entry-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.ask-entry .ic-chev { width: 20px; height: 20px; color: var(--accent); }

/* 顶栏右边的「问一问」：描边胶囊（稿 36 高 → 48） */
.ask-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-pill);
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent-text); font-size: var(--fs-sm); white-space: nowrap; }
.ask-btn b { font-family: var(--font-num); font-size: var(--fs-body); font-weight: var(--fw-semibold); }

/* 胶囊小按钮：快捷问法、「再举一个例子」「接着问」「没听懂，说中文」「给我提示」（稿 36 高 → 48）。放不下就折行 */
.pill-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: var(--fs-sm); line-height: 1.3; text-align: center; }

/* 切换（问问题 | 练对话）：两格，选中那格浮起来。两个链接（aria-current）或两个按钮（aria-selected / aria-current） */
.seg-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--seg-bg); }
.seg-switch > :is(a, button) { display: grid; place-items: center; min-height: var(--tap); padding: 0 var(--sp-2); border-radius: var(--r-sm); color: var(--text-2);
  font-size: var(--fs-body); text-align: center; text-decoration: none; }
.seg-switch > [aria-current="page"], .seg-switch > [aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: var(--fw-semibold); box-shadow: var(--shadow-seg); }
/* 练一练开头页四个分页（混合 20 题 · 听力专题 · 说一说 · 写错过的；docs/第0步共用部分.md 第 3 节）：手机上两行两列（每格和两个分页时一样宽，
   字大了也放得下），电脑上一行四格 */
@media (min-width: 900px) { .seg-switch-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 五格（练一练加了「中译英」，11/13）：手机上两列、最后一格占满一行；电脑上一行五格 */
.seg-switch-5 > :last-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .seg-switch-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .seg-switch-5 > :last-child { grid-column: auto; } }

/* 聊天气泡：她问的在右（淡绿），Lucas 回的在左（白卡片、浮起一点）。宽用百分比，字大了照样折 */
.lucas-log { display: flex; flex-direction: column; gap: var(--sp-3); }
.chat-bubble { max-width: 86%; padding: 10px 14px; border-radius: var(--r-lg); overflow-wrap: anywhere; }
.chat-me { align-self: flex-end; max-width: 80%; border-bottom-right-radius: var(--r-tail); background: var(--accent-soft); color: var(--accent-text); white-space: pre-wrap; }
.chat-ai { align-self: flex-start; display: grid; gap: var(--sp-2); border-bottom-left-radius: var(--r-tail); background: var(--surface); box-shadow: var(--shadow-bubble); }
/* 「这个问题我记下来了，晓巍会看。」（超时、出错、过不了检查）：虚线框、不浮起来 */
.chat-later { background: transparent; box-shadow: none; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.chat-bubble .meta { margin-top: -4px; }
/* 回答顶上一行：英文大字 + 念一遍 +（没学过的）「后面会学到」 */
.chat-word { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
/* 例句：淡底小块，英文 24、中文释义在下面 */
.lucas-eg { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface-sunk); }
.lucas-eg .gloss { margin-top: 2px; }
/* 念一遍：48 的深绿圆键（一次只放一段，W.solo）；放着的时候换成暂停 */
.say-btn { display: grid; place-items: center; flex: none; width: var(--tap); height: var(--tap); border-radius: var(--r-round); background: var(--accent); color: var(--accent-ink); }
.say-btn .ic { width: 20px; height: 20px; }
.say-btn .i-pause { display: none; stroke-width: 2.8; }
.say-btn.is-playing .i-play { display: none; }
.say-btn.is-playing .i-pause { display: block; }
/* 在想：三个静止的点（深浅不一，不跳、不循环；设计说明书第 4 节），读屏念「在想」 */
.thinking { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-2); }
.thinking-dots { display: inline-flex; gap: 5px; }
.thinking-dots i { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--accent); }
.thinking-dots i:nth-child(2) { opacity: .6; }
.thinking-dots i:nth-child(3) { opacity: .3; }
/* 小提示、读音提示：陶土色的淡底（和「再看一眼」同一种温和的颜色，不是警报） */
.lucas-tip { padding: var(--sp-2) 10px; border-radius: var(--r-md); background: var(--note-soft); color: var(--note); font-size: var(--fs-sm); line-height: 1.5; }
.lucas-tip b, .lucas-intro b { font-weight: var(--fw-semibold); }
/* 练对话里 Lucas 的一句：整句是一个按钮，点一下看中文 */
.talk-say { display: grid; gap: 2px; min-height: var(--tap); text-align: left; }

/* 输入：框 + 发送键（52 高，和输入框一样高） */
.lucas-compose { display: grid; gap: var(--sp-2); padding: 10px var(--sp-3) calc(12px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: inset 0 1px 0 var(--line); }
.compose-row { display: flex; align-items: flex-end; gap: var(--sp-2); }
.compose-row .input { flex: 1; min-width: 0; }
.send-btn { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: var(--r-btn); background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-inset); }
.send-btn .ic { width: 22px; height: 22px; }
.send-btn[aria-disabled="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }

/* 练对话的场景卡：推荐的那张描深绿边；练习页没交的锁着（灰底、不能点、不露那课的句子） */
.scene-list { display: grid; gap: var(--sp-3); }
.scene-card { display: flex; align-items: center; gap: 14px; padding: 14px var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  color: inherit; text-decoration: none; }
.scene-rec { border: 1.5px solid var(--accent); box-shadow: var(--shadow-card); }
.scene-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.scene-kicker { font-size: var(--fs-sm); color: var(--text-2); }
.scene-rec .scene-kicker { color: var(--accent-text); }
.scene-name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.scene-card .en { color: var(--text-2); overflow-wrap: anywhere; }
.scene-card .ic-chev { width: 20px; height: 20px; color: var(--accent); }
.scene-card.is-locked { background: var(--surface-sunk); }
.scene-card.is-locked .disc { background: var(--line); color: var(--todo); }

/* 交了以后「为什么？」展开的那一块：深绿细边的卡片 */
.lucas-why { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); padding: 14px var(--sp-4); border-radius: var(--r-lg); border: 1.5px solid var(--accent); background: var(--surface); }
.lucas-who { display: flex; align-items: center; gap: var(--sp-2); }
.lucas-why .lucas-log { gap: var(--sp-2); }
.lucas-why .chat-ai { max-width: none; padding: 0; background: none; box-shadow: none; outline: none; }

/* 放在卡片里的对话（资料库「问过的」，.lucas-log.on-card）：Lucas 的气泡降一档成淡底、不浮起来（白卡上的白气泡分不出边）；例句块反过来用白 */
.on-card .chat-ai:not(.chat-later) { background: var(--surface-sunk); box-shadow: none; }
.on-card .chat-ai .lucas-eg { background: var(--surface); }

/* 次数用完的卡；钟放在不着色的圆底上（不是格子那种淡绿） */
.disc-quiet { background: var(--surface-sunk); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.lucas-out { display: grid; gap: 10px; }
.lucas-out-head { display: flex; align-items: center; gap: 10px; }
.lucas-out-head .disc { grid-row: auto; width: 36px; height: 36px; }

/* 练对话结束：静止的大勾（不是惊喜时刻：不用 --pop-*、不放动画） */
.talk-end { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; }
.end-tick { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-round); background: var(--done); color: var(--done-ink); }
.end-tick svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.good-list { display: grid; gap: var(--sp-3); }
.good-line { display: flex; align-items: flex-start; gap: var(--sp-2); }
.good-line > .ic { flex: none; width: 20px; height: 20px; margin-top: 6px; color: var(--done); stroke-width: 2.4; }
.good-body { flex: 1; min-width: 0; }
.try-next { display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-lg); background: var(--note-soft); }
.try-next .card-kicker { color: var(--note); }

/* 底部小卡（讲义里点一个词、词汇本的「问」）：<dialog> 从底部滑上来，后面一层淡淡的遮罩；Esc、点遮罩、「关掉」都关（components.js 的 [data-sheet]） */
.bottom-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: var(--max-w); max-height: 85dvh; margin: 0 auto; padding: 0; border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sheet); overflow-y: auto; overscroll-behavior: contain; }
.bottom-sheet::backdrop { background: var(--scrim); }
.bottom-sheet-body { display: grid; gap: 14px; padding: 10px var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom)); }
.sheet-grip { justify-self: center; width: 40px; height: 4px; border-radius: var(--r-bar); background: var(--line-strong); }
.bottom-sheet[open] { animation: sheetin var(--dur-enter) var(--ease-out) both; }
@keyframes sheetin { from { opacity: 0; transform: translateY(var(--slide)); } to { opacity: 1; transform: none; } }
/* 小卡里的词：大字 + 念一遍；中文；「学过：第 26 课」 */
.word-sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.word-sheet-head .en-lg { overflow-wrap: anywhere; }
.word-sheet-zh { font-size: var(--fs-lg); }
.bottom-sheet .btn-row > .btn-primary { flex-grow: 1.4; }
.word-sheet-note { margin-top: -4px; text-align: center; }
/* 拼读音小卡（讲义里点一个单音按钮出来的底部小卡，10/16）：大字母（红）、读法、「都念一遍」；下面例词一个词一行，拆开（中间一个小点）、
   发这个音的字母红色加粗，整行点一下念一遍。英文和讲义一样用无衬线。.snd-mark 资料库「拼读音」那一格的例词也用 */
.snd-sheet { --font-en: var(--font-ui); --lh-tight: 1.4; }
.snd-mark { color: var(--snd-mark); font-weight: var(--fw-semibold); }
.snd-sheet-spell { color: var(--snd-mark); font-weight: var(--fw-semibold); }
/* 「例词都念一遍」：圆底播放键 + 看得见的字（只有图标的话，大字母旁边一个播放键像是「放这个音」，放出来的却是例词） */
.snd-all { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-2) 0 0; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--accent-text); font: inherit; font-size: var(--fs-body); -webkit-tap-highlight-color: transparent; }
.snd-all.is-playing .say-btn .i-play { display: none; }
.snd-all.is-playing .say-btn .i-pause { display: block; }
.snd-msg { color: var(--note); }
.snd-msg:empty { display: none; }
.snd-dot { margin: 0 .1em; color: var(--text-2); font-weight: var(--fw-regular); }
.snd-words { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.snd-word-item { border-bottom: 1px solid var(--line); }
.snd-word { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-3); width: 100%; min-height: var(--tap); padding: 6px 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent; }
.snd-word-en { flex: 1 1 auto; min-width: 0; font-family: var(--font-en); font-size: var(--fs-en); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.snd-word .word-wait { order: 3; flex-basis: 100%; color: var(--text-2); font-size: var(--fs-sm); }
.snd-word .word-play { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: var(--r-round); background: var(--accent); color: var(--accent-ink); }
.snd-word .word-play .ic { width: 20px; height: 20px; }
.snd-word .word-play .i-pause { display: none; stroke-width: 2.8; }
.snd-word.is-playing .word-play .i-play { display: none; }
.snd-word.is-playing .word-play .i-pause { display: block; }
.snd-word[aria-disabled="true"] .word-play { background: var(--line); color: var(--text-2); }
/* 讲义里被点的词：淡绿底（CSS 高亮，不动讲义的 DOM；不支持的浏览器就不高亮） */
::highlight(lucas-word) { background-color: var(--accent-soft); color: var(--accent-text); }

/* Lucas 面板：手机上从底部滑出约 85% 高（模态：后面一层遮罩，Esc、点遮罩关）；电脑上（≥ 900）右侧栏 400 宽（不模态：讲义照样能看、能选字）。
   屏幕够宽（≥ 1240，html.side-push）时把内容往左推开；不够宽（900–1239）盖在右边（讲义 820 + 400 放不下，推开会横滚；方案第 12 节第 12 条）。
   <dialog> 没打开时浏览器自己藏起来：display 只在 [open] 时写 */
.lucas-panel { position: fixed; inset: auto 0 0 0; width: 100%; max-width: var(--max-w); height: 85dvh; max-height: none; margin: 0 auto; padding: 0; border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg); color: var(--text); box-shadow: var(--shadow-sheet); overflow: hidden; }
.lucas-panel[open] { display: flex; flex-direction: column; animation: sheetin var(--dur-enter) var(--ease-out) both; }
.lucas-panel::backdrop { background: var(--scrim); }
/* iPhone 键盘弹起来时：面板底边跟着键盘上来（components.js 量了写 --kb） */
.lucas-panel:modal { bottom: var(--kb, 0px); height: min(85dvh, calc(100dvh - var(--kb, 0px) - var(--sp-4))); }
.lucas-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line); }
.lucas-id { display: flex; align-items: center; gap: var(--sp-2); flex: 1 1 10em; min-width: 0; }
.lucas-name { font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: var(--lh-tight); text-wrap: balance; word-break: keep-all; }
.lucas-head .lucas-left { margin-left: auto; }   /* 窄了折到下一行时靠右 */
.lucas-close { display: grid; place-items: center; flex: none; width: var(--tap); height: var(--tap); margin-left: auto; color: var(--text-2); }   /* 微信最大字号时「收起」单独折到下一行：也靠右（不孤零零在左边） */
.lucas-close .ic { width: 22px; height: 22px; }
.lucas-panel .seg-switch { flex: none; margin: var(--sp-3) var(--sp-4) 0; }
.lucas-panel > .lucas-intro, .lucas-panel > .lucas-chat { flex: 1; min-height: 0; }
.lucas-panel > .lucas-intro { overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4); }
.lucas-panel > .lucas-chat:not([hidden]) { display: flex; flex-direction: column; }
.lucas-panel .lucas-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4); }
.lucas-panel .lucas-compose { flex: none; }

/* 第一次打开：说明页（同意了才开始；她看到的字照方案第 1 节、第 12 节第 2、3 条） */
.lucas-intro { display: grid; gap: 18px; align-content: start; }
.lucas-intro-head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.lucas-intro-title { font-size: var(--fs-title); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.lucas-intro-lead { color: var(--text-2); }
.lucas-intro-lead b { color: var(--text); }
.lucas-can { display: grid; gap: 14px; }
.lucas-can-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.lucas-can-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-md); background: var(--surface-sunk); color: var(--accent); }
.lucas-can-ic .ic { width: 18px; height: 18px; }
.lucas-know { display: grid; gap: 10px; padding: var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-sunk); }
.dot-list { display: grid; gap: 6px; line-height: 1.6; }
.dot-list > li { position: relative; padding-left: 18px; }
.dot-list > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 5px; height: 5px; border-radius: var(--r-round); background: currentColor; }
.lucas-intro-btns { display: grid; gap: 10px; }

@media (min-width: 900px) {
  .lucas-panel, .lucas-panel:modal { inset: var(--test-h, 0px) 0 0 auto; width: var(--panel-w); max-width: 100%; height: auto; border-radius: 0; box-shadow: -1px 0 0 var(--line);
    z-index: calc(var(--z-nav) + 2); }
  .lucas-panel[open] { animation-name: sidein; }
  .bottom-sheet { bottom: var(--sp-6); border-radius: var(--r-lg); max-width: 480px; }
}
@keyframes sidein { from { opacity: 0; transform: translateX(var(--slide)); } to { opacity: 1; transform: none; } }
/* 侧栏开着、屏幕够宽：内容让出 400（贴屏幕的导航、提示跟着让） */
@media (min-width: 1240px) {
  .side-push body { padding-right: var(--panel-w); }
  .side-push .tabbar-fixed { right: var(--panel-w); }
  .side-push .toast { left: calc((100% - var(--panel-w)) / 2); }
}
/* 手机上面板、小卡开着：后面的页面不跟着滚 */
.sheet-lock { overflow: hidden; }

@media (hover: hover) and (pointer: fine) {
  .ask-entry:hover, .ask-btn:hover { background: var(--accent-soft); }
  .pill-btn:not([aria-disabled="true"]):hover, .scene-card:not(.is-locked):hover { border-color: var(--accent); }
  .say-btn:hover, .send-btn:not([aria-disabled="true"]):hover { background: var(--accent-press); }
  .snd-word:not([aria-disabled="true"]):hover .word-play, .snd-all:hover .say-btn { background: var(--accent-press); }
  .seg-switch > :is(a, button):not([aria-current="page"]):not([aria-selected="true"]):hover { color: var(--text); }
  .lucas-close:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-sheet[open], .lucas-panel[open] { animation-name: fadeonly; }
}

/* ============ 练一练（10/15；docs/练一练技术设计.md 第 7 节）============
   听力专题的选档、听力卡的放音键和「慢一点」。别的都用现成的：分页是 .seg-switch，做题页就是测验页（.quiz-options、.qdeck） */
/* 选档：一档一张单选卡（链接，role="radio"，不靠脚本也能换），上面「第 n 档」，下面一句说明，右边勾；
   选中照感受题的选项：淡绿底、深绿边、勾（不放大：一档一整行，放大会碰到旁边）。宽了两张一行，字大、屏幕窄一行一张 */
.drill-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr)); gap: 10px; }
.drill-tier { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-3); row-gap: 2px;
  min-height: 64px; padding: 10px 14px 10px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  text-align: left; text-decoration: none; transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-select) ease, border-color var(--dur-select) ease; }
.drill-tier-n { grid-column: 1; font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.drill-tier-text { grid-column: 1; font-size: var(--fs-sm); color: var(--text-2); line-height: var(--lh-tight); }
.drill-tier .opt-mark { grid-column: 2; grid-row: 1 / span 2; }
.drill-tier[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.drill-tier[aria-checked="true"] .drill-tier-text { color: var(--accent-text); }
.drill-tier[aria-checked="true"] .opt-mark::before, .drill-tier[aria-checked="true"] .opt-mark svg { opacity: 1; transform: none; }
/* 听力卡：不印英文题干，一个大的圆放音键（点了才放、能反复放；正在放的那一下键底深一点、外面一圈淡绿，不闪、不转），
   第 1、2 档旁边「慢一点」开关（role="switch"：左边一个小拨杆，开了深绿、拨到右边）。字大了、屏幕窄，开关折到放音键下面 */
.listen-play { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
.listen-btn { position: relative; flex: none; width: 72px; height: 72px; min-height: 0; padding: 0; border: 0; border-radius: var(--r-round);
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-inset); transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-select) ease; }
.listen-btn .ic { width: 32px; height: 32px; fill: currentColor; stroke: none; }
.listen-btn.is-playing { background: var(--accent-press); box-shadow: 0 0 0 5px var(--accent-soft); }
.listen-slow { position: relative; gap: var(--sp-2); padding: 0 var(--sp-3); color: var(--text); }
.listen-slow::before { content: ""; flex: none; width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--text-2); transition: background-color var(--dur-select) ease; }
.listen-slow::after { content: ""; position: absolute; left: calc(var(--sp-3) + 3px); top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: var(--r-round);
  background: var(--surface); transition: transform var(--dur-select) var(--ease-out); }
.listen-slow[aria-checked="true"] { color: var(--accent-text); font-weight: var(--fw-semibold); }
.listen-slow[aria-checked="true"]::before { background: var(--accent); }
.listen-slow[aria-checked="true"]::after { transform: translateX(16px); }
/* 放不出来：卡上一句（陶土色，不用红），不卡住，选项照样能点 */
.listen-fail { margin-top: var(--sp-2); color: var(--note); }
/* 六档（11/4 听写）：电脑上两列三行（一栏 760 宽，三列放不下说明那句） */
@media (min-width: 900px) {
  .drill-tiers { grid-template-columns: 1fr 1fr; }
}
/* 第 5、6 档「哪一周」（docs/听写技术设计.md 4.2）：一组单选胶囊（链接，role="radio"，不靠脚本也能换），第一个「全部混搭」，
   然后「第 7 周」……；选中照选档：淡绿底、深绿边、勾。放不下就折行，不横滚 */
.drill-weeks-label { margin-bottom: var(--sp-2); }
.drill-weeks { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.drill-week { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 12px 0 16px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: var(--fs-body); line-height: var(--lh-tight); text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-select) ease, border-color var(--dur-select) ease; }
.drill-week[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.drill-week[aria-checked="true"] .opt-mark::before, .drill-week[aria-checked="true"] .opt-mark svg { opacity: 1; transform: none; }
/* 听写卡（第 1、2 档打一个词，第 5、6 档打一句话）：不给首字母、不透露有几个字母；句子框能折行，宽度拉满卡片（不按句子长短定宽），
   打多了自己长高（不支持 field-sizing 的浏览器 components.js 帮它长）；回车就是「对答案」，不换行 */
textarea.input.quiz-dict-text { min-height: calc(2 * 1.4em + 23px); resize: none; field-sizing: content; }
/* 揭晓：「你打的」那一行打错的、多打的词陶土色 + 删除线（读屏「这个词不对」）；「听到的是」那一行她漏掉、打错的词加下划线（读屏「这里不一样」）。
   不写「错」、不打叉；一个词一个 span，只在词和词之间折（一截长得一行都放不下才从中间折，免得伸出卡片） */
.dict-row { margin-top: var(--sp-2); }
.dict-row .mistake-label { display: block; }
/* 中译英卡揭晓里的「听一遍」「我写的意思也对」（11/13）：放不下就整个按钮换行，按钮里的字不折 */
.zh2en-after { flex-wrap: wrap; margin-top: var(--sp-3); }
.zh2en-after .btn { white-space: nowrap; }
.zh2en-after .lucas-avatar { margin-right: 6px; }
/* 11/25 规划第 3、6 条：「再试一次」的那一句提示、判错卡上相关的常见问题（最多两条，一条一行） */
.zh2en-retry-note { margin-top: var(--sp-2); }
.zh2en-faq { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
/* 中译英「补一个小词」：大字（中文）下面一行英文，空着的那个词是一条下划线（.quiz-blank）；放不下就折 */
.zh2en-fill { margin-top: var(--sp-3); font-size: var(--fs-en-sm); line-height: 1.4; }
/* 中译英「排一排」：上面一行是排好的词（浅底虚线框），下面是词块（描边胶囊）；点过的块变浅、点不了。字照英文学习内容的下限（--fs-en-sm） */
.order { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.order-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-2); min-height: 64px; margin: 0; padding: var(--sp-2) var(--sp-3);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-sunk); font-family: var(--font-en); font-size: var(--fs-en-sm); line-height: 1.3; }
.order-empty { color: var(--text-2); font-family: var(--font-ui); font-size: var(--fs-sm); }
.order-tiles { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.order-tile { min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-family: var(--font-en); font-size: var(--fs-en-sm); line-height: 1;
  transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-select) ease, border-color var(--dur-select) ease; }
.order-tile:active:not([aria-disabled="true"]) { transform: scale(.96); }
.order-tile.is-used { opacity: .35; }
.order-tile[aria-disabled="true"] { cursor: default; }
@media (hover: hover) and (pointer: fine) { .order-tile:not([aria-disabled="true"]):hover { border-color: var(--accent); } }
.dict-words { font-family: var(--font-en); font-size: var(--fs-en-sm); line-height: 1.4; overflow-wrap: break-word; word-break: normal; }
.dict-off { color: var(--note); text-decoration: line-through; text-decoration-thickness: 2px; }
.dict-miss { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.dict-zh { margin-top: var(--sp-1); }
@media (hover: hover) and (pointer: fine) {
  .drill-tier:hover, .drill-week:hover { border-color: var(--accent); }
  .listen-btn:hover { background: var(--accent-press); }
}
@media (prefers-reduced-motion: reduce) {
  .listen-slow::after { transition: none; }
}

/* ============ 惊喜时刻（只有这里用 --pop-* 亮色） ============ */
/* 1 交练习页：勾画出来 + 一小阵撒花（不超过 1.2 秒）+「交给晓巍了」 */
.cel-submit { position: relative; display: grid; justify-items: center; gap: 10px; padding: var(--sp-6) 0 var(--sp-2); }
.big-tick { position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: var(--r-round); overflow: hidden;
  background: var(--pop-tick-bg); color: var(--pop-tick-ink); opacity: 0; transform: scale(.5); }
.big-tick svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.big-tick .tick-cover { background: var(--pop-tick-bg); }
.cel-text { font-size: var(--fs-lg); font-weight: var(--fw-semibold); opacity: 0; transform: translateY(var(--rise)); }
.cel-submit.go .big-tick { animation: popin var(--dur-pop) var(--ease-spring) both; }
.cel-submit.go .big-tick .tick-cover { animation: uncover 360ms var(--ease-in-out) 200ms both; }
.cel-submit.go .cel-text { animation: rise var(--dur-enter) var(--ease-out) 320ms both; }
@keyframes popin { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes uncover { from { transform: translateX(0); } to { transform: translateX(105%); } }
/* 撒花：JS 生成十几片，每片用 --dx --dy --rot --d --c 定方向、颜色和先后 */
.burst { position: absolute; left: 50%; top: 62px; z-index: var(--z-celebrate); width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -4px; top: -6px; width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0; }
.burst i:nth-child(3n) { width: 9px; height: 9px; border-radius: 50%; }
.burst.go i { animation: confetti calc(var(--dur-celebrate) * .75) var(--ease-out) var(--d) both; }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(.6); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}

/* 2 连续上课 7 / 14 / 30 天：小标亮一下（一道光扫过 + 弹一下），下面浮出一句话（浮在上面，不占地方） */
.streak-anchor { position: relative; display: inline-flex; }
.streak::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 50%; background: linear-gradient(100deg, transparent, var(--pop-glint), transparent);
  opacity: 0; pointer-events: none; }
.streak::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--pop-yellow); opacity: 0; pointer-events: none; }
.streak > * { position: relative; }
.streak.is-celebrating { animation: badgepop 520ms var(--ease-spring); }
.streak.is-celebrating::before { animation: badgeflash 1000ms ease-out; }
.streak.is-celebrating::after { animation: glint 900ms ease-out 120ms; }
@keyframes badgepop { 0% { transform: scale(1); } 40% { transform: scale(var(--pop-scale)); } 100% { transform: scale(1); } }
@keyframes badgeflash { 0% { opacity: 0; } 25% { opacity: .55; } 100% { opacity: 0; } }
@keyframes glint { 0% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(380%); } }
.cheer { position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-celebrate); width: max-content; max-width: min(18em, calc(100vw - 32px));
  padding: 10px 16px; border-radius: var(--r-btn); background: var(--pop-soft); color: var(--pop-text); font-size: var(--fs-body); box-shadow: var(--shadow-raise);
  opacity: 0; transform: translateY(calc(var(--rise) * -.6)); pointer-events: none; transition: opacity var(--dur-base) ease, transform 280ms var(--ease-out); }
.cheer.is-shown { opacity: 1; transform: none; }

/* 3 测验满分：分数滚上来 + 几颗亮色小星星 + 「全对」 */
.cel-score { position: relative; display: grid; justify-items: center; gap: 4px; padding: var(--sp-5) 0 var(--sp-2); }
.score { font-family: var(--font-num); font-size: var(--fs-num-xl); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.score small { font-size: var(--fs-lg); color: var(--text-2); }
.full-mark { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--pop-soft); color: var(--pop-text);
  font-weight: var(--fw-semibold); opacity: 0; transform: scale(.6); }
.full-mark .ic { width: 18px; height: 18px; fill: var(--pop-yellow); stroke: var(--pop-text); stroke-width: 1.4; }
.cel-score.go .full-mark { animation: popin var(--dur-pop) var(--ease-spring) 520ms both; }
/* 交了以后再打开：分数、「全对」直接显示，不滚、不放星星（惊喜只放一次） */
.cel-score.is-shown .full-mark { opacity: 1; transform: none; }
.stars { position: absolute; left: 50%; top: 46px; z-index: var(--z-celebrate); width: 0; height: 0; pointer-events: none; }
.stars i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: 0; }
.cel-score.go .stars i { animation: confetti 800ms var(--ease-out) var(--d) both; }

/* 4 错题回顾「我记住了」：卡片翻过去。她的错是学习材料：「你写的」→「这样写更对」，不打叉、不用红 */
.flip { perspective: 1000px; }
.flip-inner { display: grid; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: transform var(--dur-flip) var(--ease-in-out); }
.flip-face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); display: grid; place-items: center; align-content: center; gap: 6px; text-align: center;
  background: var(--pop-soft); color: var(--pop-text); border-color: transparent; }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
/* 只有朝向她的那一面接点按（减弱动态时背面只是透明，不能挡住「我记住了」） */
.flip-back, .flip.is-flipped .flip-front { pointer-events: none; }
.flip.is-flipped .flip-back { pointer-events: auto; }
.flip-back .tick { width: 44px; height: 44px; background: var(--pop-tick-bg); color: var(--pop-tick-ink); }
.flip-back .tick svg { width: 26px; height: 26px; }
.flip-back-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.mistake-label { font-size: var(--fs-sm); color: var(--text-2); }
.mistake-wrote { font-family: var(--font-en); font-size: var(--fs-en-sm); color: var(--text-2); }   /* 她写的那一版：小一号、灰 */
.mistake-right { font-family: var(--font-en); font-size: var(--fs-en); color: var(--accent-text); }
/* 练一练「写错过的」分页（M7，docs/M7技术设计.md 3.1、3.2）：一周一块（details，最新的一周展开），卡手机一列、电脑两列；
   夹在中文里的英文、长句子在卡里折（一个词比一行还长才从中间折）；背面多一行对的写法（收着的「记住了的」里点开看得出是哪个词），颜色跟背面走 */
.mistakes-tab { display: grid; gap: var(--sp-3); }
.mistake-week > summary, .mistake-done > summary { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); cursor: pointer; list-style: none;
  border-radius: var(--r-sm); -webkit-tap-highlight-color: transparent; }
.mistake-week > summary::-webkit-details-marker, .mistake-done > summary::-webkit-details-marker { display: none; }
.mistake-week > summary::before, .mistake-done > summary::before { content: ""; flex: none; width: .5em; height: .5em; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform var(--dur-base) var(--ease-out); }
.mistake-week[open] > summary::before, .mistake-done[open] > summary::before { transform: rotate(45deg); }
.mistake-week > summary:focus-visible, .mistake-done > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mistake-week > summary { color: var(--text); }
.mistake-done { margin-top: var(--sp-3); }
.mistake-done > summary { color: var(--accent-text); font-weight: var(--fw-semibold); }
.mistake { min-width: 0; }
.mistake-text { overflow-wrap: anywhere; }
.mistake-see { margin-top: var(--sp-2); overflow-wrap: anywhere; }
.mistake-say { margin-top: var(--sp-3); }
.flip-back .mistake-back { max-width: 100%; font-size: var(--fs-en-sm); color: inherit; }
.flip-back .mistake-back.fb-zh { font-size: var(--fs-lg); }
@media (min-width: 900px) {
  .mistakes { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (hover: hover) and (pointer: fine) {
  .mistake-week > summary:hover, .mistake-done > summary:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) {   /* 减弱动态效果：小箭头直接换方向，不转（照讲义的 .x-slow） */
  .mistake-week > summary::before, .mistake-done > summary::before { transition: none; }
}

/* 5 进步页第一次打开：曲线从左往右画出来（一块和卡片同色的遮片往右移开，只动 transform）。
   默认是盖着的；第一次打开加 go 画出来；以后再打开加 is-drawn 直接显示。 */
.curve { position: relative; overflow: hidden; }
.curve svg { display: block; width: 100%; height: auto; }
.curve-line { fill: none; stroke: var(--pop-teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.curve-area { fill: var(--pop-teal); opacity: .14; }
.curve-axis { stroke: var(--line); stroke-width: 1; }
.curve-dot { fill: var(--pop-coral); stroke: var(--surface); stroke-width: 3; }
.curve-cover { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--surface); }
.curve.go .curve-cover { animation: reveal var(--dur-reveal) var(--ease-in-out) both; }
@keyframes reveal { from { transform: translateX(0); } to { transform: translateX(101%); } }
.curve-end { position: absolute; right: 12%; top: 0; padding: 2px 10px; border-radius: var(--r-pill); background: var(--pop-soft); color: var(--pop-text);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: 0; }
.curve.go .curve-end { animation: popin 360ms var(--ease-spring) 800ms both; }
.curve.is-drawn .curve-cover { display: none; }
.curve.is-drawn .curve-end { opacity: 1; }
.curve-labels { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-2); margin-top: 4px; }

/* ---------- 减弱动态效果：撒花、星星、翻卡、扫光、弹簧整段不放，只留淡入淡出 ---------- */
@media (prefers-reduced-motion: reduce) {
  .burst, .stars { display: none; }
  .tick-anim, .is-done .tick-anim { transform: none; transition: opacity var(--dur-base) ease; }
  .tick-cover, .is-done .tick-anim .tick-cover { transition: none; opacity: 0; }
  .big-tick, .full-mark { transform: none; }
  .cel-submit.go .big-tick, .cel-score.go .full-mark, .curve.go .curve-end { animation-name: fadeonly; }
  .cel-submit.go .big-tick .tick-cover { animation: none; opacity: 0; }
  .opt-mark::before, .opt-mark svg, .option[aria-checked="true"] .opt-mark::before, .option[aria-checked="true"] .opt-mark svg,
  .quiz-options .option .opt-mark::before, .quiz-options .option .opt-mark svg { transform: none; transition: opacity var(--dur-select) ease; }
  .streak.is-celebrating, .streak.is-celebrating::after { animation: none; }
  .tabbar > .bounce .ic { animation: none; }
  .tabbar > :is(a, button)::before, .bar i, .rec-limit i { transition: none; }
  .flip-inner { transition: none; transform: none !important; }
  .flip-back { transform: none; opacity: 0; transition: opacity var(--dur-base) ease; }
  .flip-front { transition: opacity var(--dur-base) ease; }
  .flip.is-flipped .flip-back { opacity: 1; }
  .flip.is-flipped .flip-front { opacity: 0; }
  .curve.go .curve-cover { animation-name: fadeout; }
  .enter-next, .enter-prev { animation-name: fadeonly; }
  .qdeck > [data-q] { transition: opacity var(--dur-base) ease; }
}
@keyframes fadeonly { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
