/* ===================================================================
   识字探险岛 - 现代教育界面
   单一视觉系统：低干扰、清爽、稳定响应式。
   =================================================================== */

:root {
  --ink: #1d2b33;
  --muted: #4a5962;
  --soft: #f7faf8;
  --paper: #ffffff;
  --line: #dfe8e8;
  --line-strong: #c9d8d8;
  --blue: #4a99b8;
  --blue-soft: #edf7fa;
  --green: #56a77a;
  --green-soft: #eef8f1;
  --yellow: #efba4e;
  --yellow-soft: #fff6df;
  --red: #dc7972;
  --red-soft: #fff0ef;
  --violet: #7d8ec7;
  --violet-soft: #f0f2fb;
  --shadow: 0 14px 36px rgba(29, 43, 51, .08);
  --shadow-soft: 0 8px 22px rgba(29, 43, 51, .06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--blue);
  color: var(--paper);
  font-size: 16px;
  font-weight: 950;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 1;
}

.skip-link:focus {
  left: 12px;
  z-index: 9999;
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

html {
  min-height: 100%;
  background: #f6f8f4;
}

body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  background:
    linear-gradient(180deg, #eef7f7 0, #f8faf6 42%, #fffdf8 100%);
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sky-decor {
  display: none;
}

.app {
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(223, 232, 232, .9);
}

.brand-badge {
  width: 52px;
  height: 52px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-soft);
}

.brand-badge img,
.hero-map img,
.journey-break img {
  display: block;
  width: 100%;
  height: 100%;
}

header h1 {
  color: var(--ink);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 950;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  word-break: keep-all;
  overflow-wrap: normal;
}

header .subtitle {
  max-width: 560px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  word-break: normal;
  overflow-wrap: break-word;
}

.today-stats,
.session-badges,
.score-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.today-stats span,
#timerText,
#scoreText,
#todayMini,
.score-list span,
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.export-btn {
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--blue-soft);
  border-color: var(--blue);
}

.export-btn:hover {
  background: var(--blue);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.export-btn:active {
  transform: translateY(0);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.start-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 24px;
  padding: 24px 0 18px;
}

.adventure-panel {
  order: 1;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.hero-map {
  order: 2;
  min-width: 0;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .42)),
    linear-gradient(135deg, rgba(74, 153, 184, .12), rgba(86, 167, 122, .1) 55%, rgba(239, 186, 78, .12));
  box-shadow: var(--shadow);
}

.hero-map img {
  width: min(100%, 310px);
  height: auto;
  filter: drop-shadow(0 16px 20px rgba(29, 43, 51, .13));
}

.module-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.module-card,
.mode-btn,
.grade-btn,
.btn,
.option-btn,
.grid-cell,
.draggable-part,
.story-listen {
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.module-card {
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 118px;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.module-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -48px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.module-card[data-module="char"] {
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
}

.module-card[data-module="pinyin"] {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
}

.module-card[data-module="addsub"] {
  --accent: var(--yellow);
  --accent-soft: var(--yellow-soft);
}

.module-card[data-module="math"] {
  --accent: var(--red);
  --accent-soft: var(--red-soft);
}

.module-card[data-module="story"] {
  --accent: var(--violet);
  --accent-soft: var(--violet-soft);
}

.module-card[data-module="physics"] {
  --accent: #2f7d88;
  --accent-soft: #e7f5f4;
}

.module-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), #fff 62%);
  box-shadow: 0 0 0 3px rgba(74, 153, 184, .12), var(--shadow-soft);
}

.module-card:hover,
.mode-btn:hover,
.grade-btn:hover,
.btn:hover,
.option-btn:hover {
  transform: translateY(-1px);
}

:where(button, [role="button"], input, select, textarea):focus-visible {
  outline: 3px solid #e59b2f;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(229, 155, 47, .22);
}

.btn:disabled {
  cursor: wait;
  opacity: .68;
  transform: none;
  box-shadow: none;
}

.module-icon,
.mode-btn .icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .76);
}

.module-icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  margin-bottom: 9px;
  font-size: 24px;
}

.module-title,
.module-copy {
  position: relative;
  z-index: 1;
  display: block;
}

.module-title {
  color: var(--ink);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.2;
}

