/* ==========================================================================
   初四听力 · 模拟考试 — plain document styles
   Utilitarian: Times text, blue links, thin rules, no decoration.
   ========================================================================== */

:root {
  --maroon: #111;
  --maroon-2: #000;
  --danger: #9b1c1c;
  --ink: #000;
  --ink-soft: #333;
  --ink-faint: #666;
  --line: #000;
  --line-2: #999;
  --line-3: #ccc;
  --paper: #e9e9e9;
  --panel: #fff;
  --wash: #f2f2f2;
  --beige: #f4f4f4;
  --blue: #0000ee;
  --visited: #551a8b;
  --green: #1a6b3c;
  --green-soft: #eaf6ec;
  --red-soft: #fdeaea;
  --gold: #8a6d1f;
  --serif: "Times New Roman", "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--serif); }

a { color: var(--blue); text-decoration: underline; }
a:visited { color: var(--visited); }
a:hover { color: #000; }

img { max-width: 100%; }

hr {
  border: 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #fff;
}

/* ------------------------------------------------------------ page frame  */

.page {
  width: min(1000px, 100%);
  margin: 0 auto;
  background: #fff;
  border-left: 1px solid #777;
  border-right: 1px solid #777;
}

.shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }

/* --------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 2px solid #000;
}

.brand {
  color: #000;
  text-decoration: none;
  background: none;
}
.brand:hover { background: none; }

.brand-text {
  font: 700 23px/1.2 var(--serif);
  letter-spacing: .01em;
  color: #000;
}
.brand-text small {
  display: block;
  margin-top: 2px;
  font: 400 10px/1.3 var(--sans);
  letter-spacing: .06em;
  color: #666;
}

.masthead-meta {
  text-align: right;
  font: 11px/1.6 var(--sans);
  color: #444;
}

/* ---------------------------------------------------------------- layout  */

.layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: stretch;
}

.sidebar {
  background: #f2f2f2;
  color: #000;
  padding: 14px 12px 24px;
  border-right: 1px solid #999;
}

.side-group { margin: 0 0 4px; }

