/* ============ 安徽专升本题库 · 手绘学习手账 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #f7f8f5;
  --surface: #fffef9;
  --surface-strong: #ffffff;
  --ink: #203447;
  --ink-soft: #526575;
  --line: #9aabae;
  --line-soft: #d5dddc;
  --teal: #12766d;
  --teal-dark: #0b5b54;
  --teal-soft: #d9f1ec;
  --blue: #2f5f8f;
  --blue-soft: #dceaf7;
  --coral: #bd5149;
  --coral-soft: #f8dfdb;
  --yellow: #f3d36f;
  --yellow-soft: #fff2bb;
  --bad: #b63e3e;
  --bad-soft: #f8dddd;
  --ok: #16705f;
  --ok-soft: #dcefe7;
  --grid: rgba(47, 95, 143, 0.08);
  --shadow-ink: rgba(32, 52, 71, 0.86);
  --radius: 6px;
  --z-header: 30;
  --z-sticky: 20;
}

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 16px/1.7 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: var(--teal-dark); text-decoration: none; }
a, button, summary { cursor: pointer; }

h1, h2, h3 {
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  color: var(--surface);
  background: var(--ink);
  border: 2px solid var(--surface);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* 顶部导航 */
#topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 254, 249, 0.97);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(32, 52, 71, 0.12);
}

.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  flex: 0 0 auto;
}

.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border: 2px solid var(--ink);
  border-radius: 7px 5px 8px 4px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 21px;
  font-weight: 700;
  transform: rotate(-2deg);
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 16px; }
.brand-copy small { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.primary-nav a {
  min-height: 44px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.primary-nav a:hover { color: var(--teal-dark); border-bottom-color: var(--yellow); background: var(--yellow-soft); }

.data-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px dashed var(--line);
}

.nav-tool,
#btn-reset {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease;
}
.nav-tool:hover, #btn-reset:hover { color: var(--bad); background: var(--coral-soft); }

main {
  flex: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 36px auto 64px;
}

#foot {
  width: 100%;
  min-height: 72px;
  padding: 18px max(20px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-soft);
  background: rgba(255, 254, 249, 0.94);
  border-top: 2px solid var(--ink);
  font-size: 13px;
}
#foot span:nth-child(2) { margin-left: auto; }

/* 首页工作台 */
.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: end;
  gap: 40px;
  padding: 18px 0 32px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal-dark) !important;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-title h1 { font-size: 38px; line-height: 1.25; }
.dashboard-title > p:last-child { margin-top: 8px; color: var(--ink-soft); }

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--yellow-soft);
  border: 2px solid var(--ink);
  border-radius: 5px 8px 4px 7px;
  box-shadow: 4px 5px 0 var(--ink);
  transform: rotate(0.4deg);
}

