/* =========================================================================
   BJT Prep — styles.css
   两套独立框架：移动端 ≤900px / PC 端 ≥901px。
   共享层只放视觉风格（颜色 / 字体 / 边框 / 按钮观感），不放全局布局。
   状态 class（is-answered / is-summary / mode-*）只切 display 与颜色，
   不改 grid-template、flex-direction、padding、定位偏移。
   ========================================================================= */

/* ===== 1. Tokens =========================================================== */
:root {
  --paper: #f4f0e8;
  --surface: #fffdf8;
  --surface-2: #edf5f2;
  --ink: #202827;
  --muted: #66736e;
  --line: #c8d0cb;
  --line-dark: #2a3331;
  --accent: #b64032;
  --blue: #1f596b;
  --blue-soft: #dcecef;
  --green: #236448;
  --green-soft: #e8f5ed;
  --red: #a3342d;
  --red-soft: #f7e6e1;
  --mark: #f3dc86;
  --shadow: 0 18px 45px rgba(32, 40, 39, 0.13);
}

/* ===== 2. Reset + base ===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;                                /* 兜底：永不横向滚动 */
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 40, 39, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 40, 39, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
select,
textarea,
input {
  font: inherit;
  max-width: 100%;
}

select,
textarea,
input {
  min-width: 0;                                      /* 防止原生溢出父容器 */
}

