/* 语文 · 汉字小达人：learn-inside 统一风格（纸色底、深青、少量粉）；考试界面（body.exam-mode）还原比赛答题页 */
:root {
  --bg: #F6F4EE; --surface: #FFFFFF; --surface-2: #FBFAF6;
  --text: #18302A; --muted: #5E726C; --border: #E4E0D6;
  --accent: #1D5C4D; --accent-soft: #E3ECE7;
  --ok: #1D5C4D; --ok-soft: #E3ECE7; --bad: #B04A6F; --bad-soft: #F6E7EC;
  --radius: 12px;
  --display: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC","Source Han Sans SC",sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --lg-tile:#1D5C4D; --lg-dot:#E07C9F; --lg-ink:#18302A; --lg-jade:#2E8B74; --lg-plum:#B04A6F; --lg-sub:#4E6A62;
  /* 比赛答题页 */
  --ex-bg: linear-gradient(135deg, #b9cfa8 0%, #dfe3b6 55%, #ece3a8 100%);
  --ex-paper: #ffffff; --ex-ink: #333333; --ex-title: #7f9a83; --ex-red: #e02020; --ex-line: #d8d8d8; --ex-hover: #eeeeee;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121C19; --surface: #1A2723; --surface-2: #1E2C28; --text: #E8EFEA; --muted: #9DB0A9; --border: #2B3B36;
    --accent: #6CC2A6; --accent-soft: #1E352F; --ok: #6CC2A6; --ok-soft: #1E352F; --bad: #F29BBB; --bad-soft: #3E2630;
    --lg-tile:#2C7A66; --lg-dot:#F29BBB; --lg-ink:#E8EFEA; --lg-jade:#7FD1B6; --lg-plum:#F29BBB; --lg-sub:#A9C9BE;
    --ex-bg: linear-gradient(135deg, #1f2a20 0%, #2a2c1c 100%);
    --ex-paper: #1c211d; --ex-ink: #e4e6e1; --ex-title: #9fb8a3; --ex-red: #ff7a7a; --ex-line: #3a423b; --ex-hover: #262d27;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121C19; --surface: #1A2723; --surface-2: #1E2C28; --text: #E8EFEA; --muted: #9DB0A9; --border: #2B3B36;
  --accent: #6CC2A6; --accent-soft: #1E352F; --ok: #6CC2A6; --ok-soft: #1E352F; --bad: #F29BBB; --bad-soft: #3E2630;
  --lg-tile:#2C7A66; --lg-dot:#F29BBB; --lg-ink:#E8EFEA; --lg-jade:#7FD1B6; --lg-plum:#F29BBB; --lg-sub:#A9C9BE;
  --ex-bg: linear-gradient(135deg, #1f2a20 0%, #2a2c1c 100%);
  --ex-paper: #1c211d; --ex-ink: #e4e6e1; --ex-title: #9fb8a3; --ex-red: #ff7a7a; --ex-line: #3a423b; --ex-hover: #262d27;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.65 var(--sans); }
button { font: inherit; cursor: pointer; }
a { color: var(--accent); }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.err { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; }
body.net-wait::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 30%; background: var(--accent); z-index: 99; animation: netbar 1s ease-in-out infinite; }
@keyframes netbar { from { left: -30%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { body.net-wait::before { animation: none; left: 0; width: 100%; opacity: .5; } }

/* 顶栏 */
.topnav { display: flex; align-items: center; gap: 6px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topnav .spacer { flex: 1; }
.navlink { color: var(--accent); text-decoration: none; padding: 4px 10px; border-radius: 999px; font-size: 14px; }
.navlink:hover, .navlink.on { background: var(--accent-soft); }
.brandbar { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brandbar svg { display: block; flex: none; }
.brandbar .bdiv { width: 1.5px; height: 14px; background: var(--lg-sub); opacity: .45; flex: none; }
.brandbar .bname { font-family: var(--display); font-weight: 600; color: var(--text); font-size: 16px; letter-spacing: .04em; }
.lg-tile{fill:var(--lg-tile)} .lg-dot{fill:var(--lg-dot)} .lg-ink{fill:var(--lg-ink)} .lg-jade{fill:var(--lg-jade)} .lg-plum{fill:var(--lg-plum)} .lg-sub{fill:var(--lg-sub)}

/* 页面和卡片 */
.page { width: 100%; box-sizing: border-box; max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
.page.narrow { max-width: 480px; }
.hero { padding: 8px 4px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent); background: transparent; text-decoration: none; font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--surface); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 16px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 500; }
.bar { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: var(--accent-soft); vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }

.exam-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.exam-row:last-child { border-bottom: 0; }
.exam-act { display: flex; align-items: center; gap: 12px; }
.rules { padding-left: 1.3em; }
.rules li { margin-bottom: 6px; }

/* 试卷上方的「继续」条（回访用户：没做完的模考、待订正错题） */
.cont-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cont-go { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--accent); color: var(--surface); text-decoration: none; min-width: 0; }
.cont-go.alt { background: var(--surface); color: var(--text); border: 1.5px solid var(--bad); }
.cont-go b { flex: none; font-size: 15px; }
.cont-go.alt b { color: var(--bad); }
.cont-go span { flex: 1; min-width: 0; font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cont-go i { font-style: normal; font-size: 20px; line-height: 1; }

/* 今天做什么 */
.tasks { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.task > b { font-family: var(--display); font-size: 18px; color: var(--bad); min-width: 2.2em; }
.task span { display: flex; flex-direction: column; }
.task small { color: var(--muted); font-size: 12px; }
@media (hover: hover) { .task:hover { border-color: var(--accent); } }

/* 成绩 */
.score-big { font-family: var(--display); }
.score-big b { font-size: 48px; color: var(--accent); }
.score-big span { font-size: 18px; color: var(--muted); }
.rv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rv-item { border-top: 1px solid var(--border); padding: 14px 0; }
.rv-q { font-weight: 600; white-space: normal; }
.rv-n { display: inline-block; min-width: 2.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-opts { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.rv-opts li { padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 14px; }
.rv-opts li.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.rv-opts li.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.rv-ans { font-size: 14px; margin: 6px 0; }
.rv-sol { font-size: 14px; background: var(--surface-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--text); }
details.mk { border-top: 1px solid var(--border); padding: 10px 0; }
details.mk summary { cursor: pointer; }
details.mk[open] summary { margin-bottom: 8px; }

/* 弹窗 */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 20px 22px; max-width: 420px; width: 100%; }

/* ───────── 考试界面：还原比赛答题页 ───────── */
body.exam-mode { background: var(--ex-bg); background-attachment: fixed; min-height: 100vh; color: var(--ex-ink); font-family: "Microsoft YaHei", "PingFang SC", var(--sans); }
.ex { display: flex; gap: 22px; max-width: 1060px; margin: 0 auto; padding: 32px 20px 60px; align-items: flex-start; }
.ex-clock { flex: none; width: 96px; background: var(--ex-paper); border: 1px solid var(--ex-line); text-align: center; padding: 8px 4px; font-size: 12px; color: var(--ex-ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 16px; }
.ex-clock b { display: block; color: var(--ex-red); font-weight: 400; font-size: 15px; margin-top: 4px; border-top: 1px solid var(--ex-line); padding-top: 4px; font-variant-numeric: tabular-nums; }
.ex-paper { flex: 1; min-width: 0; background: var(--ex-paper); box-shadow: 0 2px 14px rgba(0,0,0,.12); padding: 26px 48px 36px; min-height: 420px; }
.ex-title { text-align: center; color: var(--ex-title); font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.ex-lead { text-align: center; font-weight: 700; font-size: 20px; margin: 0 0 14px; }
.ex-sec { font-weight: 700; font-size: 15px; margin: 0 0 14px; }
.ex-q { font-weight: 700; font-size: 15px; margin-bottom: 14px; white-space: normal; }
.ex-q .req { color: var(--ex-red); margin-right: 2px; }
.ex-fig { margin: 6px 0 14px 24px; }
.ex-fig .glyph { display: block; max-height: 150px; width: auto; }
.ex-fig.small .glyph { max-height: 90px; }
:root[data-theme="dark"] .glyph { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glyph { filter: invert(1); } }
.ex-opts { display: flex; flex-direction: column; gap: 2px; margin-left: 20px; }
.ex-opts.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ex-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; font-size: 15px; border-radius: 2px; }
@media (hover: hover) { .ex-opt:hover { background: var(--ex-hover); } }
.ex-opt input { width: 16px; height: 16px; margin: 0; accent-color: #2a7ae2; }
.ex-opt.right { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.ex-opt.wrong { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.ex-hint { color: var(--ex-red); font-size: 13px; margin: -6px 0 8px 20px; }
.ex-fill { display: block; width: calc(100% - 20px); max-width: 520px; margin-left: 20px; padding: 8px 10px; font-size: 16px; border: 1px solid var(--ex-line); border-radius: 3px; background: var(--ex-paper); color: var(--ex-ink); }
.ex-fill:focus { outline: 2px solid #8bb3ee; outline-offset: 0; }
.ex-fb { margin: 16px 0 0 20px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.ex-fb.ok { background: var(--ok-soft); color: var(--ok); }
.ex-fb.bad { background: var(--bad-soft); color: var(--bad); }
.ex-fb p { margin: 6px 0 0; color: var(--ex-ink); }
.ex-foot { text-align: center; margin-top: 36px; }
.ex-next { padding: 5px 18px; font-size: 14px; background: var(--ex-paper); color: var(--ex-ink); border: 1px solid #b9b9b9; border-radius: 2px; }
.ex-next:active:not(:disabled) { background: var(--ex-hover); }
@media (hover: hover) { .ex-next:hover:not(:disabled) { background: var(--ex-hover); } }
.ex-next:disabled { color: #9a9a9a; cursor: not-allowed; }

@media (max-width: 640px) {
  .page { padding: 16px 16px 48px; }
  .card { padding: 16px; }
  .topnav { padding: 8px 12px; }
  .topnav .brandbar svg + svg { display: none; }
  .ex { flex-direction: column; gap: 0; padding: 0 0 40px; }
  .ex-clock { position: sticky; top: 0; z-index: 5; width: 100%; display: flex; justify-content: center; align-items: baseline; gap: 10px; border-width: 0 0 1px; box-shadow: none; padding: 8px; }
  .ex-clock b { border: 0; padding: 0; margin: 0; font-size: 16px; }
  .ex-paper { padding: 18px 16px 28px; box-shadow: none; min-height: calc(100vh - 40px); }
  .ex-title { font-size: 15px; }
  .ex-lead { font-size: 16px; }
  .ex-opts, .ex-hint, .ex-fb { margin-left: 0; }
  .ex-fill { margin-left: 0; width: 100%; }
  .ex-fig { margin-left: 0; }
  .ex-next { padding: 10px 40px; font-size: 16px; }
  .ex-opt { padding: 10px 8px; font-size: 16px; }
}

/* 语文首页：各比赛入口卡片，点进去才看试卷 */
.fam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fam-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 40px 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; }
.fam-card b { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .03em; }
.fam-card span { font-size: 14px; color: var(--muted); }
.fam-card small { font-size: 13px; color: var(--accent); min-height: 1.2em; }
.fam-card i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 22px; color: var(--accent); }
.fam-card.soon { border-style: dashed; background: transparent; color: var(--muted); }
@media (hover: hover) { a.fam-card:hover { border-color: var(--accent); } }
@media (max-width: 860px) { .fam-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; } .fam-card { padding: 14px 40px 12px 16px; } }
.back { display: inline-block; margin: 0 0 6px; color: var(--accent); }

/* 语文首页下半部分：今天做什么 / 最近成绩（和数学首页同样的样子） */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash-grid > .card { margin: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-h h2 { margin: 0; }
.tasks { display: grid; gap: 8px; }
.task { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.task > b { font-size: 26px; color: var(--bad); min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.task small { display: block; color: var(--muted); font-size: 12px; }
.task .ico { color: var(--accent); display: grid; place-items: center; min-width: 1.6em; font-style: normal; font-size: 22px; }
.mm-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.mm-line > span:first-child { font-weight: 600; }
.scores { display: grid; }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 26%) 4.5em; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.score-row:first-child { border-top: 0; }
.sr-t small { display: block; color: var(--muted); font-size: 12px; }
.sr-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.sr-bar i { display: block; height: 100%; background: var(--accent); }
.score-row b { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.score-row b small { font-size: 12px; color: var(--muted); font-weight: 400; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
/* 语文首页、汉字小达人页：和数学首页一样宽、标题一样大 */
/* 和数学页同一条规则：有左侧导航时内容区铺满，左右边距随屏宽变化 */
#app:has(> .side) > .page { max-width: none; width: 100%; margin: 0; padding: 28px clamp(20px, 3vw, 48px) 64px; }
.page.wide .hero { padding: 6px 0 20px; }
.page.wide .hero h1 { font-size: 30px; margin: 0; }
@media (max-width: 860px) { #app:has(> .side) > .page { padding: 16px 14px 32px; } .page.wide .hero h1 { font-size: 24px; } }

/* 分享宣传图再得 10 次 */
.share { display: flex; gap: 16px; align-items: flex-start; padding: 14px; margin: 10px 0; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.share img { flex: none; width: 150px; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.share-t { min-width: 0; flex: 1; display: grid; gap: 6px; }
.share-t > b { font-size: 17px; color: var(--accent); }
.share-t ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-size: 14px; }
.share-t ol b { color: var(--accent); }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.share-btns .btn { white-space: nowrap; }
.share-or { margin: 6px 0 0; }

/* ───────── 英语 · ESDP ───────── */
:root { --en: #2f6690; --en-soft: #dde9f3; --warn: #b3541e; --warn-soft: #fbe8da; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --en: #8cc0ea; --en-soft: #1f3346; --warn: #ffb07a; --warn-soft: #472c1a; } }
:root[data-theme="dark"] { --en: #8cc0ea; --en-soft: #1f3346; --warn: #ffb07a; --warn-soft: #472c1a; }
[lang="en"] { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, var(--sans); }
.h-sub { display: block; font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.sec-h { font-size: 16px; color: var(--muted); font-weight: 600; margin: 22px 0 10px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.big { padding: 12px 28px; font-size: 17px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* 组别切换 */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 4px; max-width: 100%; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 7px 18px; color: var(--muted); font-weight: 600; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.seg button small { font-weight: 400; font-size: 12px; }
.seg button[aria-selected="true"] { background: var(--accent); color: var(--surface); }

/* 模拟比赛三张卡 */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode { background: var(--surface); border: 1.5px solid var(--border); border-top: 4px solid var(--en); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.mode-h b { font-family: var(--display); font-size: 20px; letter-spacing: .03em; }
.mode-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); flex: 1; }
.mode-n { font-size: 13px; color: var(--muted); margin-top: 10px; }
.mode .actions { margin-top: 12px; }
@media (max-width: 860px) { .modes { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

/* 按话题学 */
.learn-list { padding: 4px 20px; }
.learn-row { display: grid; grid-template-columns: 7em minmax(0, 1fr) minmax(60px, 22%) 4.5em 1em; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.learn-row:first-child { border-top: 0; }
.learn-row b { font-family: var(--display); font-size: 16px; }
.lr-n { font-size: 14px; color: var(--muted); min-width: 0; }
.lr-bar { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.lr-bar i { display: block; height: 100%; background: var(--en); }
.learn-row small { font-size: 12px; color: var(--muted); text-align: right; }
.learn-row .go { font-style: normal; color: var(--accent); font-size: 20px; }
@media (hover: hover) { .learn-row:hover b { color: var(--accent); } }
@media (max-width: 640px) { .learn-row { grid-template-columns: minmax(0, 1fr) auto 1em; row-gap: 4px; } .learn-row .lr-n { grid-column: 1; grid-row: 2; } .learn-row .lr-bar { display: none; } .learn-row small { grid-column: 2; grid-row: 1 / 3; } .learn-row .go { grid-column: 3; grid-row: 1 / 3; } }

/* 赛制 */
.rules-t th { width: 4.5em; white-space: nowrap; color: var(--text); font-weight: 600; }
.rules-t td.num { color: var(--muted); text-align: right; }
.crit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.crit div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.crit span { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .crit { grid-template-columns: minmax(0, 1fr); } .rules-t td.num { display: none; } }

/* 话题列表 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }
button.chip { cursor: pointer; }
.qlist { padding: 4px 20px; }
.q-row { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.q-row:first-child { border-top: 0; }
.q-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.q-t { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.q-t small { color: var(--muted); font-size: 13px; }
.q-m { display: flex; gap: 4px; }
.q-m .tag { font-style: normal; background: var(--en-soft); color: var(--en); }
.q-m .tag.ok { background: var(--ok-soft); color: var(--ok); }
@media (hover: hover) { .q-row:hover .q-t > span { color: var(--accent); } }

/* 题目头 */
.spk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topic { font-size: 24px; line-height: 1.4; margin: 12px 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.topic-zh { color: var(--muted); margin: 0 0 6px; }
.learn-top { border-top: 4px solid var(--en); }

/* 学习四步 */
.steps { display: grid; gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.step-h { display: flex; align-items: center; gap: 10px; }
.step-h i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--en); color: var(--surface); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 14px; }
.step-h h2 { margin: 0; flex: 1; font-size: 17px; }
.step-b { margin-top: 12px; }
.step.shut .step-b { display: none; }
.step.shut { background: var(--surface-2); }
.step-b > p:first-child { margin-top: 0; }
.outline { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.ref-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.paras { display: grid; gap: 10px; }
.para { position: relative; padding: 10px 14px 10px 16px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--en); }
.para.t-open, .para.t-close { border-left-color: var(--accent); }
.para.t-example { border-left-color: var(--warn); }
.para > i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.para p { margin: 4px 0; }
.para .en { display: none; font-size: 16px; line-height: 1.7; }
.para.show-en .en { display: block; }
.para .zh { color: var(--muted); font-size: 14px; }
mark { background: color-mix(in srgb, var(--en) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.phr { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: baseline; }
.phr > b { font-size: 14px; margin-right: 4px; }
.phr span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--en-soft); color: var(--text); }
.phr em { font-style: normal; font-weight: 600; color: var(--en); margin-right: 6px; }
.recite { background: var(--surface-2); border-radius: 10px; padding: 12px 16px; font-size: 17px; line-height: 1.9; }
.recite .rc { margin: 0 0 10px; }
.recite .rc:last-child { margin: 0; }
.blank { color: var(--muted); letter-spacing: 1px; }
.hole { display: inline-block; min-width: 2.5em; padding: 0 4px; border-bottom: 2px solid var(--en); color: var(--en); cursor: pointer; }
.hole.open { border-bottom-style: dotted; font-weight: 600; }
.zh-only { font-size: 15px; }
.rec-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.rec-line audio { max-width: 100%; height: 36px; }
.rec-line .over { color: var(--bad); }
.lock-box { display: grid; gap: 6px; justify-items: start; padding: 16px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--en) 50%, transparent); background: color-mix(in srgb, var(--en) 6%, var(--surface)); }
.lock-box span { font-size: 14px; color: var(--muted); }
.lock-box .btn { margin-top: 6px; }

/* 模拟比赛：计时、录音、结果 */
.prep-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.clock { margin: 18px 0 4px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; display: grid; gap: 2px; }
.clock span { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.clock b { font-size: 52px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock small { color: var(--muted); }
.clock.prep b { color: var(--en); }
.clock.near b { color: var(--warn); }
.clock.over b { color: var(--bad); }
.lim { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 8px; }
.lim i { display: block; height: 100%; width: 0; background: var(--en); transition: width .2s linear; }
.clock.near .lim i { background: var(--warn); }
.clock.over .lim i { background: var(--bad); }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: recblink 1.2s ease-in-out infinite; }
@keyframes recblink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.iv .topic { margin-top: 18px; }
.result { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; padding: 12px 16px; border-radius: 12px; background: var(--ok-soft); }
.result b { font-size: 30px; font-variant-numeric: tabular-nums; color: var(--ok); }
.result.over, .result.short { background: var(--warn-soft); }
.result.over b, .result.short b { color: var(--warn); }
.play { width: 100%; margin: 4px 0 10px; }
.checks { display: grid; gap: 6px; margin: 12px 0 4px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); }
.checks b { font-size: 14px; }
.checks label { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.iv-list { margin: 6px 0; }

/* 写作 */
.wr textarea { width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; resize: vertical; min-height: 220px; }
.wc { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.wc .lim { flex: 1; margin: 0; max-width: 240px; }
.wc.over { color: var(--bad); }
.wc.over .lim i { background: var(--bad); }
.wclock { margin-left: auto; font-size: 18px; font-weight: 600; color: var(--en); }
.wclock.over { color: var(--bad); }
.essay { background: var(--surface-2); padding: 12px 16px; border-radius: 10px; white-space: normal; overflow-wrap: anywhere; }

/* 首页最近练习 */
.recent { display: grid; }
.rc-row { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.rc-row:first-child { border-top: 0; }
.rc-k { font-size: 12px; color: var(--en); font-weight: 600; }
.rc-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 句型和名言 */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ph-g { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.ph-g > b { display: block; margin-bottom: 6px; color: var(--en); }
.ph-g p { margin: 0 0 6px; display: grid; }
.ph-g small { color: var(--muted); }
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.quotes figure { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.quotes figcaption { font-size: 12px; color: var(--muted); font-weight: 600; }
.quotes blockquote { margin: 6px 0; font-size: 16px; font-weight: 600; }
.quotes cite { display: block; font-style: normal; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.quotes p { margin: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .topic { font-size: 20px; } .clock b { font-size: 44px; } .seg button { padding: 7px 12px; } .seg button small { display: none; } .learn-list, .qlist { padding: 2px 16px; } }
.tag.real { background: var(--warn-soft); color: var(--warn); font-style: normal; }
.q-m .tag.real { background: var(--warn-soft); color: var(--warn); }
.topic.qa { font-size: 20px; margin-top: 16px; }
.fin-res { display: grid; gap: 6px; margin: 18px 0 10px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.fr-row { display: flex; align-items: baseline; gap: 10px; }
.fr-row span { width: 3em; color: var(--muted); }
.fr-row b { font-size: 24px; color: var(--ok); }
.fr-row b.over { color: var(--bad); }
.fr-row small { color: var(--muted); }
@media (min-width: 861px) { .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 641px) and (max-width: 860px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wr .topic { font-size: 19px; line-height: 1.5; white-space: normal; }
@media (max-width: 640px) { .wr .topic { font-size: 17px; } }