.module-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.option-panel,
.challenge-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .7);
}

.section-label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.mode-selector,
.grade-selector,
.time-selector,
.difficulty-selector {
  display: grid;
  gap: 8px;
}

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

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

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

.physics-grade-selector {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 320px;
}

.grade-selector,
.compact-selector,
.difficulty-selector {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.mode-btn,
.grade-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  box-shadow: none;
}

.mode-btn {
  min-height: 66px;
  padding: 9px 7px;
  display: grid;
  place-items: center;
  gap: 4px;
  font-size: 14px;
}

.mode-btn .icon {
  width: 30px;
  height: 30px;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
}

.mode-btn.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #16465d;
  box-shadow: 0 0 0 3px rgba(74, 153, 184, .12);
}

.grade-btn {
  min-height: 42px;
  padding: 8px 6px;
  font-size: 14px;
}

.grade-btn.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: #245f40;
  box-shadow: 0 0 0 3px rgba(86, 167, 122, .11);
}

.time-btn.active {
  border-color: var(--yellow);
  background: var(--yellow-soft);
  color: #6b4b14;
}

.difficulty-btn.active {
  border-color: var(--violet);
  background: var(--violet-soft);
  color: #354579;
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  min-height: 48px;
  padding: 10px 26px;
  border: 1px solid transparent;
  font-size: 17px;
  font-weight: 950;
}

.btn-primary {
  min-width: 150px;
  border-color: #c99738;
  background: var(--yellow);
  color: #3a2908;
  box-shadow: 0 10px 22px rgba(172, 115, 24, .15);
}

.btn-secondary,
.back-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: #174b61;
  box-shadow: var(--shadow-soft);
}

.bottom-controls {
  margin-top: 12px;
}

.train-area {
  display: grid;
  gap: 14px;
  width: min(860px, 100%);
  margin: 0 auto;
  padding-top: 22px;
}

.task-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
}

.back-btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
}

.task-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.char-display,
.math-card,
.pinyin-card,
.addsub-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.char-display .big-char {
  color: var(--ink);
  font-size: 132px;
  line-height: 1;
  font-weight: 950;
}

.char-display .pinyin {
  color: var(--blue);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 950;
}

.task-prompt,
.task-hint {
  color: var(--muted);
  font-size: 18px;
}