button {
  border-radius: 4px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

mark {
  padding: 0 2px;
  background: var(--mark);
}

rt {
  color: var(--accent);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 0.58em;
}

[hidden] {
  display: none !important;
}

/* ===== 3. Shared visual layer (no global layout) ========================== */

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.site-description {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

body.is-answered .instruction {
  display: none;
}

.status-board {
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
}

.status-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.status-board strong {
  font-size: 28px;
  line-height: 1;
}

.jump-control,
.floating-jump {
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 800;
}

.jump-control select,
.floating-jump select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
}

.scene-panel,
.work-panel,
.summary {
  border: 2px solid var(--line-dark);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scene-panel {
  margin: 0;
  overflow: hidden;
}

.scene-panel img {
  object-fit: contain;
  object-position: top center;
  border: 1px solid var(--line);
  background: #fff;
}

.image-zoom-button {
  position: absolute;
  z-index: 4;
  min-height: 38px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  padding: 0 14px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.question-meta {
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.question-meta span {
  border: 1px solid var(--ink);
  padding: 5px 9px;
  background: var(--surface-2);
}

.instruction {
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

/* ---- Buttons base look ---- */
.listen-button,
.submit-button,
.next-button,
.plain-button,
.speed-chip,
.choice-select,
.choice-replay,
.reason-button {
  min-height: 44px;
  border: 2px solid var(--ink);
  cursor: pointer;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 900;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.listen-button,
.submit-button,
.next-button {
  color: var(--surface);
  background: var(--blue);
  box-shadow: 5px 5px 0 var(--ink);
}

.submit-button,
.next-button {
  background: var(--accent);
}

.plain-button,
.speed-chip,
.choice-replay,
.reason-button {
  color: var(--ink);
  background: var(--surface-2);
}

.listen-button:not(:disabled):hover,
.submit-button:not(:disabled):hover,
.next-button:hover,
.plain-button:hover,
.speed-chip:hover,
.choice-select:hover,
.choice-replay:not(:disabled):hover,
.reason-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.listen-button:disabled,
.plain-button:disabled,
.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.listen-button,
.choice-replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
}

.play-icon.small {
  border-top-width: 6px;
  border-bottom-width: 6px;
  border-left-width: 10px;
}

.speed-row span {
  color: var(--muted);
}

.speed-chip {
  min-height: 34px;
  padding: 0 12px;
  border-width: 1px;
}

.speed-chip.active,
.reason-button.active {
  color: #fff;
  background: var(--blue);
}

/* ---- Choice cards: colors / borders ---- */
.choice-card {
  border: 2px solid var(--line);
  background: #fff;
}

.choice-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 4px var(--blue-soft);
}

.choice-card.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.choice-card.incorrect {
  border-color: var(--red);
  background: var(--red-soft);
}

.choice-select {
  text-align: left;
  color: var(--ink);
  background: var(--surface);
}

.choice-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--accent);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 900;
  line-height: 1;
}

.choice-action {
  min-width: 0;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
}

.choice-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.choice-preview {
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.choice-replay {
  padding: 0 12px;
  border-width: 1px;
  white-space: nowrap;
}

.choice-replay:disabled,
.choice-replay-missing {
  cursor: not-allowed;
  opacity: 0.68;
  box-shadow: none;
}

.choice-replay-missing .play-icon {
  display: none;
}

.choice-replay-short {
  display: none;
}

.choice-result {
  grid-column: 1 / -1;
  width: max-content;
  padding: 4px 8px;
  border: 1px solid currentColor;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.choice-detail {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.choice-detail-block + .choice-detail-block {
  margin-top: 12px;
}

.detail-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.choice-text {
  margin-bottom: 12px;
  line-height: 2.15;
}

.choice-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.7;
}

.choice-detail-block .choice-text,
.choice-detail-block .choice-note {
  margin-bottom: 0;
}

/* ---- Review panel ---- */
.review-panel {
  border-top: 2px solid var(--line-dark);
}

.result-line,
.correct-line {
  margin: 0;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 10px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 900;
}

.correct-text {
  color: var(--green);
}

.incorrect-text {
  color: var(--red);
}

.analysis-card {
  border-left: 4px solid var(--blue);
  background: #fff;
  padding: 12px 14px;
}

.analysis-card h4 {
  margin-bottom: 6px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
}

.analysis-card p {
  margin-bottom: 0;
  line-height: 1.75;
}

.keyword-card {
  border-left-color: var(--accent);
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-dark);
  background: var(--mark);
  padding: 3px 8px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.review-lead {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.reason-button {
  border-width: 1px;
  text-align: left;
}

.reason-button strong,
.reason-button span {
  display: block;
}

.reason-button strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.reason-button span {
  font-size: 12px;
  line-height: 1.45;
}

.review-suggestion {
  margin-top: 10px;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 10px 12px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  line-height: 1.7;
}

.review-suggestion strong {
  display: block;
  margin-bottom: 4px;
}

.review-suggestion p,
.review-suggestion ul {
  margin: 0;
}

.review-suggestion ul {
  padding-left: 18px;
}

.understood-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

/* ---- Summary ---- */
.summary p {
  color: var(--muted);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.7;
}

.summary-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-weight: 800;
}

.summary-item span:nth-child(2),
.summary-item small {
  color: var(--muted);
}

/* ---- Glossary ---- */
.glossary-term {
  position: relative;
  display: inline;
  border-bottom: 2px dotted rgba(194, 61, 48, 0.55);
  background: linear-gradient(transparent 58%, rgba(243, 220, 134, 0.72) 58%);
  cursor: help;
}

.glossary-term:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.glossary-popover {
  display: none;
  border: 2px solid var(--ink);
  background: #fffdf6;
  padding: 10px 12px 12px;
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
}

.glossary-term:hover .glossary-popover,
.glossary-term:focus-visible .glossary-popover,
.glossary-term.open .glossary-popover {
  display: grid;
  gap: 5px;
}

.glossary-header {
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.glossary-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.glossary-meaning {
  color: var(--ink);
}

.glossary-point {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ---- Image dialog (visual surface only; size in framework block) ---- */
.image-dialog {
  max-width: none;
  max-height: none;
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 0;
}

.image-dialog::backdrop {
  background: rgba(32, 40, 39, 0.68);
}

.image-dialog-toolbar {
  border-bottom: 2px solid var(--ink);
  background: var(--surface);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

.image-mode-button,
.image-dialog-close {
  border-width: 1px;
}

.image-mode-button.active {
  color: #fff;
  background: var(--blue);
}

.image-dialog-viewport {
  background:
    linear-gradient(90deg, rgba(32, 40, 39, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 40, 39, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  touch-action: pan-x pan-y pinch-zoom;
  overflow: auto;
}

.image-dialog-viewport img {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.image-dialog[data-image-mode="fit"] .image-dialog-viewport img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.image-dialog[data-image-mode="actual"] .image-dialog-viewport {
  place-items: start center;
}

.image-dialog[data-image-mode="actual"] .image-dialog-viewport img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

/* =========================================================================
   4. MOBILE FRAMEWORK — ≤ 900px
   单列文档流；唯一固定元素是 mobile-audio-bar 与 floating-nav。
   body 永久 padding-bottom 留两栏空间；state 只切元素 display / 颜色。
   ========================================================================= */
@media (max-width: 900px) {
  body {
    /* worst case = mobile-audio-bar (~76) + floating-nav (~73) + breathing room */
    padding-bottom: calc(170px + env(safe-area-inset-bottom));
    background-size: 30px 30px;
  }

  /* Outer shell */
  .exam-shell {
    width: 100%;
    padding: 12px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 11px;
  }

  h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
  }

  .status-board {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.55fr) minmax(0, 1.4fr);
    box-shadow: 3px 3px 0 var(--ink);
  }

  .status-board > div,
  .jump-control {
    min-width: 0;
    padding: 6px 8px;
  }

  .status-board > div + div,
  .status-board > div + .jump-control {
    border-left: 2px solid var(--ink);
  }

  .jump-control {
    display: grid;
    gap: 4px;
  }

  .status-label {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .status-board strong {
    font-size: 20px;
  }

  .jump-control select {
    min-height: 38px;
    font-size: 14px;
  }

  /* Question section — single column, natural document flow */
  .exam-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
  }

  .scene-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-width: 1px;
    padding: 8px;
  }

  .scene-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
  }

  .scene-panel img {
    width: 100%;
    max-height: 50vh;
    border-width: 1px;
  }

  .image-zoom-button {
    right: 8px;
    bottom: 8px;
    min-height: 42px;
    padding: 0 13px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .work-panel {
    border-width: 1px;
    padding: 14px;
    box-shadow: none;
  }

  .question-meta {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .question-meta span {
    display: grid;
    align-items: center;
    padding: 5px 8px;
  }

  .work-panel h2 {
    margin-bottom: 6px;
    font-size: 30px;
    line-height: 1;
  }

  .instruction {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
  }

  /* PC inline audio console hidden — use fixed mobile-audio-bar instead */
  .audio-console,
  .work-panel > .speed-row {
    display: none;
  }

  /* Choices */
  .choice-list {
    display: grid;
    gap: 8px;
  }

  .choice-card {
    border-width: 1px;
  }

  .choice-card.selected {
    box-shadow: inset 0 0 0 3px var(--blue-soft);
  }

  .choice-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
    align-items: center;
    padding: 6px;
  }

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

  .choice-select {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    padding: 6px 8px;
  }

  .choice-number {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .choice-action {
    font-size: 12px;
  }

  .choice-preview {
    font-size: 17px;
    line-height: 1.5;
  }

  .choice-replay {
    width: 56px;
    height: 56px;
    min-height: 56px;
    min-width: 56px;
    padding: 0;
  }

  /* AudioOnly question-type choice card variant — color/border + replay style */
  .choice-card.mode-audioOnly {
    border: 0;
    background: transparent;
  }

  .choice-card.mode-audioOnly.answered {
    border: 1px solid var(--line);
    background: #fff;
  }

  .choice-card.mode-audioOnly.selected {
    box-shadow: none;
  }

  .choice-card.mode-audioOnly .choice-select {
    min-height: 50px;
  }

  .choice-card.mode-audioOnly.selected .choice-select {
    border-color: var(--blue);
    background: var(--blue-soft);
  }

  .choice-card.mode-audioOnly.correct .choice-select {
    border-color: var(--green);
    background: var(--green-soft);
  }

  .choice-card.mode-audioOnly.incorrect .choice-select {
    border-color: var(--red);
    background: var(--red-soft);
  }

  .choice-card.mode-audioOnly .choice-action {
    font-size: 13px;
    white-space: nowrap;
  }

  .choice-card.mode-audioOnly .choice-replay {
    width: 56px;
    height: 56px;
    min-height: 56px;
    min-width: 56px;
    padding: 0;
    border-width: 2px;
    font-size: 14px;
  }

  .choice-card.mode-audioOnly .choice-replay-full {
    display: none;
  }

  .choice-card.mode-audioOnly .choice-replay-short {
    display: inline;
  }

  .choice-text {
    font-size: 20px;
    line-height: 2;
  }

  .choice-detail {
    padding: 12px;
  }

  .choice-card.mode-audioOnly .choice-detail {
    margin-top: 8px;
    border: 1px solid var(--line);
  }

  .choice-note,
  .analysis-card p,
  .review-lead {
    font-size: 13px;
  }

  .submit-button {
    width: 100%;
    margin-top: 14px;
    min-height: 48px;
  }

  .submit-button:disabled {
    display: none;
  }

  /* Review */
  .review-panel {
    margin-top: 14px;
    padding-top: 14px;
  }

  .result-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .analysis-panel,
  .review-tools {
    margin-top: 14px;
  }

  .analysis-panel h3,
  .review-tools h3 {
    margin-bottom: 10px;
    font-size: 20px;
  }

  .analysis-grid {
    display: grid;
    gap: 10px;
  }

  .review-tools {
    display: grid;
    gap: 14px;
  }

  .reason-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reason-button {
    min-height: 68px;
    padding: 9px 10px;
  }

  /* Body-level state class — display toggles only, no layout change */
  body.mode-audioOnly .question-meta,
  body.mode-audioOnly .work-panel h2,
  body.mode-audioOnly .instruction {
    display: none;
  }

  .mode-visibleBeforeAnswer .choice-select {
    min-height: 56px;
  }

  .mode-visibleBeforeAnswer .choice-preview {
    font-size: 18px;
  }

  /* Summary */
  .summary {
    margin: 18px 0 0;
    border-width: 1px;
    padding: 14px;
    box-shadow: none;
  }

  .summary h2 {
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1.05;
  }

  .summary-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
  }

  /* Glossary popover — anchor above floating-nav + audio-bar stack */
  .glossary-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(160px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 42dvh;
    overflow: auto;
  }

  /* Fixed mobile audio bar */
  .mobile-audio-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, 0.97);
    border-top: 2px solid var(--ink);
  }

  .mobile-audio-bar .listen-button,
  .mobile-audio-bar .plain-button {
    min-height: 44px;
    padding: 0 10px;
  }

  .mobile-audio-bar .plain-button {
    min-width: 70px;
    font-size: 14px;
  }

  .mobile-speed-row {
    display: flex;
    gap: 3px;
  }

  .mobile-speed-row .speed-chip {
    min-width: 38px;
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
  }

  /* Fixed floating-nav — always positioned above audio bar; [hidden] handles visibility */
  .floating-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 19;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--surface);
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
  }

  .floating-nav > div {
    display: grid;
    min-width: 44px;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  }

  .floating-nav span {
    display: none;
  }

  .floating-nav strong {
    font-size: 15px;
  }

  .floating-jump {
    display: grid;
    gap: 2px;
  }

  .floating-jump span {
    display: block;
    color: var(--muted);
    font-size: 11px;
  }

  .floating-nav .prev-button {
    min-width: 56px;
    min-height: 48px;
    margin: 0;
    padding: 0 8px;
    font-size: 13px;
  }

  .floating-nav .next-button {
    min-width: 88px;
    min-height: 48px;
    margin: 0;
    padding: 0 10px;
  }

  .floating-nav .prev-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
  }

  /* is-summary: hide both fixed bars; padding-bottom stays the same */
  body.is-summary .mobile-audio-bar {
    display: none;
  }

  /* Image dialog — full-bleed on mobile */
  .image-dialog {
    width: calc(100vw - 14px);
    height: calc(100dvh - 14px);
    box-shadow: none;
  }

  .image-dialog-toolbar {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    min-height: 98px;
    padding: 8px;
  }

  .image-dialog-toolbar > div {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .image-mode-button,
  .image-dialog-close {
    min-height: 42px;
    padding: 0 8px;
  }

  .image-dialog-viewport {
    display: grid;
    place-items: center;
    width: 100%;
    height: calc(100% - 98px);
    padding: 10px;
  }
}

/* =========================================================================
   5. PC FRAMEWORK — ≥ 901px
   两列 grid，左 sticky 图，右文档流；不存在 mobile-audio-bar / floating-nav。
   ========================================================================= */
@media (min-width: 901px) {
  .exam-shell {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 24px 18px;
  }

  h1 {
    margin: 0 0 0;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1;
  }

  .status-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(72px, 1fr)) minmax(140px, 1.6fr);
    box-shadow: 4px 4px 0 var(--ink);
  }

  .status-board > div,
  .jump-control {
    min-width: 0;
    padding: 8px 12px;
  }

  .status-board > div + div,
  .status-board > div + .jump-control {
    border-left: 2px solid var(--ink);
  }

  .status-board strong {
    font-size: 22px;
  }

  .jump-control {
    display: grid;
    gap: 4px;
  }

  /* Two-column exam grid */
  .exam-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(460px, 1.1fr);
    align-items: start;
    gap: 18px;
    margin-top: 0;
  }

  .scene-panel {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .scene-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
  }

  .scene-panel img {
    width: 100%;
    max-height: calc(100vh - 200px);
  }

  .image-zoom-button {
    right: 10px;
    bottom: 10px;
  }

  .work-panel,
  .summary {
    padding: 16px 18px;
  }

  .question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .work-panel h2 {
    margin-bottom: 6px;
    font-size: 36px;
    line-height: 1;
  }

  .instruction {
    margin-bottom: 12px;
  }

  .audio-console {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
  }

  .speed-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    font-size: 14px;
    font-weight: 800;
  }

  /* Compact choice-detail in answered state (PC explanation entry stays above the fold) */
  .choice-detail {
    padding: 10px 14px 12px;
  }

  .choice-detail-block + .choice-detail-block {
    margin-top: 8px;
  }

  .choice-text {
    line-height: 1.7;
  }

  /* Choices */
  .choice-list {
    display: grid;
    gap: 8px;
  }

  .choice-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 10px;
    align-items: center;
    padding: 8px;
  }

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

  .choice-select {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
  }

  .choice-number {
    width: 40px;
    height: 40px;
    margin-left: 6px;
    font-size: 20px;
  }

  .choice-preview {
    font-size: 18px;
  }

  .choice-replay {
    width: 64px;
    height: 52px;
    min-height: 52px;
    min-width: 64px;
    padding: 0;
  }

  .choice-text {
    font-size: clamp(19px, 2.3vw, 24px);
  }

  .choice-note {
    font-size: 14px;
  }

  .mode-visibleBeforeAnswer .choice-select {
    min-height: 68px;
  }

  .mode-visibleBeforeAnswer .choice-preview {
    font-size: 20px;
  }

  /* Submit button */
  .submit-button {
    width: 100%;
    margin-top: 10px;
  }

  /* Review panel — explanation entry visible above the fold; long body scrolls inside */
  .review-panel {
    margin-top: 12px;
    padding-top: 12px;
  }

  .result-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  .analysis-panel,
  .review-tools {
    margin-top: 10px;
  }

  .analysis-panel h3,
  .review-tools h3 {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .analysis-grid {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
  }

  .review-tools {
    display: grid;
    gap: 18px;
  }

  .reason-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .reason-button {
    min-height: 78px;
    padding: 9px 10px;
  }

  /* Summary */
  .summary {
    width: min(760px, 100%);
    margin: 42px auto 0;
  }

  .summary h2 {
    margin-bottom: 10px;
    font-size: 42px;
  }

  .summary-list {
    display: grid;
    gap: 10px;
    margin: 22px 0;
  }

  /* No mobile audio bar on PC */
  .mobile-audio-bar {
    display: none;
  }

  /* PC floating-nav: 右下角浮动卡片，prev + 进度 + next */
  .floating-nav {
    position: fixed;
    right: 24px;
    bottom: 24px;
    left: auto;
    width: auto;
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 2px solid var(--ink);
    box-shadow: 6px 6px 0 var(--ink);
    z-index: 30;
  }

  .floating-nav > div {
    display: grid;
    gap: 2px;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  }

  .floating-nav span {
    color: var(--muted);
    font-size: 12px;
  }

  .floating-nav strong {
    font-size: 16px;
  }

  .floating-nav .floating-jump {
    display: none;
  }

  .floating-nav .prev-button {
    min-height: 44px;
    margin: 0;
    padding: 0 14px;
  }

  .floating-nav .prev-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
  }

  .floating-nav .next-button {
    min-height: 44px;
    margin: 0;
    padding: 0 18px;
  }

  /* Image dialog */
  .image-dialog {
    width: min(1100px, calc(100vw - 24px));
    height: min(900px, calc(100dvh - 24px));
    box-shadow: 8px 8px 0 var(--ink);
  }

  .image-dialog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 56px;
    padding: 8px 10px;
  }

  .image-dialog-toolbar > div {
    display: flex;
    gap: 6px;
  }

  .image-mode-button,
  .image-dialog-close {
    min-height: 38px;
    padding: 0 12px;
  }

  .image-dialog-viewport {
    display: grid;
    place-items: center;
    width: 100%;
    height: calc(100% - 56px);
    padding: 14px;
  }
}
