/* 设计：练习本的纸色 + 钢笔蓝 + 老师批改用的红笔。单列手机布局，底部标签栏，听写时全屏。 */
:root {
  --paper: #f4f6f1;      /* 背景：护眼练习本纸 */
  --sheet: #ffffff;      /* 卡片 */
  --ink: #1e2935;        /* 正文 */
  --ink-2: #5f6b77;      /* 次要文字 */
  --line: #dde3da;       /* 分隔线 */
  --blue: #2451c6;       /* 钢笔蓝：主色 */
  --blue-ink: #ffffff;
  --blue-wash: #e7edfb;
  --red: #d6332c;        /* 红笔：批改 */
  --red-wash: #fcebe9;
  --amber: #a66300;
  --amber-wash: #fdf1dc;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-en: "Avenir Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shade: rgba(10, 16, 28, .45);
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11161b; --sheet: #1a2027; --ink: #e5eaef; --ink-2: #9ba6b1; --line: #2a323a;
    --blue: #7f9fff; --blue-ink: #0d1526; --blue-wash: #1d2944;
    --red: #ff6f66; --red-wash: #3b1f1d; --amber: #f1b452; --amber-wash: #352a14;
    --shade: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11161b; --sheet: #1a2027; --ink: #e5eaef; --ink-2: #9ba6b1; --line: #2a323a;
  --blue: #7f9fff; --blue-ink: #0d1526; --blue-wash: #1d2944;
  --red: #ff6f66; --red-wash: #3b1f1d; --amber: #f1b452; --amber-wash: #352a14;
  --shade: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body.ov-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
h2, h3, p { margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.en { font-family: var(--font-en); }
.center { display: block; margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- 顶栏 / 底栏 ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper);
  padding-block: 14px 6px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-in { max-width: 600px; margin: 0 auto; display: flex; align-items: baseline; gap: 10px; }
.topbar h1 { font-size: 24px; font-weight: 700; margin: 0; }
#pageSub { font-size: 13px; color: var(--ink-2); }
main {
  max-width: 600px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; background: var(--sheet); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar button {
  flex: 1; max-width: 150px; position: relative; border: 0; background: none;
  padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; color: var(--ink-2);
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--blue); font-weight: 600; }
.badge {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; font-weight: 600;
}

/* ---------- 卡片与按钮 ---------- */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card > h2, .card-h h2 { font-size: 17px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-h .muted { font-size: 13px; }
.group-label { font-size: 13px; color: var(--ink-2); margin: 12px 0 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 12px 0; border-radius: 12px; background: var(--amber-wash); color: var(--amber); font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink);
  font-size: 16px; font-weight: 600; transition: transform .1s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 14px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; width: 100%; }
.btn-row .btn { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: transparent; color: var(--ink);
  display: inline-grid; place-items: center;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm { width: 34px; height: 34px; color: var(--ink-2); }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn.say { color: var(--blue); }
.icon-btn.lg { width: 58px; height: 58px; background: var(--sheet); border: 1px solid var(--line); }
.icon-btn.lg svg { width: 26px; height: 26px; }
.icon-btn.xl { width: 80px; height: 80px; }
.icon-btn.xl svg { width: 34px; height: 34px; }
.icon-btn.primary { background: var(--blue); color: var(--blue-ink); }
.icon-btn:active { transform: scale(.94); }
.link { border: 0; background: none; color: var(--blue); padding: 10px 4px; font-size: 15px; }
.link.danger { color: var(--red); }

/* ---------- 首页 ---------- */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 12px; text-align: left;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet);
}
.chip b { font-size: 16px; }
.chip small { font-size: 12px; color: var(--ink-2); }
.chip.on { border-color: var(--blue); background: var(--blue-wash); }
.chip.on b, .chip.on small { color: var(--blue); }

.rounds { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.round { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.round:first-child { border-top: 0; }
.round-no {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums;
}
.round-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.round-t b { font-size: 15px; }
.round-t small { font-size: 13px; color: var(--ink-2); }
.round.off .round-no { background: var(--paper); color: var(--ink-2); }
.round.off .round-t b { color: var(--ink-2); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.tag.amber { background: var(--amber-wash); color: var(--amber); }
.tag.red { background: var(--red-wash); color: var(--red); }

.switch { width: 50px; height: 30px; flex: none; position: relative; border: 0; border-radius: 15px; background: var(--line); transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--blue); }
.switch.on i { transform: translateX(20px); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.stats div { display: flex; flex-direction: column; padding: 12px 8px; border-radius: 12px; background: var(--paper); }
.stats b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--ink-2); }
.recent { list-style: none; margin: 8px 0 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.recent li:first-child { border-top: 0; }
.recent b { font-variant-numeric: tabular-nums; color: var(--red); }
.install { background: var(--blue-wash); border-color: transparent; }
.install h2 { color: var(--blue); }
.install p { margin-top: 6px; font-size: 14px; }
.install .btn { margin-top: 10px; }

/* ---------- 列表 ---------- */
.word-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.word-row:first-child { border-top: 0; }
.word-row .w { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.word-row .w b { font-size: 17px; font-family: var(--font-en); word-break: break-word; }
.word-row .w span { font-size: 13px; color: var(--ink-2); }
.word-row .w s { font-size: 13px; color: var(--red); }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.empty p { font-size: 18px; color: var(--ink); margin: 12px 0 4px; }
.empty .pen { width: 64px; height: 64px; }
.foot { text-align: center; color: var(--ink-2); font-size: 12px; margin: 20px 0; }

/* ---------- 设置 ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card > h2 + .row { border-top: 0; }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row small { font-size: 13px; color: var(--ink-2); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--paper); flex: none; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--sheet); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.row.col .seg { display: flex; }
.row.col .seg button { flex: 1; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 14px; color: var(--ink-2); }
.fld input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--sheet); color: var(--ink); font: inherit; font-size: 16px; outline: none;
}
.fld input:focus { border-color: var(--blue); }
.pwd { display: flex; gap: 6px; }
.pwd input { flex: 1; min-width: 0; }
.ai-status { font-size: 14px; }
.ai-status.ok { color: var(--blue); }
.ai-status.bad { color: var(--red); }
.btn-pair { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-pair .btn { flex: 1; }

/* ---------- 全屏层 ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 30; background: var(--paper);
  overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column;
}
.ov-top {
  position: sticky; top: 0; z-index: 2; background: var(--paper); width: 100%; max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
}
.ov-title { flex: 1; font-size: 18px; text-align: center; }
.ov-spacer { width: 40px; flex: none; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--blue); transition: width .3s; }
.cnt { min-width: 64px; text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ov-body {
  width: 100%; max-width: 560px; margin: 0 auto; padding-top: 4px; padding-bottom: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.ov-bottom {
  position: sticky; bottom: 0; width: 100%; max-width: 560px; margin: auto auto 0;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(rgba(0,0,0,0), var(--paper) 26%);
}
.lead { font-size: 15px; margin: 4px 0 14px; }

/* 听写进行中 */
.dict { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.dict-round { font-size: 15px; color: var(--ink-2); min-height: 22px; }
.intro { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding-top: 12px; }
.intro-no { font-size: 44px; font-weight: 800; color: var(--blue); letter-spacing: 2px; }
.intro-t { font-size: 22px; font-weight: 700; }
.intro-meta { font-size: 14px; color: var(--ink-2); }
.intro-tip { font-size: 14px; color: var(--ink-2); padding: 10px 14px; border-radius: 10px; background: var(--sheet); border: 1px dashed var(--line); margin-top: 6px; }
.intro-count { font-size: 15px; color: var(--blue); font-weight: 600; min-height: 24px; font-variant-numeric: tabular-nums; }
.intro .btn-row { max-width: 360px; margin-top: 6px; }
.play { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.ring {
  --p: 1; position: relative; width: 210px; height: 210px; border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--line) 0); display: grid; place-items: center;
}
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--sheet); }
.ring.paused { background: var(--line); }
.ring-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ring-no { display: flex; align-items: baseline; gap: 4px; color: var(--ink-2); }
.ring-no b { font-size: 64px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
#pState { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ring.reading #pState { color: var(--blue); font-weight: 600; animation: pulse 1.1s ease-in-out infinite; }
.ctrls { display: flex; align-items: center; gap: 24px; }
.play .btn-row { max-width: 380px; }
.peek { font-size: 20px; font-weight: 600; padding: 10px 16px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--line); max-width: 100%; }

/* 拍照 */
.upload {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px;
  border: 2px dashed var(--blue); border-radius: 16px; background: var(--blue-wash); color: var(--blue); cursor: pointer; text-align: center;
}
.upload svg { width: 40px; height: 40px; }
.upload b { font-size: 17px; }
.upload small { font-size: 13px; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--sheet); aspect-ratio: 3 / 4; max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.thumb button svg { width: 16px; height: 16px; }
.err { color: var(--red); font-size: 14px; margin-top: 12px; }
.ai-box { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line); display: grid; gap: 12px; }
.ai-box h3 { font-size: 16px; }

/* 批改中 */
.grading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 70px; }
.grading .pen-spin { width: 72px; height: 72px; color: var(--red); animation: wiggle 1.2s ease-in-out infinite; }
.grading b { font-size: 20px; }