.hint,
.story-stage {
  width: 100%;
  padding: 20px;
  border: 1px dashed rgba(74, 153, 184, .36);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.hint .emoji {
  margin-bottom: 8px;
  font-size: 72px;
  line-height: 1;
}

.hint .origin {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.hint .parts {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 11px;
  border: 1px solid rgba(239, 186, 78, .46);
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #6b4b14;
  font-size: 14px;
  font-weight: 950;
}

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

.option-btn {
  min-height: 100px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 46px;
  font-weight: 950;
  line-height: 1.1;
  box-shadow: var(--shadow-soft);
}

.option-btn.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option-btn.wrong {
  opacity: .48;
  pointer-events: none;
}

.option-btn.disabled {
  pointer-events: none;
}

.number-option {
  font-size: 42px;
}

.slots-zone,
.slot-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.slots-zone {
  align-items: center;
  margin: 12px 0;
}

.slots-pin {
  flex-direction: column;
  gap: 8px;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  min-height: 118px;
  padding: 8px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.slot:focus {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-color: var(--violet);
  background: var(--violet-soft);
}

.slot .slot-label {
  position: absolute;
  top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.slot.over {
  border-color: var(--violet);
  background: var(--violet-soft);
}

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

.slot.wrong {
  border-color: var(--red);
  background: var(--red-soft);
}

.char-mini {
  margin-top: 8px;
  color: #9aa9ae;
  font-size: 64px;
  line-height: 1;
  opacity: .4;
}

.char-parts-pool {
  max-width: 540px;
  margin: 0 auto;
}

.draggable-part {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  font-size: 48px;
  font-weight: 950;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.draggable-part:focus {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.draggable-part.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(74, 153, 184, .25);
}

.draggable-part.dragging {
  opacity: 0.6;
  transform: scale(1.1);
  cursor: grabbing;
  z-index: 1000;
}

.pinyin-large,
.pinyin-display {
  color: var(--ink);
  font-size: 92px;
  font-weight: 950;
  line-height: 1;
}

.pinyin-options .pinyin-option {
  font-size: 42px;
}

.pinyin-listen,
.story-listen {
  min-width: 68px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--blue-soft);
  color: #16465d;
  font: inherit;
  font-size: 14px;
  font-weight: 950;
}

.mouth-card {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px dashed rgba(74, 153, 184, .38);
  border-radius: 50%;
  background: var(--blue-soft);
}

.mouth-shape {
  display: grid;
  place-items: center;
  width: 58px;
  height: 42px;
  border: 4px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-size: 17px;
  font-weight: 950;
}

.bridge-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 48px;
  font-weight: 950;
}

.bridge-visual span {
  min-width: 74px;
  min-height: 60px;
  display: inline-grid;
  place-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.bridge-visual b {
  color: #6b4b14;
}

.pinyin-word {
  color: var(--blue);
  font-size: 96px;
  font-weight: 950;
  line-height: 1;
  opacity: .7;
}

.tone-track {
  position: relative;
  width: min(100%, 340px);
  height: 72px;
  border: 1px dashed rgba(74, 153, 184, .34);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.tone-track span {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 50%;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  transform-origin: center;
}

.tone-hidden span {
  left: 50%;
  right: auto;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  margin-top: -17px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--blue);
}

.tone-hidden span::before {
  content: "?";
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.tone-rise span {
  transform: rotate(-16deg);
}

.tone-fall span {
  transform: rotate(16deg);
}

.tone-dip span {
  top: 54%;
  height: 34px;
  background: transparent;
  border-left: 8px solid var(--red);
  border-bottom: 8px solid var(--red);
  border-radius: 0 0 0 18px;
  transform: rotate(-28deg);
}

.math-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid rgba(239, 186, 78, .48);
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #6b4b14;
  font-size: 32px;
  font-weight: 950;
}

.math-array {
  --dot-size: 26px;
  display: grid;
  justify-content: center;
  max-width: 100%;
  gap: 5px;
  overflow: hidden;
  margin-top: 4px;
}

.array-dot,
.cell-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff2bd, var(--yellow) 58%, #c98a2f 100%);
  box-shadow: inset 0 -1px 0 rgba(92, 58, 0, .14);
}

.array-dot {
  width: var(--dot-size);
  height: var(--dot-size);
}

.target-grid {
  --cell-size: 34px;
  display: grid;
  justify-content: center;
  max-width: 100%;
  gap: 5px;
}

.grid-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  padding: 5px;
  border: 2px dashed var(--line-strong);
  background: var(--paper);
}

.grid-cell.correct-cell {
  border-color: var(--green);
  background: var(--green-soft);
}

.addsub-stage {
  width: min(100%, 720px);
  display: grid;
  gap: 12px;
}

.number-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px dashed rgba(74, 153, 184, .34);
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: #16465d;
  font-weight: 950;
}

.number-line span:first-child,
.number-line span:last-child,
.number-line .jump {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  border-radius: 999px;
}

.number-line span:first-child,
.number-line span:last-child {
  background: var(--paper);
}

.number-line .jump {
  padding: 6px 12px;
  background: var(--yellow-soft);
  color: #6b4b14;
}

.addsub-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.addsub-group {
  min-height: 102px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.addsub-group b {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 18px;
}

.addsub-dots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14px, 1fr));
  gap: 4px;
  max-width: 100%;
}

.addsub-dots .array-dot {
  width: 18px;
  height: 18px;
}

.operation-sign {
  color: var(--blue);
  font-size: 34px;
  font-weight: 950;
}

.result-group {
  background: var(--green-soft);
}

.answer-placeholder {
  display: grid;
  place-items: center;
  color: #34875c;
  font-weight: 950;
}

.answer-placeholder b {
  margin: 0;
  font-size: 32px;
}

.answer-empty span {
  background: #eef3f3;
}

.decimal-bars,
.fraction-bars {
  width: min(100%, 620px);
  display: grid;
  gap: 10px;
}

.decimal-bars > div,
.fraction-bar-wrap {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #16465d;
  font-weight: 950;
}

