/* ============ 基础与主题 ============ */
:root {
  --paper: #f4f0e6;
  --paper-deep: #ece6d8;
  --card: #fffdf7;
  --ink: #18211d;
  --ink-soft: #3c4943;
  --muted: #6e7a73;
  --line: #e0d8c7;
  --line-strong: #cfc4ae;
  --accent: #a93527;
  --accent-deep: #8a271c;
  --accent-soft: #f6e6e1;
  --green: #2d6a4f;
  --green-soft: #e5efe8;
  --amber: #9a6b1f;
  --amber-soft: #f7eedb;
  --shadow-sm: 0 2px 8px rgba(30, 38, 33, 0.05);
  --shadow-md: 0 10px 30px rgba(30, 38, 33, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(196, 168, 120, 0.10), transparent 42%),
    radial-gradient(circle at 82% 4%, rgba(150, 60, 45, 0.05), transparent 38%),
    repeating-linear-gradient(0deg, rgba(120, 110, 90, 0.025) 0 1px, transparent 1px 4px);
}

#app { position: relative; z-index: 1; }

.boot {
  min-height: 80vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}
.boot-mark {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent);
  background: var(--card);
}

/* ============ 布局 ============ */
.wrap {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 240, 230, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
}

.brand-seal {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff8ee;
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-family: var(--serif); font-size: 17px; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }

.nav { display: flex; gap: 4px; }
.nav button {
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav button:hover { background: rgba(160, 140, 110, 0.12); }
.nav button.on { color: var(--accent); font-weight: 600; }
.nav button.on::after {
  content: "";
  display: block;
  height: 2px;
  margin: 3px auto 0;
  width: 18px;
  background: var(--accent);
}

main { padding: 34px 0 80px; }

/* ============ 首页 ============ */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 28px;
  align-items: end;
  padding: 18px 0 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); }

.hero h1 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 1px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  margin: 0;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.hero-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mini-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.mini-stat b {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 600;
}
.mini-stat span { font-size: 12px; color: var(--muted); }

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 30px;
}

.mode-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.mode-card::after {
  content: "";
  position: absolute;
  right: -46px; top: -46px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.7;
}
.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.mode-card .m-tag {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
.mode-card h2 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}
.mode-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  max-width: 26em;
}
.mode-card .m-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  position: relative;
  z-index: 2;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 42px 0 16px;
}
.section-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.section-head span { font-size: 13px; color: var(--muted); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.chapter-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, transform 0.18s;
}
.chapter-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.chapter-card .c-no {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
}
.chapter-card h4 {
  margin: 6px 0 4px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.chapter-card .c-sub { font-size: 12px; color: var(--muted); min-height: 2.6em; }
.chapter-card .c-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.bar {
  height: 4px;
  border-radius: 4px;
  background: var(--paper-deep);
  overflow: hidden;
  margin-top: 8px;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.resume-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.6);
}
.resume-strip p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #fff9f0;
  transition: background 0.16s, transform 0.16s, box-shadow 0.16s;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
.btn.ghost:hover { background: rgba(160, 140, 110, 0.1); }
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 500;
}
.btn.quiet:hover { color: var(--accent); }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.setup-title { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.setup-desc { margin: 0 0 26px; color: var(--muted); font-size: 14px; }

.setup-group { margin-bottom: 24px; }
.setup-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.setup-label small { font-weight: 400; color: var(--muted); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fdf9f0;
}
.chip.on:hover { color: #fdf9f0; }
.chip .n { opacity: 0.6; font-size: 12px; margin-left: 4px; }
.chips.dense .chip { padding: 6px 12px; font-size: 13px; }

.setup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 8px;
}
.setup-hint { font-size: 13px; color: var(--muted); }
.setup-hint b { color: var(--ink); font-family: var(--serif); font-size: 16px; }

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--paper-deep);
  border-radius: 10px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