/* 结果 */
.score-box { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 4px; }
.score { position: relative; font-family: var(--font-en); font-size: 76px; font-weight: 700; line-height: 1; color: var(--red); transform: rotate(-4deg); font-variant-numeric: tabular-nums; }
.score small { font-size: 24px; margin-left: 2px; }
.score-line { width: 140px; height: 20px; color: var(--red); margin-top: -4px; }
.score-sub { font-size: 16px; }
.summary { margin: 10px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--sheet); border-left: 4px solid var(--red); font-size: 15px; }
.rres { margin-top: 18px; }
.rres h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.rres h3 em { font-style: normal; color: var(--red); font-variant-numeric: tabular-nums; font-weight: 700; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet);
}
.res-no { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.res-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.res-main b { font-size: 18px; word-break: break-word; }
.res-main small { font-size: 13px; color: var(--ink-2); }
.res-w { font-size: 14px; }
.res-c { font-size: 13px; color: var(--amber); }
.res.bad { border-color: var(--red); background: var(--red-wash); }
.res.bad .res-w { color: var(--red); }
.mark { width: 34px; height: 34px; flex: none; color: var(--red); }
.pen { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.mark .pen { width: 34px; height: 34px; }
.photos-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.photos-mini img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); max-width: 100%; }

/* 首页提示 */
.hint { text-align: center; font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.zh-btn { font-size: 14px; font-weight: 600; }

/* 拍照完成 */
.done-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; color: var(--red); }
.done-head .pen { width: 34px; height: 34px; }
.done-head b { font-size: 20px; color: var(--ink); }

