/* 《故事編輯社》視覺：高年級校刊編輯桌、紙張、紅筆與校對標記。 */
:root {
  --bg: #f6f1e7;
  --bg-2: #e9dfcf;
  --ink: #1d2733;
  --muted: #625f59;
  --accent: #b54039;
  --accent-2: #2f6f6a;
  --accent-3: #e2b457;
  --good: #2f7d5b;
  --bad: #b23d36;
  --card: #fffdf7;
  --line: #1d2733;
  --line-soft: rgba(29, 39, 51, 0.16);
  --shadow: 0 7px 0 rgba(29, 39, 51, 0.12), 0 18px 38px rgba(29, 39, 51, 0.1);
  --shadow-sm: 0 4px 0 rgba(29, 39, 51, 0.14);
  --radius: 20px;
  --radius-sm: 13px;
  --font-body: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --font-display: "Songti TC", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
}

body {
  background-image:
    linear-gradient(90deg, rgba(29, 39, 51, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(29, 39, 51, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 10% 4%, rgba(226, 180, 87, 0.28) 0, transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(47, 111, 106, 0.16) 0, transparent 28%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  background-attachment: fixed;
}

.topbar {
  background: color-mix(in srgb, #fffdf7 90%, var(--bg));
  border-bottom: 2px solid var(--ink);
}

.brand-dot {
  border-color: var(--ink);
  background: var(--accent);
}

.icon-btn {
  border-color: var(--ink);
  background: var(--card);
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--accent-3) 28%, var(--card));
}

.eyebrow {
  color: var(--accent-2);
  letter-spacing: 0.15em;
}

.hero {
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hero-subtitle {
  margin-top: -2px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 25px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.8;
}

.hero-blob {
  border: 3px solid var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.6), transparent 45%),
    linear-gradient(140deg, #f0c977, #d96a5e 72%, #2f6f6a);
  border-radius: 22px 80px 24px 70px / 62px 24px 72px 28px;
  transform: rotate(-2deg);
}

.hero-sticker {
  border: 3px solid var(--ink);
  background: var(--accent-3);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.howto {
  position: relative;
  padding: clamp(20px, 3.2vw, 32px);
  border-left: 10px solid var(--accent);
}

.howto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stamp {
  flex: none;
  padding: 6px 12px;
  border: 3px double var(--accent);
  border-radius: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  transform: rotate(4deg);
}

.howto-list {
  gap: 9px;
  margin-top: 16px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.howto-list li {
  position: relative;
  padding-left: 42px;
  line-height: 1.7;
  counter-increment: step;
}

.howto-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent-3);
  font-size: 13px;
  font-weight: 900;
}

.howto-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 8%, var(--card));
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.desk-card {
  margin: 22px 0;
  overflow: hidden;
  padding: 0;
}

.desk-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.desk-card figcaption {
  padding: 10px 16px 13px;
  border-top: 2px dashed var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.home-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.note-card {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 100px;
  padding: 18px 16px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-0.7deg);
}

.note-card:nth-child(2) { transform: rotate(0.8deg); }
.note-card:nth-child(3) { transform: rotate(-0.3deg); }
.note-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 28%;
  width: 44%;
  height: 18px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-1deg);
}