.input-num {
  width: 88px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

/* ============ 答题页 ============ */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.quiz-head .left { display: flex; align-items: center; gap: 12px; }
.quiz-mode {
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}
.quiz-progress { font-size: 13px; color: var(--muted); }
.quiz-progress b { font-family: var(--serif); font-size: 20px; color: var(--ink); }

.timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}
.timer.warn { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.progress-line {
  height: 3px;
  background: var(--paper-deep);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-line > i { display: block; height: 100%; background: var(--accent); transition: width 0.25s; }

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 30px 32px 26px;
}

.q-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.tag.type { background: var(--accent-soft); color: var(--accent-deep); }
.tag.kp { background: var(--green-soft); color: var(--green); }

.stem {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.85;
  margin: 0 0 22px;
  letter-spacing: 0.2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.options { display: grid; gap: 10px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 15.5px;
  line-height: 1.65;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.opt:hover { border-color: var(--ink-soft); background: rgba(255, 255, 255, 0.55); }
.opt .letter {
  flex: 0 0 auto;
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-family: var(--serif);
  color: var(--muted);
  margin-top: 1px;
}
.opt .txt { flex: 1; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.selected .letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: var(--accent); background: #f9e3de; }
.opt.wrong .letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt:disabled { cursor: default; }
.opt:disabled:hover { transform: none; }

.q-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.explain {
  margin-top: 22px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 20px;
  animation: rise 0.28s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}
.verdict .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-size: 13px;
}
.verdict.ok { color: var(--green); }
.verdict.ok .dot { background: var(--green); }
.verdict.no { color: var(--accent); }
.verdict.no .dot { background: var(--accent); }
.verdict .key { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }

.explain-block { margin-bottom: 14px; }
.explain-block:last-child { margin-bottom: 0; }
.explain-block h5 {
  margin: 0 0 5px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
}
.explain-block h5::before {
  content: "";
  display: inline-block;
  width: 3px; height: 11px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: -1px;
}
.explain-block p { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ink-soft); }

.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.actionbar .right { display: flex; gap: 10px; }

.exam-tools { display: flex; gap: 8px; align-items: center; }

.sheet-panel {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}
.sheet-panel h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 1px; }
.sheet-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-cell {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sheet-cell.answered { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.sheet-cell.current { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ============ 结果页 ============ */
.result-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  align-items: start;
}

.score-ring {
  --p: 0;
  width: 200px; height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--paper-deep) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--card);
}
.score-inner { position: relative; text-align: center; }
.score-inner b {
  display: block;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  font-weight: 600;
}
.score-inner span { font-size: 12px; color: var(--muted); }

.result-side h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 25px; font-weight: 600; }
.result-side .meta { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.kv-row { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.kv b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.kv span { font-size: 12px; color: var(--muted); }

.stat-block { margin-top: 18px; }
.stat-block h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 1.4px; color: var(--muted); }
.stat-row {
  display: grid;
  grid-template-columns: 88px 1fr 78px;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.stat-row .bar { margin: 0; height: 6px; }
.stat-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.review-list { display: grid; gap: 14px; margin-top: 18px; }
.review-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.review-item .r-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.r-head .r-index { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.r-stem { font-size: 15px; line-height: 1.75; margin: 0 0 12px; }
.r-line { font-size: 13.5px; margin: 4px 0; color: var(--ink-soft); }
.r-line b.ok { color: var(--green); }
.r-line b.no { color: var(--accent); }
.r-explain { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.r-explain p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.r-explain p:last-child { margin-bottom: 0; }
.r-explain strong { color: var(--ink-soft); font-weight: 600; }

/* ============ 错题本 ============ */
.wrong-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.wrong-title h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 28px; font-weight: 600; }
.wrong-title p { margin: 0; font-size: 13.5px; color: var(--muted); }
.wrong-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.wrong-item:last-child { border-bottom: 0; }
.wrong-item .w-main { flex: 1; min-width: 0; }
.wrong-item .w-tags { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.wrong-item .w-stem {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wrong-item .w-meta { font-size: 12px; color: var(--muted); }
.wrong-item .w-act { display: flex; gap: 6px; flex: 0 0 auto; }

.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty .e-mark {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--line-strong);
  margin-bottom: 10px;
}
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ============ 页脚 ============ */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  font-size: 12.5px;
  color: var(--muted);
}
.site-foot .f-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }

/* ============ 提示与弹层 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fdf9f0;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 80;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(24, 33, 29, 0.42);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 20px;
  animation: fade 0.18s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.modal h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.modal p { margin: 0 0 20px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.modal .m-act { display: flex; justify-content: flex-end; gap: 10px; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .hero-side { max-width: 420px; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-card .c-sub { min-height: 0; }
  .result-grid { grid-template-columns: 1fr; }
  .score-ring { width: 170px; height: 170px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .head-inner { height: 58px; }
  .brand-sub { display: none; }
  .nav button { padding: 7px 9px; font-size: 13px; }
  main { padding: 20px 0 56px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { padding: 22px; }
  .panel { padding: 20px 18px; border-radius: 14px; }
  .q-card { padding: 22px 18px 20px; border-radius: 14px; }
  .stem { font-size: 17px; }
  .opt { padding: 12px 13px; font-size: 15px; }
  .quiz-head { flex-wrap: wrap; gap: 10px; }
  .actionbar { position: sticky; bottom: 0; background: rgba(244, 240, 230, 0.94); backdrop-filter: blur(8px); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin: 16px -4px 0; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .mini-stat b { font-size: 22px; }
  .resume-strip { flex-direction: column; align-items: flex-start; }
  .stat-row { grid-template-columns: 68px 1fr 76px; gap: 10px; }
  .setup-foot { flex-direction: column; align-items: flex-start; }
  .sheet-cell { width: 31px; height: 31px; }
}

@media (max-width: 560px) {
  .brand-title { display: none; }
  .head-inner { gap: 8px; }
  .nav { gap: 0; }
  .nav button { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