.side-link {
  display: block;
  padding: 5px 2px;
  color: #000;
  font: 12.5px/1.5 var(--sans);
  text-decoration: underline;
}
.side-link:hover { background: #ddd; }

.side-head {
  margin: 18px 0 4px;
  padding-top: 8px;
  border-top: 1px solid #ccc;
  font: 700 10px/1.2 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555;
}

.side-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-lessons a {
  display: block;
  padding: 4px 2px;
  color: #000;
  font: 12px/1.5 var(--sans);
  text-decoration: underline;
}
.side-lessons a:hover { background: #ddd; }

/* --------------------------------------------------------------- content  */

.content {
  min-width: 0;
  padding: 20px 24px 36px;
  background: #fff;
}

.content > h1 {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #000;
  font: 700 24px/1.3 var(--serif);
}

.lead { max-width: 760px; margin: 0 0 14px; font-size: 14px; line-height: 1.7; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 14px 0 0;
  border: 1px solid #999;
}
.facts > div { padding: 7px 10px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; }
.facts dt {
  font: 700 9.5px var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #666;
}
.facts dd { margin: 2px 0 0; font-size: 13px; }
#countdown { display: block; margin-top: 2px; font: 11px var(--sans); color: #555; }
#countdown strong { color: #000; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #000;
}
.section-head h2 { margin: 0; font: 700 18px/1.3 var(--serif); }
.section-head span { font: 11px var(--sans); color: #666; }

/* ----------------------------------------------------------------- cards  */

.exam-list { display: flex; flex-direction: column; gap: 10px; }

.exam-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid #999;
  background: #fff;
  color: #000;
  text-decoration: none;
  cursor: pointer;
}
.exam-card:hover { border-color: #000; background: #fafafa; }

.exam-card .tag {
  display: block;
  margin-bottom: 3px;
  font: 11px var(--sans);
  color: #666;
}

.exam-card h3 { margin: 0; font: 700 17px/1.35 var(--serif); }
.exam-card .en { margin: 1px 0 6px; font: italic 11.5px/1.4 var(--serif); color: #666; }
.exam-card p.desc { margin: 0 0 8px; max-width: 78ch; font-size: 13px; line-height: 1.55; color: #333; }

.exam-stats {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 9px;
  font: 11.5px var(--sans);
  color: #555;
}
.exam-stats div + div::before { content: "·"; margin: 0 7px; color: #999; }
.exam-stats strong { font: 700 12.5px var(--serif); color: #000; }

.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.exam-card.flash { animation: card-flash 1.2s ease; }
@keyframes card-flash {
  0%, 100% { background: #fff; }
  25%, 65% { background: #ffffb3; }
}

/* --------------------------------------------------------------- buttons  */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #555;
  border-radius: 2px;
  background: #f0f0f0;
  color: #000;
  font: 13px/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn:visited { color: #000; }
.btn:hover { background: #e0e0e0; }
.btn:active { background: #d0d0d0; }

.btn-primary {
  border-color: #000;
  background: #111;
  color: #fff;
}
.btn-primary:visited { color: #fff; }
.btn-primary:hover { background: #000; }

.btn-ghost {
  border-color: #777;
  background: #fff;
  color: #000;
}
.btn-ghost:hover { background: #eee; }

.btn-accent {
  border-color: #000;
  background: #333;
  color: #fff;
}
.btn-accent:visited { color: #fff; }
.btn-accent:hover { background: #111; }

.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 4px 8px; font-size: 11px; }

.back-top { margin: 26px 0 0; font-size: 11px; }

/* ------------------------------------------------------- toolbar / header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #f2f2f2;
  border-bottom: 1px solid #000;
}
.site-header .shell {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
}
.site-header .brand > span:last-child {
  font: 700 16px/1.1 var(--serif);
  letter-spacing: .01em;
  color: #000;
}

.header-spacer { flex: 1; }

.header-link {
  padding: 4px 7px;
  color: #000;
  font: 11.5px var(--sans);
  text-decoration: underline;
}
.header-link:hover { background: #ddd; color: #000; }

body[data-mode] main.shell {
  max-width: 1000px;
  min-height: calc(100vh - 52px);
  padding: 0 20px 36px;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  background: #fff;
}
body[data-mode] #root { margin-top: 14px; }

/* ------------------------------------------------------ review / practice */

.learn-hero {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid #000;
  background: #fff;
}
.eyebrow {
  margin-bottom: 6px;
  font: 700 10px/1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #555;
}
.learn-hero h1 { margin: 0 0 4px; font: 700 24px/1.3 var(--serif); }
.learn-hero p { margin: 0; font: 12px var(--sans); color: #444; }

.lesson-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }

.chip {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #666;
  background: #e8e8e8;
  color: #000;
  font: 11.5px var(--sans);
  text-decoration: none;
}
.chip:hover { background: #ddd; }
.chip.active {
  border-color: var(--maroon);
  background: var(--maroon);
  color: #fff;
  font-weight: 700;
}
.chip .n { margin-right: 5px; opacity: .75; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 18px 0 16px;
  border-bottom: 1px solid #000;
}
.tab {
  appearance: none;
  margin-bottom: -1px;
  padding: 6px 12px;
  border: 1px solid #999;
  border-bottom: 0;
  background: #e8e8e8;
  color: #000;
  font: 12px var(--sans);
  cursor: pointer;
}
.tab:hover { background: #ddd; }
.tab.active {
  padding-bottom: 7px;
  border-color: #000;
  background: #fff;
  color: #000;
  font-weight: 700;
}

.panel { display: none; }
.panel.active { display: block; }

/* vocab cards */
.learn-note {
  margin: 18px 0 12px;
  padding: 8px 10px;
  border: 1px solid #999;
  background: #f4f1e8;
  font: 11.5px var(--sans);
  color: #333;
}
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.vocab-card {
  padding: 12px;
  border: 1px solid #666;
  background: #fff;
  cursor: pointer;
}
.vocab-card:hover { border-color: #000; background: #fafafa; }
.vocab-card .han { font: 400 24px/1.3 var(--serif); letter-spacing: .02em; }
.vocab-card .pinyin { min-height: 18px; margin-top: 2px; font-size: 12px; color: #444; }
.vocab-card .en {
  display: none;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dotted #999;
  font-size: 12px;
  color: #333;
}
.vocab-card.revealed .en { display: block; }
.reveal-hint {
  margin-top: 6px;
  font: 9.5px var(--sans);
  color: #888;
}
.vocab-card.revealed .reveal-hint { display: none; }
.vocab-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vocab-card .play-btn { width: 30px; height: 30px; }
.vocab-card .play-btn svg { width: 11px; height: 11px; }
.vocab-card .pos { font: 10px var(--sans); color: #666; }

/* dictation */
.dictate-wrap { max-width: 640px; }
.dictate-card {
  padding: 24px;
  border: 1px solid #000;
  background: #efefef;
  text-align: center;
}
.dictate-card .hint { margin-bottom: 14px; font: 11px var(--sans); color: #555; }
.dictate-card input {
  width: 100%;
  padding: 8px;
  border: 2px inset #fff;
  border-radius: 0;
  background: #fff;
  color: #000;
  font: 400 22px var(--serif);
  text-align: center;
  outline: none;
}
.dictate-card input:focus { background: #fff; }
.dictate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.dictate-result { min-height: 24px; margin-top: 12px; font-size: 14px; }
.dictate-result.good { color: var(--green); }
.dictate-result.bad { color: var(--danger); }
.dictate-meta { margin-top: 8px; font: 11px var(--sans); color: #444; }

/* cloze */
.cloze-item {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid #999;
  background: #fff;
}
.cloze-item .sentence { margin-bottom: 10px; font-size: 15px; line-height: 2; }
.cloze-item .blank {
  display: inline-block;
  min-width: 72px;
  border-bottom: 2px solid #000;
  color: #000;
  font-weight: 700;
  text-align: center;
}
.cloze-item .blank.filled { border-bottom-color: #000; color: #000; }

/* drill summary */
.drill-summary {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #000;
  background: #fff;
}
.drill-summary h3 { margin: 0 0 6px; font: 700 20px var(--serif); }
.drill-summary p { margin: 0 0 12px; font-size: 13px; color: #333; }
.drill-summary .stats { display: flex; gap: 22px; margin-bottom: 12px; }
.drill-summary .stats div { font: 10px var(--sans); color: #555; }
.drill-summary .stats strong { display: block; font: 700 22px var(--serif); color: #000; }

/* ------------------------------------------------------------- exam page  */

body.exam-page { padding-bottom: 90px; }

.exam-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f2f2f2;
  border-bottom: 1px solid #000;
}
.exam-topbar .shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 6px 0;
}
.exam-topbar h1 {
  margin: 0;
  font: 700 16px/1.3 var(--serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exam-topbar .sub {
  font: 9.5px var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #555;
}

.mode-badge {
  padding: 2px 6px;
  border: 1px solid #000;
  font: 700 9.5px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mode-badge.exam { background: #eee; color: #333; }
.mode-badge.practice { background: var(--green-soft); color: var(--green); }

.timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #999;
  background: #fff;
  font: 700 13px var(--mono);
  white-space: nowrap;
}
.timer.warn { background: #ffecec; color: var(--danger); }

.progress-text { font: 11px var(--sans); color: #555; white-space: nowrap; }
.progress-text strong { color: #000; font-variant-numeric: tabular-nums; }

.exam-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding-top: 16px;
}

.exam-nav {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #000;
  background: #fff;
}
.exam-nav h4 {
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #000;
  font: 700 10px var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #555;
}

.nav-section {
  display: block;
  width: 100%;
  padding: 6px 5px;
  border: 0;
  border-bottom: 1px dotted #aaa;
  background: none;
  color: var(--blue);
  font: 11.5px/1.45 var(--sans);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
.nav-section:hover { background: #ddd; }
.nav-section.active {
  background: #222;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.nav-section .n { margin-right: 5px; color: #555; font-weight: 700; }
.nav-section.active .n { color: #fff; }

.q-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; padding-left: 4px; }
.q-dot {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #777;
  background: #f0f0f0;
  color: #000;
  font: 10px var(--mono);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.q-dot:hover { background: #ddd; }
.q-dot.done { border-color: #000; background: #000; color: #fff; }
.q-dot.correct { border-color: var(--green); background: var(--green); color: #fff; }
.q-dot.wrong { border-color: var(--danger); background: var(--danger); color: #fff; }

/* --------------------------------------------------------- section block  */

.section-block {
  margin-bottom: 16px;
  padding: 14px 16px 18px;
  border: 1px solid #777;
  background: #fff;
  scroll-margin-top: 70px;
}

.section-block > header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #000;
}

.section-block .num {
  font: 700 9.5px var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #555;
}
.section-block h2 { margin: 3px 0 2px; font: 700 20px/1.3 var(--serif); }
.section-block .en { margin-bottom: 6px; font: italic 11.5px var(--serif); color: #555; }
.section-block .instr { font-size: 12.5px; color: #222; }
.section-block .instr .en { display: block; margin-top: 2px; font-size: 11px; color: #555; }

.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font: 10px var(--sans);
  color: #555;
}
.section-meta span { display: inline-flex; align-items: center; gap: 4px; }

.subsection-title {
  margin: 20px 0 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid #999;
  font: 700 15px var(--serif);
}
.subsection-title .en { margin-left: 6px; font: italic 10.5px var(--serif); color: #555; }

/* ------------------------------------------------------- option word bank */

.word-bank {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px dashed #666;
  background: var(--beige);
}
.word-bank h5 {
  margin: 0 0 6px;
  font: 700 9.5px var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #555;
}
.word-bank ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.word-bank li { font-size: 13.5px; }
.word-bank li b { margin-right: 5px; color: #000; font-weight: 700; }

/* ----------------------------------------------------------------- audio  */

.audio-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #999;
  background: #f7f7f7;
}
body.practice .audio-card { border-color: #777; background: #f7f7f7; }

.play-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #000;
  border-radius: 2px;
  background: #222;
  color: #fff;
  cursor: pointer;
}
.play-btn:hover:not(:disabled) { background: #000; }
.play-btn:active:not(:disabled) { background: #000; }
.play-btn:disabled { border-color: #aaa; background: #ccc; cursor: not-allowed; }
.play-btn svg { width: 16px; height: 16px; fill: currentColor; }
.play-btn.playing { background: #000; }

.audio-main { flex: 1 1 200px; min-width: 170px; max-width: 440px; }
.audio-label { margin-bottom: 5px; font: 10.5px var(--sans); color: #333; }
.audio-label strong { color: #000; }

.audio-bar {
  position: relative;
  height: 8px;
  border: 1px solid #999;
  background: #ddd;
  overflow: hidden;
  cursor: pointer;
}
.audio-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #222;
}
body.practice .audio-bar-fill { background: var(--green); }

.audio-time {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font: 10px var(--mono);
  color: #555;
}

.play-count {
  padding: 2px 6px;
  border: 1px solid #999;
  background: #fff;
  font: 10px var(--sans);
  color: #000;
  white-space: nowrap;
}
.play-count.out { border-color: var(--danger); background: #ffecec; color: var(--danger); }

/* -------------------------------------------------------------- question  */

.question {
  padding: 12px 0 14px;
  border-bottom: 1px dotted #999;
  scroll-margin-top: 70px;
}
.question:last-child { border-bottom: 0; }

.q-head { display: flex; align-items: flex-start; gap: 10px; }

.qnum {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #000;
  background: #efefef;
  color: #000;
  font: 700 11px var(--mono);
}
.question.answered .qnum { background: #000; color: #fff; }
.question.correct .qnum { border-color: var(--green); background: var(--green); color: #fff; }
.question.wrong .qnum { border-color: var(--danger); background: var(--danger); color: #fff; }

.q-body { flex: 1; min-width: 0; }
.q-prompt { margin: 2px 0 8px; font-size: 14px; line-height: 1.6; }
.q-prompt .zh { font-weight: 700; }

.choices { display: flex; flex-wrap: wrap; gap: 6px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border: 1px solid #777;
  border-radius: 0;
  background: #f7f7f7;
  color: #000;
  font: 13px var(--serif);
  text-align: left;
  cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: #000; background: #eee; }
.choice:disabled { cursor: default; }

.choice .key {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #999;
  background: #eee;
  font: 700 10px var(--sans);
}

.choice.selected { border-color: #000; background: #f0f0f0; }
.choice.selected .key { border-color: #000; background: #000; color: #fff; }

.choice.is-correct { border-color: var(--green); background: var(--green-soft); }
.choice.is-correct .key { border-color: var(--green); background: var(--green); color: #fff; }

.choice.is-wrong { border-color: var(--danger); background: var(--red-soft); }
.choice.is-wrong .key { border-color: var(--danger); background: var(--danger); color: #fff; }

.choice.dim { opacity: .45; }

.letter-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.letter-grid .choice { padding: 3px 8px; font: 700 11px var(--sans); }
.letter-grid .choice .key { display: none; }

/* --------------------------------------------------------- answer feedback */

.feedback {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #999;
  background: #fafafa;
  font-size: 12.5px;
  line-height: 1.6;
}
.feedback.good { border-color: var(--green); background: var(--green-soft); }
.feedback.bad { border-color: var(--danger); background: var(--red-soft); }

.feedback .verdict { margin-bottom: 4px; font: 700 12.5px var(--sans); }
.feedback.good .verdict { color: var(--green); }
.feedback.bad .verdict { color: var(--danger); }
.feedback .answer-line { margin-bottom: 4px; font-size: 12px; color: #333; }
.feedback .answer-line b { color: #000; }
.feedback .explain { color: #222; }

details.transcript { margin-top: 8px; }
details.transcript summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font: 11.5px var(--sans);
  text-decoration: underline;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
details.transcript summary::-webkit-details-marker { display: none; }
details.transcript summary::before {
  content: "";
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
details.transcript[open] summary::before { transform: rotate(90deg); }

.transcript-body {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #999;
  background: #fafafa;
  font-size: 12.5px;
  line-height: 1.8;
}
.transcript-body .spk { margin-right: 5px; color: #000; font-weight: 700; }
.transcript-body .line { display: block; }
.transcript-body .hint {
  display: block;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dotted #999;
  font: 10.5px var(--sans);
  color: #555;
}

/* --------------------------------------------------------------- results  */

.results-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #777;
  background: #fff;
  scroll-margin-top: 70px;
}

.score-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; }

.score-dial {
  --pct: 0;
  position: relative;
  width: 110px;
  height: 110px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #000;
  border-radius: 50%;
  background: conic-gradient(#222 calc(var(--pct) * 1%), #dedad2 0);
}
.score-dial::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
}
.score-dial .val { position: relative; z-index: 1; line-height: 1.1; text-align: center; }
.score-dial .val strong { display: block; font: 700 32px var(--serif); }
.score-dial .val span { font: 9px var(--sans); letter-spacing: .1em; color: #555; }

.score-copy { flex: 1 1 240px; min-width: 0; }
.score-copy h3 { margin: 0 0 4px; font: 700 21px var(--serif); }
.score-copy p { margin: 0; font-size: 12.5px; color: #333; }

.breakdown { display: grid; gap: 8px; margin-top: 16px; }
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr 80px;
  gap: 10px;
  align-items: center;
}
.breakdown-row .name { font: 11.5px var(--sans); color: #333; }
.breakdown-row .name b { color: #000; font-weight: 700; }
.bar { height: 10px; border: 1px solid #999; background: #ddd; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #222; transition: width .6s ease; }
.bar > i.mid { background: var(--gold); }
.bar > i.low { background: var(--danger); }
.breakdown-row .score {
  font: 700 11.5px var(--mono);
  text-align: right;
  white-space: nowrap;
}
.breakdown-row .score span { display: block; font: 9px var(--sans); font-weight: 400; color: #555; }

/* --------------------------------------------------------------- toaster  */

.toast {
  position: fixed;
  left: 50%;
  bottom: 74px;
  z-index: 100;
  padding: 8px 14px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font: 12px var(--sans);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .15s ease, transform .15s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ submit bar  */

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: #f2f2f2;
  border-top: 1px solid #000;
}
.submit-bar .shell { display: flex; align-items: center; gap: 10px; height: 56px; }
.submit-bar .info { font: 11.5px var(--sans); color: #000; }
.submit-bar .info strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.submit-bar .spacer { flex: 1; }

/* ---------------------------------------------------------------- footer  */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 10px 18px;
  border-top: 1px solid #000;
  background: #fff;
  font: 10.5px/1.5 var(--sans);
  color: #444;
}
.site-footer a { color: var(--blue); }
.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
}

/* ------------------------------------------------------------ inline audio */

.q-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.q-row .choices { flex: 1 1 auto; min-width: 0; }

.inline-audio { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.inline-audio .play-btn { width: 30px; height: 30px; }
.inline-audio .play-btn svg { width: 12px; height: 12px; }

.mini-bar {
  position: relative;
  width: 90px;
  height: 8px;
  border: 1px solid #999;
  background: #ddd;
  overflow: hidden;
  cursor: pointer;
}
.mini-bar .audio-bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #222; }
body.practice .mini-bar .audio-bar-fill { background: var(--green); }

.inline-audio .times { font: 10px var(--mono); color: #555; white-space: nowrap; }
.inline-audio .play-count { padding: 2px 5px; font-size: 10px; }

/* ------------------------------------------------------------- nav groups */

.nav-group { margin-bottom: 12px; }
.nav-group .q-dots { margin-top: 4px; padding-left: 4px; }

/* --------------------------------------------------------- review filters */

body.only-wrong .question.correct { display: none; }
body.only-wrong .audio-block:not(:has(.question.wrong)) { display: none; }

.question.flash { animation: flash 1s ease; }
@keyframes flash {
  0%, 100% { background: transparent; }
  30% { background: #fff3c4; }
}

/* ------------------------------------------------------------- load error */

.load-error {
  max-width: 720px;
  margin: 8px 0 40px;
  padding: 18px;
  border: 1px solid #000;
  background: #fff;
  box-shadow: 4px 4px 0 #d8d3c9;
}
.load-error h2 { margin: 4px 0 8px; font: 700 19px var(--serif); }
.load-error .why { margin: 0 0 10px; font-size: 13px; color: #333; }
.load-error .url {
  margin: 0 0 12px;
  padding: 6px 8px;
  border: 1px solid #999;
  background: #efefef;
  font: 11px var(--mono);
  color: #333;
  word-break: break-all;
}
.load-error .tips { margin: 0 0 14px; padding-left: 20px; font-size: 12.5px; color: #333; }
.load-error .tips li { margin-bottom: 5px; }
.load-error code { padding: 1px 4px; background: var(--beige); font: 11.5px var(--mono); }
.load-error kbd {
  padding: 1px 5px;
  border: 1px solid #999;
  border-bottom-width: 2px;
  background: #efefef;
  font: 10.5px var(--sans);
}
.load-error ul { list-style: disc; }

body.load-failed .submit-bar { display: none; }
body.load-failed .exam-topbar .timer,
body.load-failed .exam-topbar #submit-top { display: none; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .page { width: 100%; border-left: 0; border-right: 0; box-shadow: none; }

  .layout { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    padding: 8px 14px;
    border-right: 0;
    border-bottom: 1px solid #999;
  }
  .side-head { display: none; }
  .side-group { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
  .side-lessons { display: flex; flex-wrap: wrap; gap: 2px 12px; }
  .side-lessons a { padding: 2px 0; }

  .content { padding: 14px 16px 32px; }

  .exam-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .exam-nav { position: static; order: 2; max-height: none; }
  .exam-nav .q-dots { display: none; }
  .exam-nav .nav-list { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav-section { white-space: nowrap; border-bottom: 0; }
  .section-block { padding: 12px 12px 16px; }
  .exam-topbar .shell { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .breakdown-row { grid-template-columns: 1fr auto; }
  .breakdown-row .bar { display: none; }
}

@media (max-width: 620px) {
  .masthead { padding: 12px; }
  .brand-text { font-size: 21px; }
  .masthead-meta { display: none; }

  .content > h1 { font-size: 21px; }

  .choices { flex-direction: column; align-items: stretch; }
  .choice { width: 100%; }
  .letter-grid { flex-direction: row; }
  .letter-grid .choice { width: auto; }

  .score-hero { gap: 16px; }
  .score-dial { width: 92px; height: 92px; }
  .score-dial .val strong { font-size: 26px; }
  .results-card { padding: 14px; }
  .site-footer { display: block; }
  .site-footer > div { margin-bottom: 3px; }
}

@media print {
  .masthead, .sidebar, .site-header, .exam-topbar, .exam-nav, .submit-bar,
  .audio-card, .site-footer, .back-top { display: none !important; }
  .page { width: 100%; border: 0; box-shadow: none; }
  .section-block, .results-card { border-color: #bbb; break-inside: avoid; }
  body { background: #fff; }
}
