:root {
  color-scheme: light;
  --ink: #142b23;
  --muted: #4f675e;
  --green: #11634d;
  --dark: #103d32;
  --line: #d9e6df;
  --soft: #e7f3ed;
  --bg: #f3f7f5;
  --white: #fff;
  --amber: #8a3b25;
  font: 100%/1.5 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #388e74; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 5vw, 2.12rem); line-height: 1.32; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.05rem; }
.shell { width: min(100% - 32px, 720px); margin-inline: auto; }
.topbar { background: var(--dark); color: var(--white); }
.top-inner { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { border: 0; background: none; color: inherit; font-weight: 750; font-size: 1.14rem; display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.brand img { border-radius: 10px; }
.edition { font-size: .82rem; color: #d8eae1; white-space: nowrap; }
main { padding: 21px 0 calc(102px + env(safe-area-inset-bottom)); outline: none; }
.hero { padding: 23px; border-radius: 20px; color: #fff; background: linear-gradient(125deg, #103d32 8%, #135a46 100%); }
.hero p { color: #d5e9e0; margin-top: 5px; font-size: .92rem; }
.hero .track { background: #ffffff2e; margin-top: 20px; }
.hero .fill { background: #a7e8c2; }
.track { height: 7px; border-radius: 20px; overflow: hidden; background: var(--soft); }
.fill { height: 100%; background: var(--green); border-radius: inherit; }
.hero-foot { padding-top: 11px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: .88rem; color: #e5f3ec; }
.hero-foot button { color: #123c30; border: 0; background: #e7f8ee; padding: 8px 13px; border-radius: 8px; font-weight: 700; min-height: 42px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 24px 0 11px; }
.section-title span, .muted { color: var(--muted); font-size: .9rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 17px; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.resume p { margin-top: 3px; }
.row-list { display: grid; gap: 8px; }
.topic { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; align-items: center; text-align: left; width: 100%; color: var(--ink); min-height: 69px; }
.topic:hover, .option:hover, .plain:hover { border-color: #7eaf9b; }
.topic-name { font-weight: 700; }
.topic-meta { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.topic-count { font-size: .88rem; color: var(--green); font-weight: 700; white-space: nowrap; }
.topic-count .topic-meta { text-align: right; font-weight: 400; }
.source-ranges { margin-top: 12px; }
.range-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; margin-top: 10px; }
.range-list > div { padding: 9px 12px; background: var(--bg); border-radius: 10px; }
.range-list ul { margin: 5px 0 0; padding: 0; list-style: none; }
.range-list li { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; font-size: .9rem; }
.range-list li span { color: var(--muted); }
.topic-icon { display: grid; place-items: center; font-size: 1.04rem; font-weight: 750; width: 42px; height: 42px; border-radius: 12px; color: #155b47; background: #e4f3ec; }
.topic:nth-child(2) .topic-icon { background: #e9eefb; color: #385c95; }
.topic:nth-child(3) .topic-icon { background: #fbefdf; color: #7c552b; }
.topic:nth-child(4) .topic-icon { background: #e6f1f4; color: #25657a; }
.topic:nth-child(5) .topic-icon { background: #f3ecf8; color: #6e498a; }
.btn, .plain { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 10px; padding: 9px 13px; min-height: 44px; font-weight: 650; }
.primary { background: var(--green); color: var(--white); border-color: var(--green); }
.primary:hover:not(:disabled) { background: #0e513f; }
.fit { white-space: nowrap; }
.full { width: 100%; }
.bottom-nav, .actionbar { position: fixed; z-index: 2; bottom: 0; inset-inline: 0; border-top: 1px solid var(--line); background: var(--white); padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 7px 0; }
.nav-inner button { border: none; background: none; color: var(--muted); border-radius: 10px; min-height: 48px; font-weight: 700; }
.nav-inner button[aria-current="page"] { color: var(--green); background: var(--soft); }
.screen-head { margin: 10px 0 16px; }
.screen-head p { margin-top: 4px; }
.config { display: grid; gap: 18px; }
.config label { display: grid; gap: 7px; font-weight: 650; }
select { width: 100%; min-height: 46px; padding: 8px 36px 8px 12px; color: var(--ink); background-color: #f8fbf9; border: 1px solid var(--line); border-radius: 9px; }
.stack { display: grid; gap: 12px; }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.quiz-meta .plain { font-size: .86rem; }
.question-panel { margin-top: 14px; }
.tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .83rem; color: var(--muted); margin-bottom: 12px; }
.tag { padding: 3px 8px; border-radius: 7px; background: var(--soft); color: var(--green); font-weight: 700; }
.stem { font-size: 1.09rem; font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.options { display: grid; gap: 9px; margin-top: 14px; }
.option { appearance: none; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfc; color: inherit; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; width: 100%; min-height: 53px; padding: 9px; text-align: left; overflow-wrap: anywhere; }
.letter { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: #eaf0ed; font-weight: 750; }
.option[aria-pressed="true"], .correct { border-color: #5aa687; background: #e9f6ee; }
.option[aria-pressed="true"] .letter, .correct .letter { background: var(--green); color: #fff; }
.incorrect { background: #fbefeb; border-color: #df9e8f; }
.incorrect .letter { background: var(--amber); color: #fff; }
.quiz-hint { margin-top: 11px; }
.action-inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 9px 0; }
dialog { width: min(100% - 26px, 480px); max-height: 80dvh; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
dialog::backdrop { background: #102b24a0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.question-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: 6px; margin: 12px 0; }
.question-grid button { padding: 4px; }
.question-grid .done { background: var(--soft); color: var(--green); }
.question-grid [aria-current="step"] { outline: 2px solid var(--green); outline-offset: -2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 7px; margin: 14px 0; }
.stat { background: var(--soft); border-radius: 10px; padding: 10px 4px; font-size: .88rem; }
.stat strong { display: block; font-size: 1.35rem; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block: 12px; }
details.panel { padding: 0; }
summary { cursor: pointer; padding: 13px; }
summary span { font-weight: 650; }
.answer-body { padding: 0 13px 13px; }
.answer-note { margin-top: 9px; font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 28px 14px; }
.empty p { margin-top: 5px; }
.good { color: var(--green); }
.bad { color: var(--amber); }
.footnote { padding-top: 14px; text-align: center; }
.notice { position: fixed; z-index: 4; bottom: calc(76px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 28px); color: #fff; background: var(--dark); padding: 9px 12px; border-radius: 8px; text-align: center; }
[hidden] { display: none !important; }
@media (min-width: 560px) {
  main { padding-top: 27px; }
  .hero { padding: 26px; }
  .question-panel { padding: 23px; }
}