.note-card strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.note-card span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.note-coral { background: #f6cfc7; }
.note-teal { background: #cde4df; }
.note-gold { background: #f5e3b3; }

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

.level-card {
  min-height: 155px;
  border: 2px solid var(--ink);
  background: var(--card);
}

.level-card[data-current="true"] {
  background: color-mix(in srgb, var(--accent-3) 30%, var(--card));
  box-shadow: 6px 6px 0 var(--accent);
}

.level-num {
  width: 44px;
  height: 30px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
}

.level-grade {
  display: inline-block;
  width: fit-content;
  margin-top: -2px;
  padding: 1px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
}

.level-name {
  font-size: 15px;
}

.level-goal {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.play-top {
  align-items: flex-start;
}

.play-kicker {
  color: var(--accent);
  letter-spacing: 0.08em;
}

.play-title {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.hud-item {
  border: 2px solid var(--ink);
  background: var(--card);
}

.timer {
  height: 22px;
  border: 2px solid var(--ink);
  background: #fff;
}

.timer-fill {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3) 62%, var(--accent));
}

.timer.is-reading .timer-fill {
  background: repeating-linear-gradient(45deg, #dfd6c7, #dfd6c7 8px, #eee7da 8px, #eee7da 16px);
  transform: scaleX(1);
}

.timer.is-reading .timer-text {
  color: var(--ink);
  letter-spacing: 0.08em;
}

.q-progress {
  gap: 4px;
}

.q-dot {
  height: 6px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.q-dot.done { background: var(--accent-2); }
.q-dot.now { background: var(--accent); }

.question-host {
  position: relative;
  min-height: 260px;
  padding: clamp(16px, 2.4vw, 24px);
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 0 31px, rgba(201, 79, 71, 0.2) 31px 32px, transparent 32px),
    var(--card);
  background-size: auto;
  box-shadow: var(--shadow);
}

.case-wrap {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.case-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.case-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.35;
}

.case-badge.type-evidence { background: #f6cfc7; }
.case-badge.type-order { background: #cde4df; }
.case-badge.type-version { background: #f5e3b3; }
.case-badge.type-source { background: #d7ddeb; }
.case-badge.type-pick { background: #eee7da; }
.case-grade { background: var(--ink); color: #fff; }
.case-skill { background: transparent; border-style: dashed; color: var(--muted); }

.case-skill-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.q-prompt {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.7vw, 25px);
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.q-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.case-file {
  min-width: 0;
  padding: clamp(14px, 2vw, 20px);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fffefa;
  box-shadow: inset 0 0 0 1px #fff;
}

.case-file-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.case-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-genre { background: #e9dfcf; }
.case-title {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 23px);
  line-height: 1.45;
}

.case-byline {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.case-paragraph {
  margin: 8px 0;
  font-size: clamp(15px, 1.85vw, 17px);
  line-height: 1.95;
  text-align: justify;
}

.case-note {
  margin-top: 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 7%, #fffefa);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 12px 0 2px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
}

.data-table caption {
  padding: 7px 10px;
  border-bottom: 1.5px solid var(--ink);
  background: #f5e3b3;
  font-weight: 900;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: #eee7da;
  font-weight: 900;
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.chart-card {
  margin: 12px 0 0;
  padding: 12px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.chart-caption {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}

.chart-bars {
  display: grid;
  gap: 7px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(64px, 0.7fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.chart-label {
  color: var(--muted);
  font-weight: 700;
}

.chart-track {
  height: 15px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: #f4eee4;
  overflow: hidden;
}

.chart-fill {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(135deg, var(--accent-2), var(--accent-2) 6px, #4f8d87 6px, #4f8d87 12px);
}

.chart-value {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

.chart-data {
  margin-top: 10px;
  font-size: 12px;
}

.chart-data summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 800;
}

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

.source-card,
.version-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: #fffefa;
}

.source-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.source-name,
.version-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.4;
}

.source-type {
  background: #d7ddeb;
  font-size: 10.5px;
}

.source-meta,
.version-note {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.source-text,
.version-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.version-card.correct {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 10%, #fffefa);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 24%, transparent);
}

.version-card.wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 8%, #fffefa);
}

.reading-gate {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-3) 12%, #fffefa);
  text-align: center;
}

.reading-gate[hidden] {
  display: none !important;
}

.reading-gate-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.btn-start-task {
  min-width: min(100%, 300px);
  min-height: 56px;
  font-size: 18px;
}

.task-area {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 2px dashed var(--line-soft);
}

.task-area[hidden] {
  display: none !important;
}

.task-instruction {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.evidence-list {
  display: grid;
  gap: 7px;
  margin-top: 4px;
}

.sentence-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.sentence-card:not(:disabled):hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-3) 12%, #fff);
}

.sentence-card:not(:disabled):active {
  transform: translateY(1px);
}

.sentence-card:disabled {
  cursor: default;
  opacity: 0.9;
}

.sentence-num {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e9dfcf;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.sentence-text {
  font-size: 14px;
  line-height: 1.8;
  text-align: justify;
}

.sentence-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.sentence-card.selected .sentence-num {
  background: var(--accent);
  color: #fff;
}

.sentence-card.correct {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 10%, #fff);
}

.sentence-card.wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 9%, #fff);
}

.sentence-card.correct .sentence-num { background: var(--good); color: #fff; }
.sentence-card.wrong .sentence-num { background: var(--bad); color: #fff; }

.order-wrap {
  display: grid;
  gap: 8px;
}

.order-head {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.order-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.order-list.correct .order-item {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 8%, #fff);
}

.order-list.wrong .order-item {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 7%, #fff);
}

.order-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #e9dfcf;
  font-size: 12px;
  font-weight: 900;
}

.order-text {
  font-size: 13.5px;
  line-height: 1.75;
  text-align: justify;
}

.order-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.order-move {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  font-size: 12px;
  font-weight: 800;
}

.order-move:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent-3) 28%, var(--card));
}

.order-move:disabled {
  opacity: 0.34;
  cursor: default;
}

.version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.version-choose {
  flex: 1 1 160px;
}

.choices {
  gap: 8px;
}

.choice {
  min-height: 56px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  box-shadow: 0 3px 0 var(--line-soft);
}

.choice:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-3) 14%, #fff);
}

.choice.correct {
  background: color-mix(in srgb, var(--good) 12%, #fff);
  border-color: var(--good);
  box-shadow: 0 3px 0 var(--good);
}

.choice.wrong {
  background: color-mix(in srgb, var(--bad) 10%, #fff);
  border-color: var(--bad);
  box-shadow: 0 3px 0 var(--bad);
}

.choice .key {
  color: var(--muted);
}

.choice-detail {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.feedback-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-left: 10px solid var(--accent);
  border-radius: 4px;
  background: #fffefa;
  box-shadow: var(--shadow-sm);
}

.feedback-note[hidden] {
  display: none !important;
}

.feedback-note.is-good {
  border-left-color: var(--good);
  background: color-mix(in srgb, var(--good) 7%, #fffefa);
}

.feedback-note.is-bad {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, #fffefa);
}

.feedback-note.is-retrying {
  border-left-color: var(--accent-3);
}

.feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feedback-stamp {
  display: inline-block;
  padding: 2px 9px;
  border: 2px double var(--accent);
  border-radius: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  transform: rotate(-1deg);
}

.feedback-note.is-good .feedback-stamp {
  border-color: var(--good);
  color: var(--good);
}

.feedback-emoji {
  font-size: 26px;
  line-height: 1;
}

.feedback-text {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.45;
}

.feedback-text:focus {
  outline: none;
}

.feedback-explain {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.9;
}

.feedback-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.feedback-actions .btn {
  min-height: 44px;
  font-size: 14px;
}

.play-bottom {
  align-items: center;
}

.play-bottom .btn {
  box-shadow: 0 3px 0 var(--line-soft);
  font-size: 13px;
}

.play-keyhint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.result-card {
  border-top: 10px solid var(--accent);
}

.result-note {
  margin: 0 0 12px;
  padding: 9px 10px;
  border-left: 3px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 7%, var(--card));
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: left;
}

.star.on {
  color: #e2a71e;
}

.site-footer {
  border-top: 2px solid var(--ink);
  background: color-mix(in srgb, #fffdf7 92%, var(--bg));
}

.noscript {
  padding: 12px;
  border-top: 2px solid var(--accent);
  background: #f6cfc7;
  text-align: center;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy { order: 2; }
  .hero-art { order: 1; }

  .home-notes {
    grid-template-columns: 1fr;
  }

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

  .source-grid,
  .version-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .screen {
    padding-inline: 10px;
  }

  .topbar {
    padding-inline: 7px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

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

  .level-card {
    min-height: 145px;
    padding: 10px;
  }

  .question-host {
    padding: 12px;
  }

  .case-paragraph {
    font-size: 15px;
    line-height: 1.9;
  }

  .case-title {
    font-size: 18px;
  }

  .source-text,
  .version-text {
    font-size: 13px;
  }

  .order-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .order-controls {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .order-move {
    flex: 1;
    min-height: 40px;
  }

  .feedback-actions .btn {
    flex: 1 1 130px;
  }

  .play-bottom {
    flex-wrap: wrap;
  }

  .play-bottom .btn {
    flex: 1;
  }
}

@media (max-width: 380px) {
  .screen {
    padding-inline: 8px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .stamp {
    display: none;
  }

  .case-top {
    gap: 5px;
  }

  .case-badge {
    font-size: 10.5px;
    padding-inline: 7px;
  }

  .q-prompt {
    font-size: 18px;
  }

  .choice {
    font-size: 14px;
  }

  .sentence-text {
    font-size: 13px;
  }
}

/* 短螢幕：保留閱讀空間，不把長文壓成難以閱讀的小字。 */
@media (max-width: 620px) and (max-height: 760px) {
  .screen-play {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .screen-play .play-top {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .screen-play .play-kicker,
  .screen-play .play-objective,
  .screen-play .q-progress {
    display: none;
  }

  .screen-play .play-title {
    font-size: 16px;
    line-height: 1.25;
  }

  .screen-play .hud {
    width: auto;
    gap: 4px;
  }

  .screen-play .hud-item {
    min-width: 0;
    padding: 2px 6px;
    border-width: 2px;
  }

  .screen-play .timer {
    height: 16px;
    margin: 6px 0 4px;
  }

  .screen-play .question-host {
    min-height: 0;
    padding: 10px;
    border-width: 2px;
    background: var(--card);
  }

  .screen-play .q-prompt {
    font-size: 17px;
    line-height: 1.45;
  }

  .screen-play .case-paragraph {
    font-size: 14px;
    line-height: 1.8;
  }

  .screen-play .case-title {
    font-size: 16px;
  }

  .screen-play .case-file {
    padding: 10px;
  }

  .screen-play .source-text,
  .screen-play .version-text,
  .screen-play .sentence-text {
    font-size: 12.5px;
    line-height: 1.7;
  }

  .screen-play .reading-gate {
    margin-top: 8px;
    padding: 9px;
  }

  .screen-play .btn-start-task {
    min-height: 48px;
    font-size: 16px;
  }

  .screen-play .play-bottom {
    margin-top: 8px;
  }

  .screen-play .play-bottom .btn {
    padding: 5px 8px;
    font-size: 12px;
  }

  .screen-play .play-keyhint {
    display: none;
  }

  .screen-play .feedback-note {
    margin-top: 8px;
    padding: 10px;
  }

  .screen-play .feedback-text {
    font-size: 18px;
  }

  .screen-play .feedback-explain {
    font-size: 12.5px;
    line-height: 1.8;
  }
}

/* 獨立實玩後修正：小螢幕維持可讀字級，時間條隨閱讀捲動留在工具列下方。 */
.screen-play .timer {
  position: sticky;
  top: calc(var(--topbar-height, 64px) + 4px);
  z-index: 25;
  box-shadow: 0 0 0 4px var(--bg);
}
.sentence-card, .case-title, .order-move, .choice {
  scroll-margin-top: calc(var(--topbar-height, 64px) + 38px);
}
@media (max-width: 620px) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  .screen-play .case-paragraph,
  .screen-play .source-text,
  .screen-play .version-text,
  .screen-play .sentence-text,
  .screen-play .order-text,
  .screen-play .choice-label,
  .screen-play .feedback-explain { font-size: 16px; line-height: 1.8; }
  .screen-play .order-move { min-width: 44px; min-height: 44px; }
}

.offline-status { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 10px; }

html { scroll-padding-top: calc(var(--topbar-height, 64px) + 24px); scroll-padding-bottom: calc(var(--footer-height, 80px) + 18px); }
button { scroll-margin-bottom: calc(var(--footer-height, 80px) + 18px); }