.dashboard-summary div {
  min-width: 0;
  padding: 15px 10px;
  text-align: center;
}
.dashboard-summary div + div { border-left: 1px dashed var(--ink-soft); }
.dashboard-summary b { display: block; font-size: 25px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dashboard-summary span { color: var(--ink-soft); font-size: 12px; }

.catalog-section { padding-top: 36px; }
.recent-section { margin-top: 44px; padding: 24px 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }

.section-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.section-heading > div:first-child { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { font-size: 25px; line-height: 1.25; }
.section-heading.compact { margin-bottom: 12px; }
.section-number {
  min-width: 34px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--ink);
  border-radius: 3px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 12px;
}

.quick-links { display: flex; gap: 10px; }
.quick-links a {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  border-bottom: 3px solid var(--yellow);
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease;
}
.quick-links a:hover { color: var(--teal-dark); background: var(--yellow-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.chapter-card {
  position: relative;
  min-width: 0;
  display: block;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 5px 7px 4px 6px;
  box-shadow: 4px 4px 0 var(--shadow-ink);
  transition: box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.card:hover,
.chapter-card:hover { background: #fff; border-color: var(--teal-dark); box-shadow: 6px 6px 0 var(--teal-dark); }
.card:active,
.chapter-card:active { background: var(--yellow-soft); }

.subject { min-height: 210px; padding: 20px; display: flex; flex-direction: column; }
.subject:nth-child(2) { transform: rotate(0.35deg); }
.subject:nth-child(3) { transform: rotate(-0.3deg); }
.subject::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--blue); }
.subject-coral::before { background: var(--coral); }
.subject-teal::before { background: var(--teal); }

.subject-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject-index { color: var(--ink-soft); font: 700 13px/1 ui-monospace, "Cascadia Mono", monospace; }
.subject-kind {
  padding: 2px 8px;
  color: var(--ink);
  background: var(--blue-soft);
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 12px;
}
.subject-coral .subject-kind { background: var(--coral-soft); }
.subject-teal .subject-kind { background: var(--teal-soft); }
.subject h2 { margin: 24px 0 6px; font-size: 25px; }
.subject p { color: var(--ink-soft); font-size: 14px; }
.subject-card-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}
.subject-card-foot span { color: var(--ink-soft); }
.subject-card-foot strong { color: var(--teal-dark); }

/* 科目与章节 */
.crumb {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}
.crumb a { color: var(--blue); border-bottom: 1px solid currentColor; }

.subject-titlebar {
  margin-bottom: 34px;
  padding: 8px 0 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--ink);
}
.subject-titlebar h1 { font-size: 34px; line-height: 1.25; }
.subject-titlebar p { margin-top: 6px; color: var(--ink-soft); font-size: 14px; }
.subject-titlebar .btn { flex: 0 0 auto; }
.title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.loading-state {
  min-height: 44vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-soft);
}
.loading-mark {
  width: 42px;
  height: 42px;
  border: 3px solid var(--line-soft);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: loading-spin 700ms linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

.syllabus-list { display: flex; flex-direction: column; gap: 12px; }
.syllabus-section {
  background: var(--surface);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.syllabus-section > summary {
  min-height: 72px;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  list-style: none;
  transition: background-color 180ms ease;
}
.syllabus-section > summary::-webkit-details-marker { display: none; }
.syllabus-section > summary:hover { background: var(--yellow-soft); }
.syllabus-section > summary span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.syllabus-section > summary b { font-size: 18px; overflow-wrap: anywhere; }
.syllabus-section > summary small { color: var(--ink-soft); font-size: 12px; }
.syllabus-section > summary > strong { color: var(--teal-dark); font-size: 14px; font-variant-numeric: tabular-nums; }
.syllabus-section[open] > summary { background: var(--blue-soft); border-bottom: 1px dashed var(--line); }
.kp-list { padding: 8px 8px 12px 58px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
.kp-row {
  min-height: 46px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  border-bottom: 1px dashed var(--line-soft);
  transition: color 180ms ease, background-color 180ms ease;
}
.kp-row:hover { color: var(--teal-dark); background: var(--teal-soft); }
.kp-index { color: var(--ink-soft); font: 700 11px/1 ui-monospace, "Cascadia Mono", monospace; }
.kp-row strong { color: var(--blue); font-size: 12px; font-variant-numeric: tabular-nums; }
.kp-all { color: var(--blue); font-weight: 700; }

.section-groups { display: flex; flex-direction: column; gap: 38px; }
.section-group { min-width: 0; }
.section-group-head {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.section-group-head h2 { position: relative; padding-left: 15px; font-size: 22px; line-height: 1.4; }
.section-group-head h2::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 5px; background: var(--yellow); border: 1px solid var(--ink); transform: rotate(-2deg); }
.section-group-head span { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }

.chapter-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chapter-card { min-height: 126px; padding: 16px 17px; }
.chapter-card:nth-child(3n + 2) { border-radius: 7px 4px 6px 5px; }
.chapter-card-head { min-height: 25px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.chapter-code {
  padding: 2px 7px;
  color: #fff;
  background: var(--blue);
  border-radius: 2px;
  font: 700 12px/1.5 ui-monospace, "Cascadia Mono", monospace;
}
.chapter-arrow { color: var(--ink-soft); font-size: 20px; line-height: 1; transition: color 180ms ease, transform 180ms ease; }
.chapter-card:hover .chapter-arrow { color: var(--teal-dark); transform: translateX(3px); }
.chapter-card h3 { font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.chapter-card p { margin-top: 7px; color: var(--ink-soft); font-size: 13px; }

/* 通用纸张工具 */
.panel,
.practice-sheet {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 5px 8px 4px 7px;
  box-shadow: 4px 5px 0 var(--ink);
}
.panel { margin: 20px 0; padding: 22px 24px; }
.panel h3 { margin-bottom: 13px; font-size: 18px; }

/* 题面 */
.practice-sheet { overflow: hidden; }
.qhead {
  min-height: 78px;
  padding: 15px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: var(--surface-strong);
}
.question-position { display: flex; flex-direction: column; line-height: 1.25; }
.question-position .qno { font-family: "KaiTi", "STKaiti", sans-serif; font-size: 21px; font-weight: 700; }
.question-position > span:last-child { margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.question-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.question-nav { display: flex; align-items: center; gap: 6px; }

.question-progress { height: 7px; overflow: hidden; background: var(--blue-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.question-progress i { min-width: 4px; display: block; height: 100%; background: var(--teal); transition: width 220ms ease; }
.question-content { padding: 30px 30px 34px; }

.tag,
.badge {
  min-height: 26px;
  padding: 2px 9px;
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid currentColor;
  border-radius: 3px 5px 2px 4px;
  font-size: 12px;
  line-height: 1.4;
}
.tag.d1 { color: var(--ok); background: var(--ok-soft); }
.tag.d2 { color: #835d00; background: var(--yellow-soft); }
.tag.d3 { color: var(--bad); background: var(--bad-soft); }
.tag.source-real { color: var(--bad); background: var(--coral-soft); }
.tag.source-adapted { color: var(--blue); background: var(--blue-soft); }
.tag.source-generated { color: var(--teal-dark); background: var(--teal-soft); }
.badge.new { color: var(--ink-soft); background: #edf0ef; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.wrong { color: var(--bad); background: var(--bad-soft); }

.mini {
  min-height: 44px;
  padding: 8px 9px;
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--yellow);
  transition: color 180ms ease, background-color 180ms ease;
}
.mini:hover { background: var(--yellow-soft); }
.mini.off, .mini:disabled { color: var(--line); cursor: default; border-bottom-color: transparent; }

.passage {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 22px;
  padding: 18px 20px 18px 26px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: var(--ink);
  background-color: #fbfdff;
  background-image: repeating-linear-gradient(transparent 0, transparent 31px, rgba(47, 95, 143, 0.13) 32px);
  border-left: 4px solid var(--blue);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
  font-size: 15px;
  line-height: 2.05;
}

.stem { margin: 4px 0 24px; font-size: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-strong);
  border: 2px solid var(--line);
  border-radius: 4px 7px 5px 3px;
  font-size: 15.5px;
  line-height: 1.65;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.opt:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 3px 3px 0 var(--blue); }
.opt.sel { border-color: var(--blue); background: var(--blue-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 3px 3px 0 var(--ok); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); box-shadow: 3px 3px 0 var(--bad); }
.opt:disabled { cursor: default; }
.opt b { color: var(--blue); flex: 0 0 auto; }

input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 2px solid var(--line);
  border-radius: 4px 7px 5px 3px;
  outline: none;
  font-size: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
input:focus, textarea:focus { border-color: var(--teal); box-shadow: 3px 3px 0 var(--teal); }
textarea { resize: vertical; }
.inputrow { margin: 10px 0; display: flex; align-items: center; gap: 10px; }
.inputrow input { min-width: 0; flex: 1 1 auto; }
.inputrow .btn { flex: 0 0 auto; }
.options > .inputrow { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.answer-submit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.math-entry { min-width: 0; }
.math-toolbar { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.math-token {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.math-token:hover { color: var(--teal-dark); background: var(--yellow-soft); border-color: var(--teal); }
.math-preview {
  min-height: 48px;
  margin-top: 8px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
}
.math-preview > span { color: var(--ink-soft); font-size: 13px; }

.btn {
  min-height: 44px;
  padding: 9px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--surface-strong);
  border: 2px solid var(--ink);
  border-radius: 4px 6px 3px 5px;
  box-shadow: 2px 3px 0 var(--ink);
  white-space: nowrap;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.btn:hover:not(.off):not(:disabled) { color: var(--teal-dark); background: var(--yellow-soft); border-color: var(--teal-dark); box-shadow: 3px 4px 0 var(--teal-dark); }
.btn.primary { color: #fff; background: var(--teal); border-color: var(--ink); }
.btn.primary:hover { color: #fff; background: var(--teal-dark); }
.btn.big { min-height: 50px; margin-top: 14px; padding: 12px 28px; font-size: 16px; }
.btn.okb { color: var(--ok); border-color: var(--ok); }
.btn.badb { color: var(--bad); border-color: var(--bad); }
.btn.mini2 { min-height: 44px; padding: 7px 13px; font-size: 14px; }
.btn.off { opacity: 0.42; pointer-events: none; }
.btn:disabled { opacity: 0.42; cursor: default; box-shadow: none; }

.verdict { margin: 24px 0 10px; padding-left: 12px; border-left: 5px solid currentColor; font-size: 17px; font-weight: 800; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.explanation {
  margin-top: 14px;
  padding: 18px 20px;
  background: var(--yellow-soft);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 15.5px;
}
.explanation b { margin: 4px 8px 4px 0; display: inline-block; color: var(--teal-dark); }
.ref { margin: 14px 0; padding: 14px 16px; background: var(--blue-soft); border-left: 4px solid var(--blue); }
.pre { margin: 4px 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.explanation ul, .ref ul { margin: 4px 0 8px 20px; }
.dim { color: var(--ink-soft); font-size: 14px; }
.err { color: var(--bad); font-weight: 700; }

/* 数据、错题与模考 */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 9px; text-align: left; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.tbl th { color: var(--ink-soft); font-weight: 600; }
.tbl .b { color: var(--teal-dark); font-weight: 800; }

.bar { width: min(150px, 20vw); height: 10px; overflow: hidden; background: var(--blue-soft); border: 1px solid var(--blue); border-radius: 2px; }
.bar i { height: 100%; display: block; background: var(--teal); }

.statrow { margin: 18px 0 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { min-height: 112px; padding: 18px 12px; text-align: center; background: var(--surface); border: 2px solid var(--ink); border-radius: 5px; box-shadow: 3px 3px 0 var(--ink); }
.stat:nth-child(2) { background: var(--teal-soft); }
.stat:nth-child(3) { background: var(--yellow-soft); }
.stat:nth-child(4) { background: var(--coral-soft); }
.stat b { display: block; color: var(--ink); font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-soft); font-size: 13px; }
.weak li { margin: 7px 0; }

.stats-breakdown { margin: 30px 0; }
.stats-groups { display: flex; flex-direction: column; gap: 12px; }
.stats-group { background: var(--surface); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.stats-group summary {
  min-height: 64px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 14px;
  list-style: none;
}
.stats-group summary::-webkit-details-marker { display: none; }
.stats-group summary::after { content: "+"; width: 26px; text-align: center; color: var(--teal-dark); font-size: 24px; font-weight: 700; }
.stats-group[open] summary::after { content: "−"; }
.stats-group[open] summary { background: var(--yellow-soft); border-bottom: 2px solid var(--ink); }
.stats-group summary span { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.stats-group summary b { font-family: "KaiTi", "STKaiti", sans-serif; font-size: 19px; }
.stats-group summary small { color: var(--ink-soft); font-size: 12px; }
.stats-group summary > strong { color: var(--teal-dark); font-size: 14px; font-variant-numeric: tabular-nums; }
.stats-group .tbl { background: var(--surface-strong); }
.stats-group .tbl th:first-child, .stats-group .tbl td:first-child { padding-left: 16px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { width: 100%; min-height: 54px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 4px; text-align: left; }
.row:hover { border-color: var(--teal); box-shadow: 3px 3px 0 var(--teal); }
.rowstem { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.examstart h1 { margin-bottom: 10px; font-size: 29px; }
.examstart ul { margin: 12px 0 6px 20px; }
.warn { margin: 12px 0; padding: 12px 15px; background: var(--yellow-soft); border-left: 5px solid #8a6500; }
.exambar {
  position: sticky;
  top: 80px;
  z-index: var(--z-sticky);
  margin-bottom: 18px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.gap { flex: 1; }
#exam-clock { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
#exam-clock.urgent { color: var(--bad); }
.examnav { margin: 18px 0; display: flex; justify-content: space-between; gap: 12px; }
.sheet { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 8px; }
.sq { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--ink); background: var(--surface-strong); border: 2px solid var(--line); border-radius: 3px; font-size: 13px; }
.sq.done { color: var(--teal-dark); background: var(--teal-soft); border-color: var(--teal); }
.sq.cur { color: #fff; background: var(--ink); border-color: var(--ink); }
.sg { margin: 16px 0; padding: 16px; background: var(--paper); border-top: 2px solid var(--ink); }
.exam-review { max-width: 920px; margin: 0 auto; }
.review-list { margin: 18px 0 28px; display: grid; gap: 10px; }
.review-item { background: var(--surface); border: 1px solid var(--line); }
.review-item > summary { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-item > summary strong { color: var(--ok); }
.review-item.review-bad { border-left: 5px solid var(--bad); }
.review-item.review-bad > summary strong { color: var(--bad); }
.review-body { padding: 4px 14px 16px; }
.review-body .stem { margin-bottom: 12px; }
.score { color: var(--teal-dark); font-size: 42px; font-weight: 800; }
.score span { color: var(--ink-soft); font-size: 20px; font-weight: 500; }

/* 历年真题 */
.paper-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.paper-column { min-width: 0; }
.paper-column > header { min-height: 54px; display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); }
.paper-column h2 { font-size: 22px; }
.paper-column ul { list-style: none; }
.paper-row {
  min-height: 72px;
  padding: 10px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px dashed var(--line);
}
.paper-row > span:first-child { display: flex; flex-direction: column; }
.paper-row b { font-size: 18px; }
.paper-row small { color: var(--ink-soft); font-size: 12px; }
.paper-row.pending { color: var(--ink-soft); }
.paper-status { padding: 3px 8px; border: 1px solid var(--line); font-size: 12px; }
.paper-start { max-width: 760px; margin: 42px auto; }
.paper-facts { margin: 22px 0 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.paper-facts span { padding: 14px 10px; text-align: center; color: var(--ink-soft); }
.paper-facts b { display: block; color: var(--ink); font-size: 23px; }

@media (max-width: 900px) {
  .topbar-inner { gap: 16px; }
  .brand-copy small { display: none; }
  .dashboard-head { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dashboard-summary { max-width: 480px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp-list { grid-template-columns: minmax(0, 1fr); }
  .qhead { grid-template-columns: auto minmax(0, 1fr); }
  .question-nav { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: 8px; }
}

@media (max-width: 640px) {
  .topbar-inner {
    width: calc(100% - 24px);
    min-height: 0;
    padding: 9px 0 7px;
    flex-wrap: wrap;
    gap: 7px 10px;
  }
  .brand { gap: 9px; }
  .logo { width: 38px; height: 38px; font-size: 19px; box-shadow: 2px 2px 0 var(--ink); }
  .brand-copy strong { font-size: 14px; }
  .data-tools { margin-left: auto; padding-left: 6px; }
  .nav-tool { min-width: 44px; padding: 7px 5px; font-size: 13px; }
  .primary-nav { order: 3; width: 100%; flex-basis: 100%; justify-content: space-between; gap: 0; }
  .primary-nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a { min-width: max-content; flex: 1 0 auto; padding: 8px 10px; font-size: 13px; }

  main { width: calc(100% - 28px); margin: 24px auto 42px; }
  #foot { padding: 18px 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  #foot span:nth-child(2) { margin-left: 0; }
  #btn-reset { padding-left: 0; }

  .dashboard-head { padding: 6px 0 26px; }
  .dashboard-title h1 { font-size: 31px; }
  .dashboard-title > p:last-child { font-size: 14px; }
  .dashboard-summary { width: calc(100% - 4px); transform: none; box-shadow: 3px 4px 0 var(--ink); }
  .dashboard-summary div { padding: 13px 7px; }
  .dashboard-summary b { font-size: 22px; }
  .dashboard-summary span { font-size: 12px; }

  .catalog-section { padding-top: 28px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading.compact { flex-direction: row; }
  .quick-links { width: 100%; }
  .quick-links a { flex: 1; justify-content: center; }
  .cards, .chapter-cards { grid-template-columns: minmax(0, 1fr); }
  .subject { min-height: 190px; }
  .subject:nth-child(2), .subject:nth-child(3) { transform: none; }

  .subject-titlebar { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 28px; }
  .subject-titlebar h1 { font-size: 28px; }
  .subject-titlebar .btn { align-self: flex-start; }
  .title-actions { justify-content: flex-start; }
  .section-groups { gap: 32px; }
  .section-group-head { align-items: flex-start; gap: 10px; }
  .section-group-head h2 { font-size: 20px; }
  .chapter-card { min-height: 116px; }
  .syllabus-section > summary { min-height: 68px; padding: 10px 4px; grid-template-columns: auto minmax(0, 1fr); }
  .syllabus-section > summary > strong { grid-column: 2; }
  .kp-list { padding: 6px 0 10px; }
  .kp-row { grid-template-columns: 30px minmax(0, 1fr) auto; padding-left: 4px; padding-right: 4px; }

  .practice-sheet { margin-left: -2px; margin-right: -2px; box-shadow: 3px 4px 0 var(--ink); }
  .qhead { padding: 13px 14px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .question-position { flex-direction: row; align-items: baseline; gap: 8px; }
  .question-tags { gap: 6px; }
  .question-nav { grid-column: auto; justify-content: space-between; padding-top: 8px; }
  .mini { padding: 7px 6px; font-size: 13px; }
  .question-content { padding: 22px 15px 26px; }
  .stem { font-size: 16.5px; line-height: 1.75; }
  .passage { padding: 15px 14px 15px 18px; font-size: 14px; line-height: 1.9; }
  .opt { min-height: 52px; padding: 11px 12px; font-size: 15px; }
  .options > .inputrow { grid-template-columns: minmax(0, 1fr); }
  .options > .inputrow .btn { width: 100%; }
  .answer-submit { grid-template-columns: minmax(0, 1fr); }
  .answer-submit > .btn { width: 100%; }

  .panel { padding: 18px 15px; box-shadow: 3px 4px 0 var(--ink); }
  .examstart h1 { font-size: 24px; line-height: 1.5; }
  .statrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-group summary { padding: 10px 12px; gap: 8px; }
  .stats-group summary span { align-items: flex-start; flex-direction: column; gap: 0; }
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 8px 5px; }
  .bar { width: 70px; }
  .row { align-items: flex-start; flex-wrap: wrap; }
  .rowstem { flex-basis: 100%; white-space: normal; }
  .exambar { position: static; flex-wrap: wrap; }
  .exambar .gap { display: none; }
  .paper-catalog { grid-template-columns: minmax(0, 1fr); }
  .paper-facts { grid-template-columns: minmax(0, 1fr); }
  .paper-facts span + span { border-top: 1px dashed var(--line); }
}

@media (max-width: 390px) {
  .brand-copy strong { font-size: 13px; }
  .dashboard-summary span { overflow-wrap: anywhere; }
  .tag, .badge { font-size: 12px; }
  .question-content { padding-left: 12px; padding-right: 12px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  #topbar { position: static; }
  main { margin-top: 20px; }
  .dashboard-head { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .subject:nth-child(2), .subject:nth-child(3), .dashboard-summary, .logo { transform: none; }
}