/* 记录 */
.rec { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; }
.rec-thumb {
  width: 64px; height: 80px; flex: none; border-radius: 10px; overflow: hidden; background: var(--paper);
  display: grid; place-items: center; color: var(--ink-2);
}
.rec-thumb svg { width: 26px; height: 26px; }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rec-main b { font-size: 16px; }
.rec-main small { font-size: 13px; color: var(--ink-2); }
.rec-chev { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.rec-photos { display: grid; gap: 10px; margin: 12px 0; }
.rec-photos img { width: 100%; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.rec-ph-ph { padding: 40px 12px; text-align: center; border-radius: 12px; background: var(--sheet); border: 1px dashed var(--line); color: var(--ink-2); font-size: 14px; }
.key-list { margin: 8px 0 0; padding-left: 26px; display: grid; gap: 6px; }
.key-list li { padding-left: 2px; }
.key-list li::marker { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.key-list b { display: block; font-size: 17px; }
.key-list small { font-size: 13px; color: var(--ink-2); }
.ov-body > .btn.block { margin-top: 16px; }

/* 听写范围 */
.range-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.range-line span { font-size: 14px; color: var(--ink-2); }
.range-line b { font-size: 18px; color: var(--blue); }
.sum-line { font-size: 15px; color: var(--blue); }

/* 听写前的要求 */
.rules { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; text-align: left; padding-top: 8px; }
.rules h2 { font-size: 22px; text-align: center; }
.rule-list { margin: 0; padding: 14px 14px 14px 36px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line); display: grid; gap: 10px; font-size: 16px; }
.rule-list li::marker { color: var(--blue); font-weight: 700; }
.rule-code { color: var(--red); font-size: 20px; letter-spacing: 3px; font-variant-numeric: tabular-nums; }

/* 选页码 */
.page-pick { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.page-pick .fld { flex: 1; min-width: 80px; }
.page-pick input { font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.page-dash { padding-bottom: 12px; color: var(--ink-2); white-space: nowrap; }

/* 按单元选 */
.unit-list { display: grid; gap: 8px; }
.unit-btn {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px;
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet); text-align: left;
}
.unit-btn b { font-size: 17px; white-space: nowrap; }
.unit-btn span { min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-btn small { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.unit-btn.on { border-color: var(--blue); background: var(--blue-wash); }
.unit-btn.on b, .unit-btn.on span, .unit-btn.on small { color: var(--blue); }

/* 分数 */
.score-badge { flex: none; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-badge.done { background: var(--red-wash); color: var(--red); font-size: 16px; }
.latest .btn { margin-top: 10px; }
.wait-tip { margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: var(--sheet); border: 1px dashed var(--line); color: var(--ink-2); font-size: 14px; }
.res-box { margin: 10px 0 6px; text-align: left; }
.res-score { font-family: var(--font-en); font-size: 64px; font-weight: 700; color: var(--red); line-height: 1; text-align: center; transform: rotate(-4deg); font-variant-numeric: tabular-nums; }
.res-score small { font-size: 22px; margin-left: 2px; }
.res-box .score-sub { text-align: center; margin-top: 6px; }
.res-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet); }
.res-row.bad { border-color: var(--red); background: var(--red-wash); }
.res-row .res-main small { display: block; }
.small-tip { font-size: 13px; color: var(--ink-2); margin-top: -6px; }

/* 本次编号 */
.code-box { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 22px; border-radius: 14px; border: 2px solid var(--red); background: var(--sheet); }
.code-box span { font-size: 13px; color: var(--ink-2); }
.code-box b { font-size: 34px; letter-spacing: 6px; color: var(--red); font-variant-numeric: tabular-nums; line-height: 1.2; }
.code-box small { font-size: 12px; color: var(--ink-2); }

/* 完成 */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 16px; }
.done-big { width: 84px; height: 84px; color: var(--red); }
.done-big .pen { width: 84px; height: 84px; }
.done-t { font-size: 24px; font-weight: 700; }
.send-tip { margin-top: 6px; padding: 8px 14px; border-radius: 10px; background: var(--blue-wash); color: var(--blue); font-weight: 600; font-size: 15px; }
.done-photos { display: grid; gap: 10px; width: 100%; margin-top: 12px; }
.done-photos img { width: 100%; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }

/* 每日阅读 */
.read-list { list-style: none; margin: 10px 0 0; padding: 0; }
.read-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.read-list li:first-child { border-top: 0; }
.read-list div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.read-list b { font-family: var(--font-en); font-size: 16px; }
.read-list small { font-size: 12px; color: var(--ink-2); }
.read-k {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue); font-weight: 700; font-family: var(--font-en);
}
.rec-thumb.rec-read { height: 64px; width: 56px; background: var(--blue-wash); color: var(--blue); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.rec-read small { font-size: 11px; font-weight: 600; }
/* 首页三步 */
.range-line.top { margin: 4px 2px 0; padding: 4px 0 0; border-bottom: 0; }
.step { padding: 14px 16px 16px; }
.step-h { display: flex; align-items: center; gap: 10px; }
.step-h h2 { flex: 1; font-size: 18px; }
.step-no {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums;
}
.step-no.ok { background: var(--blue); color: var(--blue-ink); }
.step-sub { font-size: 14px; color: var(--ink-2); margin: 8px 0 12px; }
.step .read-list { margin: 0 0 12px; }
.step-link { display: block; margin: 6px auto -6px; font-size: 14px; }
/* 短对话 */
.talk { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper); font-family: var(--font-en); }
.talk p { margin: 0 0 4px; font-size: 17px; line-height: 1.55; }
.talk p:last-child { margin-bottom: 0; }
.talk .sp { color: var(--blue); }
.talk.sm { display: block; margin: 0 0 6px; padding: 6px 8px; background: var(--sheet); }
.talk.sm p { font-size: 14px; }
.say-btn.sm { padding: 3px 10px; font-size: 13px; }
.qcard .listen-box { margin: 4px 0 12px; }
/* 单项选择 */
.q-t.mq { font-size: 18px; line-height: 1.6; font-weight: 500; }
.gap { display: inline-block; min-width: 3.2em; border-bottom: 2px solid var(--ink); margin: 0 3px; vertical-align: -2px; height: 1em; }
.fill { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 0 2px; }
/* 完形填空 */
.psg-text.cloze p { line-height: 2.1; }
.kb {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 0 6px; margin: 0 2px; border: 0; border-radius: 8px;
  background: var(--paper); color: var(--blue); font: inherit; font-weight: 600; line-height: 1.6;
}
.kb i { font-style: normal; font-size: 11px; color: var(--ink-2); font-family: var(--font); }
.kb .gap { min-width: 2.6em; border-bottom-color: var(--ink-2); }
.kb.cur { background: var(--blue); color: var(--blue-ink); }
.kb.cur i { color: var(--blue-ink); }
.kb.cur .gap { border-bottom-color: var(--blue-ink); }
.kb.ok { background: var(--blue-wash); color: var(--blue); }
.kb.bad { background: var(--red-wash); color: var(--red); }
.kb.bad s { color: var(--ink-2); font-weight: 400; }
.k-bar { background: var(--paper); border-top: 1px solid var(--line); padding-top: 10px; }
.k-q .qcard-h { margin-bottom: 8px; }
.opts.grid2 { grid-template-columns: 1fr 1fr; }
.opts.grid2 .opt { min-height: 44px; padding: 8px 10px; }
.spk { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 2px; flex-wrap: wrap; }
.spk span { padding: 3px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink-2); font-family: var(--font-en); font-weight: 600; transition: background .2s, color .2s; }
.spk span.on { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.spk i { font-style: normal; font-size: 13px; color: var(--ink-2); }
.qcard-h { align-items: center; }
.score-badge.go { background: var(--blue); color: var(--blue-ink); font-weight: 600; }
.psg-k { font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.psg { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.psg-t { font-family: var(--font-en); font-size: 19px; margin-bottom: 8px; }
.psg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.psg-h .psg-t { margin: 0; min-width: 0; }
.say-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid var(--blue); background: var(--blue-wash); color: var(--blue); font-family: var(--font); font-size: 14px; font-weight: 600;
}
.say-btn svg { width: 16px; height: 16px; }
.say-btn.on { background: var(--blue); color: var(--blue-ink); }
.listen-box {
  margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; text-align: center;
  border-radius: var(--radius); border: 1.5px dashed var(--blue); background: var(--blue-wash); color: var(--blue);
}
.listen-box svg { width: 30px; height: 30px; }
.listen-box.on svg { animation: pulse 1.1s ease-in-out infinite; }
.listen-box small { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.qcard { margin-top: 14px; padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--blue); background: var(--sheet); }
.qcard-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.qcard .link { padding: 10px 0 0; font-size: 15px; }
.q-done { border-color: var(--line); }
.q-done p { margin-top: 4px; }
.link.inline { padding: 0 2px; font-size: inherit; }
.psg-text { font-family: var(--font-en); }
.psg-text p { margin: 0 0 8px; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
.psg-text p:last-child { margin-bottom: 0; }
.psg-text .sp { color: var(--blue); }
.tbl { max-width: 100%; overflow-x: auto; margin: 4px 0 10px; }
.psg-table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.psg-table th, .psg-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.psg-table th { background: var(--paper); }
.gloss { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.gloss-l { color: var(--amber); font-weight: 600; }
.gloss b { font-family: var(--font-en); color: var(--ink); font-weight: 600; }
.qs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 20px; }
.q-t { font-family: var(--font-en); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.q-no { color: var(--blue); margin-right: 6px; font-variant-numeric: tabular-nums; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 12px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet); text-align: left; font-size: 16px; font-family: var(--font-en);
}
.opt-k { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.opt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt.on { border-color: var(--blue); background: var(--blue-wash); }
.opt.on .opt-k { background: var(--blue); color: var(--blue-ink); }
.psg-fold { margin: 0 0 10px; }
.psg-fold summary { cursor: pointer; color: var(--blue); font-size: 14px; padding: 4px 0 8px; }
.res-q b { font-family: var(--font-en); font-size: 15px; }
.res-main small.res-ok { color: var(--blue); }

/* 确认框 */
.dlg-wrap {
  position: fixed; inset: 0; z-index: 70; background: var(--shade); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.dlg { width: 100%; max-width: 340px; background: var(--sheet); border-radius: 16px; padding: 20px 16px 16px; display: grid; gap: 18px; }
.dlg p { font-size: 17px; text-align: center; }
.danger-btn { background: var(--red); border-color: var(--red); color: #fff; }

/* 提示条 */
#toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: rgba(20,24,34,.92); color: #fff;
  font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 拍照发新知识 */
.thumbs:empty { display: none; }
.k-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.k-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--sheet); }
.k-item > div:first-child { display: grid; gap: 2px; min-width: 0; }
.k-item b { font-size: 15px; }
.k-item small { font-size: 13px; color: var(--ink-2); }
.k-item .k-on { font-size: 13px; color: var(--blue); }
.k-acts { display: grid; gap: 4px; justify-items: end; flex: none; }
.k-acts .link { font-size: 14px; padding: 2px 0; }