.tenths-bar,
.fraction-bar {
  display: grid;
  gap: 3px;
  min-height: 34px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.tenths-bar {
  grid-template-columns: repeat(10, 1fr);
}

.tenths-blocks {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tenths-blocks .tenths-bar {
  min-height: 24px;
  padding: 3px;
}

.tenths-bar span,
.fraction-bar span {
  min-width: 0;
  border-radius: 4px;
  background: #e7eef0;
}

.tenths-bar span.filled,
.fraction-bar span.filled {
  background: var(--yellow);
}

.fraction-equation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 38px;
  font-weight: 950;
}

.story-card {
  display: grid;
  gap: 14px;
}

.story-scene {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 10px;
}

.story-group {
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  display: flex;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.story-item {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 26px;
  line-height: 1;
}

.story-problem {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.55;
}

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

.equation-option {
  min-height: 88px;
  font-size: 28px;
  white-space: normal;
}

.journey-progress {
  width: min(860px, 100%);
  margin: 16px auto 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #eef3f3;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--yellow));
  transition: width .24s ease;
}

.feedback {
  min-height: 58px;
  color: var(--muted);
  text-align: center;
}

.feedback .celebrate {
  font-size: 58px;
  line-height: 1;
}

.small-celebrate {
  font-size: 42px !important;
}

.feedback-title {
  color: var(--blue);
  font-size: 23px;
  font-weight: 950;
}

.feedback-title.success {
  color: #34875c;
}

.feedback-title.warm {
  color: #9b661e;
}

.attempt-note {
  color: var(--muted);
  font-size: 13px;
}

.journey-break,
.data-error {
  width: min(680px, 100%);
  margin: 28px auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  text-align: center;
}

.journey-break img {
  width: 104px;
  height: 104px;
  margin: 0 auto;
}

.journey-break h2,
.data-error h2 {
  margin: 8px 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.25;
}

.result-card {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.grade-mark {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--yellow);
  color: #3a2908;
  font-size: 64px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 14px 30px rgba(172, 115, 24, .14);
}

.grade-a {
  background: var(--green);
  color: #143d29;
}

.grade-b {
  background: var(--blue);
  color: #10374b;
}

.grade-d,
.grade-e {
  background: var(--red);
  color: #5a221f;
}

.data-error {
  text-align: left;
}

.data-error-icon {
  font-size: 48px;
  text-align: center;
}

.data-error ul {
  margin: 14px 0;
  padding-left: 22px;
  color: #7b3833;
}

.data-error-tip,
.error-more {
  margin-top: 10px;
  color: var(--muted);
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #16465d;
}

.runtime-error {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;
  padding: 16px;
  background: #a83232;
  color: #fff;
  font-family: Consolas, monospace;
  font-size: 14px;
  white-space: pre-wrap;
}

@media (max-width: 1050px) {
  .start-screen {
    grid-template-columns: 1fr;
  }

  .hero-map {
    min-height: 160px;
    padding: 14px;
  }

  .hero-map img {
    width: 260px;
  }

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

@media (max-width: 720px) {
  /* UI 质检修复：100vw 包含滚动条宽度，带滚动条时比可视区宽约 17px → 页面横向漂移。
     改用 100%（基于父级，不含滚动条），任何环境零横向溢出。 */
  html,
  body {
    width: 100%;
    min-width: 320px;
  }

  body {
    font-size: 16px;
  }

  .app {
    width: 100%;
    padding: 14px;
  }

  .app-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 12px;
  }

  .brand-badge {
    width: 44px;
    height: 44px;
    padding: 6px;
  }

  header h1 {
    font-size: 27px;
  }

  header .subtitle {
    font-size: 13px;
    line-height: 1.45;
  }

  .today-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .today-stats span {
    min-width: 0;
    min-height: 30px;
    padding: 4px 4px;
    font-size: 12px;
  }

  .start-screen {
    gap: 12px;
    padding: 12px 0 16px;
  }

  .adventure-panel {
    order: 2;
    gap: 10px;
  }

  .hero-map {
    order: 1;
    min-height: 96px;
    padding: 8px;
  }

  .hero-map img {
    width: 184px;
  }

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

  .module-card {
    min-height: 82px;
    padding: 10px 9px;
  }

  .module-card[data-module="story"] {
    grid-column: span 2;
  }

  .module-card::after {
    right: -56px;
    bottom: -62px;
  }

  .module-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
    font-size: 18px;
  }

  .module-title {
    font-size: 17px;
  }

  .module-copy {
    display: none;
  }

  .option-panel,
  .challenge-panel {
    padding: 10px;
  }

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

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

  .mode-btn {
    min-height: 58px;
    font-size: 13px;
  }

  .mode-btn .icon {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .grade-btn {
    min-height: 40px;
    font-size: 13px;
  }

  .btn {
    min-height: 46px;
    padding: 10px 22px;
    font-size: 16px;
  }

  .train-area {
    padding-top: 14px;
  }

  .task-card {
    padding: 16px;
  }

  .task-top {
    font-size: 13px;
  }

  .char-display .big-char {
    font-size: 96px;
  }

  .char-display .pinyin {
    font-size: 24px;
  }

  .task-prompt,
  .task-hint {
    font-size: 16px;
  }

  .hint {
    padding: 16px;
  }

  .hint .emoji {
    font-size: 58px;
  }

  .options {
    gap: 8px;
  }

  .option-btn {
    min-height: 84px;
    padding: 10px 8px;
    font-size: 38px;
  }

  .number-option {
    font-size: 34px;
  }

  .slot {
    width: 86px;
    min-height: 100px;
  }

  .draggable-part {
    min-height: 72px;
    font-size: 40px;
  }

  .pinyin-large,
  .pinyin-display {
    font-size: 70px;
  }

  .pinyin-options .pinyin-option {
    font-size: 34px;
  }

  .bridge-visual {
    gap: 8px;
    font-size: 36px;
  }

  .bridge-visual span {
    min-width: 58px;
    min-height: 50px;
  }

  .pinyin-word {
    font-size: 74px;
  }

  .mouth-card {
    width: 92px;
    height: 92px;
  }

  .math-title {
    min-width: 112px;
    min-height: 50px;
    font-size: 28px;
  }

  .math-array {
    --dot-size: 20px;
  }

  .target-grid {
    --cell-size: 28px;
  }

  .addsub-groups {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .operation-sign {
    min-height: 18px;
    font-size: 28px;
    line-height: 1;
  }

  .addsub-group {
    min-height: 72px;
  }

  .number-line {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .decimal-bars > div,
  .fraction-bar-wrap {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .fraction-equation {
    font-size: 30px;
  }

  .story-problem {
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 17px;
  }

  .story-listen,
  .pinyin-listen {
    width: max-content;
  }

  .progress-top {
    align-items: flex-start;
    flex-direction: column;
    font-size: 13px;
  }

  .session-badges {
    justify-content: flex-start;
  }

  #timerText,
  #scoreText,
  #todayMini,
  .score-list span {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .journey-break,
  .data-error {
    padding: 20px;
  }

  .journey-break h2,
  .data-error h2 {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .app-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    overflow: visible;
  }

  .brand-badge {
    align-self: center;
  }

  .app-header > div:nth-child(2) {
    min-width: 0;
  }

  header h1 {
    font-size: 24px;
    width: 100%;
    min-width: 12em;
    white-space: nowrap;
    line-height: 1.15;
  }

  header .subtitle {
    width: 100%;
    max-width: none;
    min-width: 18em;
    white-space: normal;
  }

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

  .mode-selector,
  .pinyin-route-selector,
  .difficulty-selector,
  .time-selector,
  .equation-options {
    grid-template-columns: 1fr;
  }

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

  .module-card[data-module="story"] {
    grid-column: span 2;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* === 初中物理观察站 === */
.physics-card {
  border-color: rgba(47, 125, 136, .35);
  background: linear-gradient(160deg, #f7ffff, #edf7fa 58%, #fff);
}

.physics-topic-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(47, 125, 136, .24);
  border-radius: var(--radius);
  color: #245d65;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
}

.physics-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid rgba(47, 125, 136, .24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #dff4f2, #f9fffe 64%, #fff1c8);
}

.physics-visual::before,
.physics-visual::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(47, 125, 136, .35);
  z-index: 0;
}

.physics-visual::before {
  width: 72%;
  height: 42px;
  border-width: 3px 0;
  transform: rotate(-8deg);
}

.physics-visual::after {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  top: 10%;
  right: 8%;
  transform: none;
}

.physics-visual-icon {
  position: relative;
  z-index: 2;
  display: block;
  font-size: clamp(120px, 22vw, 220px);
  line-height: 1;
}

.physics-visual-mark {
  position: absolute;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 3px solid #2f7d88;
  border-radius: 50%;
  background: #fff;
}

/* 装饰点用百分比锚定在容器角落，任何宽度都不会被裁切或压住图标 */
.physics-visual-mark.mark-one { left: 10%; bottom: 16%; }
.physics-visual-mark.mark-two { right: 10%; bottom: 16%; }

.physics-visual-label {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: #245d65;
  font-size: 18px;
  font-weight: 900;
}

.visual-circuit::before,
.visual-magnet::before,
.visual-electromagnet::before {
  width: 58%;
  height: 100px;
  border: 4px solid #2f7d88;
  border-radius: 28px;
  transform: none;
}

.visual-light::after,
.visual-heat::after,
.visual-energy::after {
  border-color: #d89422;
  transform: rotate(25deg);
}

/* 题库中的视觉类型共享清晰的图形骨架，避免未知类型退化为空白。 */
.visual-air::before,
.visual-waves::before,
.visual-fall::before,
.visual-track::before,
.visual-spring::before,
.visual-balance::before,
.visual-beaker::before,
.visual-boat::before,
.visual-clock::before,
.visual-drum::before,
.visual-melt::before,
.visual-piston::before,
.visual-pot::before,
.visual-ruler::before,
.visual-thermo::before,
.visual-circuit-parallel::before,
.visual-coil::before,
.visual-vacuum::before {
  width: 64%;
  height: 104px;
  border: 4px solid rgba(47, 125, 136, .78);
  border-radius: 24px;
  transform: none;
}

.physics-chain {
  position: absolute;
  z-index: 3;
  left: 12px;
  right: 12px;
  bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #245d65;
  font-size: 14px;
  font-weight: 900;
}

.physics-chain-step {
  min-width: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 125, 136, .35);
  border-radius: 6px;
  background: rgba(255, 255, 255, .9);
  text-align: center;
}

.physics-chain-arrow {
  color: #d89422;
  font-size: 18px;
}

.physics-question {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
}

.physics-question p {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.55;
}

.physics-listen {
  min-width: 58px;
}

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

.physics-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 66px;
  text-align: left;
}

.physics-option-index {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2f7d88;
  font-size: 14px;
  font-weight: 950;
}

.physics-option:disabled {
  cursor: default;
  transform: none;
}

/* 物理题的前两次错答仍需允许重试，第三次才揭示答案。 */
.physics-option.wrong {
  pointer-events: auto;
}

.physics-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.physics-feedback p { margin: 0 0 6px; }

.physics-feedback-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2f7d88;
  font-weight: 950;
}

.physics-controls { margin-top: 10px; }

@media (max-width: 640px) {
  .physics-topic-selector,
  .physics-options {
    grid-template-columns: 1fr;
  }

  .physics-question {
    grid-template-columns: 1fr;
  }

  /* 手机宽度：视觉区与装饰元素整体缩小（图标由 clamp 自动缩放），全部锚定在容器内 */
  .physics-visual { min-height: 240px; }
  .physics-visual::after { width: 56px; height: 56px; top: 8%; right: 8%; }
  .physics-visual-mark { width: 16px; height: 16px; border-width: 2px; }
  .physics-visual-mark.mark-one { left: 8%; bottom: 12%; }
  .physics-visual-mark.mark-two { right: 8%; bottom: 12%; }
  .physics-visual-label { right: 10px; bottom: 8px; font-size: 14px; }
}

/* ===== 批次C ===== */
/* 减法应用题场景中"拿走"的物品：淡出 + 删除线，示意这部分被移走 */
.story-item-gone {
  opacity: .45;
  text-decoration: line-through;
}

/* ===== 批次D ===== */
/* 档位 C（60-74 分）：介于 B（蓝）与 D/E（红）之间的过渡警示色——黄 */
.grade-c {
  background: var(--yellow);
  color: #5c4713;
}
