:root {
  --ink: #403653;
  --ink-2: #5a4b73;
  --ink-3: #756987;
  --paper: #fff9fc;
  --paper-2: #f4f0ff;
  --mint: #48cdb5;
  --mint-deep: #167d72;
  --coral: #ff7196;
  --amber: #ffca62;
  --amber-deep: #92580b;
  --sky: #75c9ff;
  --line: rgba(75, 54, 99, .12);
  --shadow: 0 18px 48px rgba(103, 76, 128, .12);
  --radius: 24px;
  --rail-a: #fff0f7;
  --rail-b: #e9f9ff;
  --rail-c: #f0ebff;
  --rail-glow-1: rgba(255, 113, 150, .25);
  --rail-glow-2: rgba(117, 201, 255, .3);
  --rail-text: var(--ink);
  --rail-muted: var(--ink-3);
  --rail-surface: rgba(255, 255, 255, .7);
  --rail-surface-strong: rgba(255, 255, 255, .9);
  --rail-border: rgba(87, 64, 111, .13);
  --rail-grid: rgba(116, 88, 141, .07);
  --rail-shadow: rgba(91, 63, 116, .09);
  --stage-a: #fffafd;
  --stage-b: #f5f1ff;
  --stage-glow-1: rgba(117, 201, 255, .23);
  --stage-glow-2: rgba(255, 113, 150, .13);
  --action-edge: #116e65;
  --action-shadow: rgba(22, 125, 114, .22);
  --coral-deep: #a93d61;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

html[data-theme="sky"] {
  --ink: #324a68; --ink-2: #45698d; --ink-3: #6986a2; --paper: #f9fdff; --paper-2: #eaf6ff;
  --mint: #5bbdf4; --mint-deep: #276f9f; --coral: #ff859d; --amber: #ffd568; --amber-deep: #8a5b00; --sky: #8bd9ff;
  --rail-a: #e8f7ff; --rail-b: #edf3ff; --rail-c: #f2fbff; --rail-glow-1: rgba(91, 189, 244, .32); --rail-glow-2: rgba(255, 213, 104, .32);
  --stage-a: #fbfeff; --stage-b: #edf8ff; --stage-glow-1: rgba(91, 189, 244, .23); --stage-glow-2: rgba(255, 213, 104, .13);
  --action-edge: #205f89; --action-shadow: rgba(39, 111, 159, .21); --coral-deep: #a9445c;
}

/* 首页：沿用课堂侧栏的整高尺寸，入口内容独立保留。 */
.home-screen {
  height: 100dvh; min-height: 100dvh; position: relative; overflow: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 76% 20%, var(--rail-surface-strong), transparent 42%),
    linear-gradient(135deg, var(--rail-a), var(--rail-b) 48%, var(--rail-c));
}
.home-content {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: clamp(236px, 24vw, 330px) minmax(0, 1fr);
  width: 100%; height: 100%; margin: 0;
}
.home-orbit { position: absolute; pointer-events: none; border: 1px solid color-mix(in srgb, var(--coral) 20%, transparent); border-radius: 50%; }
.home-orbit-one { width: 360px; height: 360px; right: -160px; top: -150px; box-shadow: 0 0 0 24px color-mix(in srgb, var(--sky) 8%, transparent), 0 0 0 48px color-mix(in srgb, var(--coral) 6%, transparent); }
.home-orbit-two { width: 240px; height: 240px; right: 16%; bottom: -160px; border-color: color-mix(in srgb, var(--mint) 20%, transparent); }

.home-side-nav {
  position: relative; min-width: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: clamp(14px, 2.3dvh, 24px);
  padding: clamp(18px, 2vw, 28px);
  color: var(--rail-text);
  background: radial-gradient(circle at 15% 12%, var(--rail-glow-1), transparent 26%),
    radial-gradient(circle at 86% 42%, var(--rail-glow-2), transparent 29%),
    linear-gradient(158deg, var(--rail-a), var(--rail-b) 58%, var(--rail-c));
  box-shadow: inset -1px 0 var(--rail-border), 10px 0 32px var(--rail-shadow);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--rail-border) transparent;
}
.home-side-nav::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--rail-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rail-grid) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.home-side-nav > * { position: relative; z-index: 1; flex-shrink: 0; }
.home-brand { min-height: 58px; display: flex; align-items: center; gap: 12px; }
.home-brand .brand-orbit { flex: 0 0 46px; width: 46px; height: 46px; }
.home-brand strong { display: block; font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -.04em; white-space: nowrap; }
.home-brand small { display: block; margin-top: 4px; color: var(--rail-muted); font-size: 10px; font-weight: 800; letter-spacing: .2em; }

.home-class-card {
  display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 14px;
  min-height: 106px; padding: 18px 14px; border: 1px solid var(--rail-border); border-radius: 22px;
  background: linear-gradient(135deg, var(--rail-surface-strong), var(--rail-surface));
  box-shadow: 0 10px 24px var(--rail-shadow), inset 0 1px rgba(255,255,255,.84);
}
.home-class-avatar { display: grid; place-items: center; width: 58px; height: 58px; font-size: 34px; border-radius: 20px; background: color-mix(in srgb, var(--coral) 12%, #fff); }
.home-class-card strong { display: block; font-size: 20px; }
.home-class-card small { display: block; margin-top: 6px; color: var(--rail-muted); font-size: 12px; }
.home-side-nav nav { display: grid; gap: 10px; }
.home-side-nav nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  min-height: clamp(54px, 6.8dvh, 72px); padding: 10px 14px;
  border: 1px solid var(--rail-border); border-radius: 16px;
  color: var(--rail-text); background: var(--rail-surface); box-shadow: 0 6px 16px var(--rail-shadow);
  font-size: 16px; font-weight: 850; text-align: left;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.home-nav-icon { flex: 0 0 32px; display: grid; place-items: center; width: 32px; height: 32px; font-size: 21px; border-radius: 10px; background: rgba(255,255,255,.48); }
.home-nav-arrow { margin-left: auto; color: var(--rail-muted); font-size: 24px; line-height: 1; }
.home-side-nav nav button:hover { background: var(--rail-surface-strong); border-color: var(--mint); transform: translateX(2px); }
.home-side-nav nav button.is-active { color: #fff; background: linear-gradient(135deg, var(--ink-2), var(--ink)); border-color: transparent; }
.home-side-nav nav button.is-active .home-nav-icon { background: rgba(255,255,255,.15); }
.home-side-nav nav button.is-active .home-nav-arrow { color: rgba(255,255,255,.78); }
.home-side-nav nav button[aria-pressed="false"] .home-nav-icon { background: color-mix(in srgb, var(--coral) 12%, #fff); }
.home-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.home-toolbar button { min-width: 0; min-height: 50px; padding: 10px 6px; border: 1px solid var(--rail-border); border-radius: 14px; color: var(--rail-text); background: var(--rail-surface-strong); font-size: 13px; font-weight: 850; box-shadow: 0 6px 16px var(--rail-shadow); }
.home-toolbar button:hover { border-color: var(--mint); color: var(--mint-deep); }
.home-side-note { margin: auto 0 0; padding-top: 4px; color: var(--rail-muted); font-size: 12px; line-height: 1.7; text-align: center; }

.home-main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; padding: clamp(24px, 3.2vw, 64px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.home-hero { flex: 1 0 auto; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: clamp(16px, 2.4vw, 48px); min-width: 0; padding-block: 12px; }
.home-copy { min-width: 0; container-type: inline-size; }
.home-kicker { color: var(--mint-deep); font-size: 11px; font-weight: 950; letter-spacing: .12em; line-height: 1.6; }
.home-copy h1 { margin: 16px 0; font-size: clamp(30px, 4.4vw, 86px); font-size: clamp(30px, 14.8cqw, 86px); line-height: 1.14; letter-spacing: -.045em; white-space: nowrap; }
.home-copy h1 span { display: block; font-size: .86em; color: var(--coral-deep); white-space: nowrap; }
.home-copy > p { margin: 0; max-width: 620px; color: var(--ink-3); font-size: clamp(14px, 1.3vw, 20px); line-height: 1.8; }
.home-mascot-wrap { position: relative; display: grid; place-items: center; min-width: 0; }
.home-mascot { width: 100%; max-width: 580px; height: min(70dvh, 660px); object-fit: contain; filter: drop-shadow(0 20px 16px rgba(83,61,104,.18)); }
.mascot-bubble { position: absolute; top: 3%; right: 0; padding: 11px 16px; border-radius: 18px 18px 4px 18px; color: var(--ink-2); background: #fff; box-shadow: 0 8px 20px var(--rail-shadow); font-size: 13px; font-weight: 850; }

.home-password { width: 100%; max-width: 660px; margin: 28px 0 0; padding: 20px; border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent); border-radius: 24px; background: linear-gradient(135deg, var(--rail-surface-strong), var(--rail-surface)); box-shadow: 0 14px 30px var(--rail-shadow); }
.home-password label { display: block; margin-bottom: 10px; color: var(--ink-2); font-size: 15px; font-weight: 900; }
.password-row { display: flex; gap: 10px; min-width: 0; }
.password-row input { flex: 1; width: 0; min-width: 0; min-height: 54px; padding: 0 14px; border: 2px solid color-mix(in srgb, var(--mint) 60%, #fff); border-radius: 16px; color: var(--ink); background: #fff; font-size: 16px; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--mint) 8%, transparent); }
.password-row input::placeholder { color: var(--ink-3); }
.password-row button { flex: 0 0 auto; min-height: 54px; padding: 0 20px; border-radius: 16px; color: #fff; background: linear-gradient(100deg, var(--coral), var(--mint-deep)); box-shadow: 0 7px 14px var(--rail-shadow); font-size: 15px; font-weight: 900; }
.home-password[data-unlocked="true"] .password-row input { display: none; }
.home-password[data-unlocked="true"] .password-row button { flex: 1 1 auto; width: 100%; }
.home-password[data-unlocked="true"] label::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; color: #fff; background: var(--mint-deep); font-size: 12px; }
.home-password p { margin: 10px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.home-password p:empty { display: none; }
.home-password p.error { color: var(--coral-deep); }
.home-footer { flex: 0 0 auto; margin-top: 22px; color: var(--ink-3); text-align: center; font-size: 11px; line-height: 1.7; }

@media (max-width: 1180px) {
  .home-side-nav { padding: 18px; }
  .home-brand { gap: 10px; }
  .home-brand strong { font-size: 20px; }
  .home-class-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 16px 12px; min-height: 96px; }
  .home-class-avatar { width: 48px; height: 48px; font-size: 30px; border-radius: 16px; }
  .home-class-card strong { font-size: 18px; }
  .home-side-nav nav button { padding-inline: 10px; gap: 9px; font-size: 15px; }
  .home-main { padding: 24px; }
  .home-password { padding: 16px; }
  .password-row button { padding-inline: 14px; }
}
@media (max-width: 960px) {
  .home-content { grid-template-columns: 220px minmax(0, 1fr); }
  .home-side-nav { padding: 14px; }
  .home-brand .brand-orbit { flex-basis: 40px; width: 40px; height: 40px; }
  .home-brand strong { font-size: 18px; }
  .home-brand small { font-size: 9px; letter-spacing: .13em; }
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .home-mascot-wrap { justify-self: center; width: min(340px, 82%); }
  .home-mascot { height: min(34dvh, 340px); }
}
@media (max-width: 700px) {
  .home-screen { height: auto; min-height: 100dvh; overflow: visible; }
  .home-content { height: auto; grid-template-columns: minmax(0, 1fr); }
  .home-side-nav { height: auto; padding: 18px; gap: 14px; }
  .home-class-card { grid-template-columns: 44px minmax(0, 1fr); min-height: 72px; padding: 10px 14px; }
  .home-class-avatar { width: 44px; height: 44px; font-size: 28px; }
  .home-side-nav nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-side-nav nav button:last-child { grid-column: 1 / -1; }
  .home-side-nav nav button { min-height: 54px; }
  .home-toolbar button { min-height: 46px; }
  .home-side-note { padding: 0; }
  .home-main { height: auto; overflow: visible; padding: 24px 18px; }
  .home-hero { padding-block: 4px; }
  .home-mascot-wrap { width: min(300px, 80%); }
  .home-mascot { height: 290px; }
  .home-password { margin-top: 22px; }
}
@media (max-width: 380px) {
  .password-row { flex-direction: column; }
  .password-row input { width: 100%; }
  .password-row button { width: 100%; }
}
@media (max-height: 700px) and (min-width: 701px) {
  .home-side-nav { gap: 12px; }
  .home-brand { min-height: 48px; }
  .home-class-card { min-height: 82px; padding-block: 12px; }
  .home-side-nav nav { gap: 8px; }
  .home-side-nav nav button { min-height: 50px; }
  .home-toolbar button { min-height: 46px; }
}

html[data-theme="forest"] {
  --ink: #365341; --ink-2: #4b7157; --ink-3: #6f8b76; --paper: #fbfff7; --paper-2: #eef9e8;
  --mint: #60cb83; --mint-deep: #2a7649; --coral: #ff8c75; --amber: #ffd064; --amber-deep: #835a08; --sky: #82daca;
  --rail-a: #efffe8; --rail-b: #e7f9ef; --rail-c: #fff9df; --rail-glow-1: rgba(96, 203, 131, .3); --rail-glow-2: rgba(255, 208, 100, .34);
  --stage-a: #fcfff9; --stage-b: #eff9e9; --stage-glow-1: rgba(130, 218, 202, .2); --stage-glow-2: rgba(255, 208, 100, .14);
  --action-edge: #23643e; --action-shadow: rgba(42, 118, 73, .21); --coral-deep: #a84d39;
}

html[data-theme="galaxy"] {
  --ink: #4a3e6b; --ink-2: #655487; --ink-3: #81759b; --paper: #fdfaff; --paper-2: #f1edff;
  --mint: #6bd0ce; --mint-deep: #6752a8; --coral: #f27faf; --amber: #ffd570; --amber-deep: #865b08; --sky: #a99cf4;
  --rail-a: #f2ebff; --rail-b: #eaf2ff; --rail-c: #fff0fa; --rail-glow-1: rgba(169, 156, 244, .34); --rail-glow-2: rgba(242, 127, 175, .3);
  --stage-a: #fefbff; --stage-b: #f2efff; --stage-glow-1: rgba(169, 156, 244, .23); --stage-glow-2: rgba(242, 127, 175, .12);
  --action-edge: #59448f; --action-shadow: rgba(103, 82, 168, .22); --coral-deep: #a5456e;
}

html[data-theme="sports"] {
  --ink: #344c5b; --ink-2: #49697a; --ink-3: #6f8996; --paper: #f9fefd; --paper-2: #eaf8f4;
  --mint: #41ce99; --mint-deep: #19775b; --coral: #ff745f; --amber: #ffcb59; --amber-deep: #885800; --sky: #62c4ea;
  --rail-a: #eafbf4; --rail-b: #eaf7ff; --rail-c: #fff1e9; --rail-glow-1: rgba(65, 206, 153, .31); --rail-glow-2: rgba(255, 116, 95, .28);
  --stage-a: #fbfffe; --stage-b: #edf8f5; --stage-glow-1: rgba(98, 196, 234, .21); --stage-glow-2: rgba(255, 116, 95, .11);
  --action-edge: #126249; --action-shadow: rgba(25, 119, 91, .22); --coral-deep: #a63d31;
}

html[data-theme="sunny"] {
  --ink: #5c463d; --ink-2: #765d50; --ink-3: #957b6d; --paper: #fffdf7; --paper-2: #fff3e3;
  --mint: #f2a65b; --mint-deep: #965d24; --coral: #ff8975; --amber: #ffda72; --amber-deep: #855800; --sky: #8fd6ca;
  --rail-a: #fff3df; --rail-b: #ffeded; --rail-c: #fff9da; --rail-glow-1: rgba(242, 166, 91, .31); --rail-glow-2: rgba(255, 137, 117, .26);
  --stage-a: #fffef9; --stage-b: #fff3e7; --stage-glow-1: rgba(255, 218, 114, .25); --stage-glow-2: rgba(143, 214, 202, .13);
  --action-edge: #80501e; --action-shadow: rgba(150, 93, 36, .2); --coral-deep: #a64b3b;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, label[for], select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label[for]:focus-visible, .skip-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mint) 48%, transparent);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 200; left: 14px; top: 10px; padding: 11px 15px; border-radius: 12px; color: #fff; background: var(--ink); font-size: 12px; font-weight: 900; transform: translateY(-160%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }

.app-shell {
  display: grid;
  grid-template-columns: clamp(236px, 24vw, 330px) 1fr;
  min-height: 100dvh;
  max-height: 100dvh;
  transition: grid-template-columns .24s ease;
}

.mission-rail {
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 2vw, 28px);
  color: var(--rail-text);
  background:
    radial-gradient(circle at 15% 12%, var(--rail-glow-1), transparent 24%),
    radial-gradient(circle at 86% 40%, var(--rail-glow-2), transparent 27%),
    linear-gradient(158deg, var(--rail-a) 0%, var(--rail-b) 58%, var(--rail-c) 100%);
  overflow: visible;
  position: relative;
  box-shadow: inset -1px 0 var(--rail-border), 10px 0 32px var(--rail-shadow);
  transition: padding .24s ease, gap .24s ease;
}

.mission-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
  background-image:
    linear-gradient(var(--rail-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rail-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
}

.brand-block, .mascot-panel, .round-meters, .history-section, .rail-footer { position: relative; z-index: 1; }

.rail-collapse-button {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: -18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rail-border);
  border-radius: 14px;
  color: var(--rail-text);
  background: var(--rail-surface-strong);
  box-shadow: 0 8px 20px var(--rail-shadow);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.rail-collapse-button:hover { color: var(--mint-deep); background: var(--surface); transform: translateX(2px); }
.rail-collapse-button:focus-visible { outline-color: var(--mint-deep); }

.brand-block { display: flex; align-items: center; gap: 12px; min-height: 54px; }
.brand-block strong { display: block; color: var(--rail-text); font-size: clamp(18px, 1.55vw, 24px); letter-spacing: .04em; }
.brand-block small { display: block; margin-top: 3px; color: var(--rail-muted); font-size: 10px; font-weight: 800; letter-spacing: .24em; }
.brand-orbit {
  width: 48px; height: 48px; border: 2px solid color-mix(in srgb, var(--mint) 58%, transparent); border-radius: 50%;
  display: grid; place-items: center; position: relative; transform: rotate(-18deg);
}
.brand-orbit::before { content: ""; width: 27px; height: 27px; border: 2px solid var(--mint); border-radius: 50%; }
.brand-orbit::after { content: ""; position: absolute; left: 1px; right: 1px; top: 21px; border-top: 2px solid var(--mint); }
.brand-orbit i { position: absolute; width: 8px; height: 8px; right: 1px; top: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 16px var(--amber); }

.mascot-panel {
  min-height: 154px;
  display: grid;
  grid-template-columns: 1fr 96px;
  align-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--rail-border);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--rail-surface-strong), var(--rail-surface));
  box-shadow: 0 10px 24px var(--rail-shadow), inset 0 1px rgba(255, 255, 255, .84);
}
.mascot-copy { min-width: 0; }
.mascot-copy .eyebrow { color: var(--mint-deep); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.mascot-copy strong { display: block; margin: 7px 0; color: var(--rail-text); font-size: 18px; }
.mascot-copy p { margin: 0; color: var(--rail-muted); font-size: 12px; line-height: 1.65; }

.mascot { width: 86px; height: 119px; position: relative; justify-self: end; filter: drop-shadow(0 12px 12px rgba(83, 61, 104, .14)); }
.mascot-image { width: 112px; height: 146px; object-fit: contain; align-self: end; filter: drop-shadow(0 10px 10px rgba(83, 61, 104, .18)); }
.bot-head {
  position: absolute; z-index: 3; top: 17px; left: 9px; width: 68px; height: 56px;
  border: 4px solid var(--ink); border-radius: 24px 24px 20px 20px;
  background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--mint) 20%, #fff));
  box-shadow: inset -8px -7px 0 color-mix(in srgb, var(--mint) 13%, transparent), 0 3px 0 var(--mint);
}
.ear { position: absolute; z-index: 2; top: 34px; width: 13px; height: 25px; border: 3px solid var(--ink); background: var(--amber); }
.ear-left { left: 1px; border-radius: 9px 2px 2px 9px; }
.ear-right { right: 1px; border-radius: 2px 9px 9px 2px; }
.antenna { position: absolute; z-index: 1; top: 0; left: 41px; width: 4px; height: 22px; background: var(--ink); transform: rotate(10deg); transform-origin: bottom; }
.antenna i { position: absolute; width: 12px; height: 12px; left: -4px; top: -5px; border: 3px solid var(--ink); border-radius: 50%; background: var(--coral); box-shadow: 0 0 12px color-mix(in srgb, var(--coral) 72%, transparent); }
.eye { position: absolute; top: 20px; width: 10px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: inset 3px 2px 0 var(--sky); }
.eye-left { left: 15px; } .eye-right { right: 15px; }
.bot-mouth { position: absolute; left: 28px; bottom: 9px; width: 13px; height: 6px; border: 2px solid var(--mint-deep); border-top: 0; border-radius: 0 0 12px 12px; }
.bot-body {
  position: absolute; z-index: 2; top: 71px; left: 19px; width: 49px; height: 42px;
  display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 14px 14px 21px 21px;
  background: linear-gradient(155deg, var(--mint), var(--mint-deep));
}
.bot-body b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--amber); font-size: 13px; }
.arm { position: absolute; z-index: 1; top: 78px; width: 31px; height: 10px; border: 3px solid var(--ink); border-radius: 10px; background: color-mix(in srgb, var(--mint) 28%, #fff); }
.arm-left { left: 0; transform: rotate(-28deg); } .arm-right { right: 0; transform: rotate(28deg); }

/* 原创 Q 版兔子领航员“团团” */
.bunny-mascot { height: 125px; }
.bunny-ear { position: absolute; z-index: 1; top: 0; width: 25px; height: 58px; border: 4px solid var(--ink); border-radius: 55% 55% 42% 42%; background: linear-gradient(145deg, #fff, #ffdce8); transform-origin: bottom center; }
.bunny-ear i { position: absolute; inset: 8px 6px 7px; border-radius: inherit; background: #ffabc8; opacity: .72; }
.bunny-ear-left { left: 17px; transform: rotate(-13deg); }.bunny-ear-right { right: 17px; transform: rotate(13deg); }
.bunny-head { position: absolute; z-index: 3; top: 36px; left: 6px; width: 74px; height: 57px; border: 4px solid var(--ink); border-radius: 48% 48% 43% 43%; background: linear-gradient(145deg, #fff, #fff4fa); box-shadow: inset -7px -7px 0 #ffe8f1, 0 3px 0 #ffabc8; }
.bunny-eye { position: absolute; top: 20px; width: 9px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: inset 2px 2px 0 #fff; }.bunny-eye-left { left: 17px; }.bunny-eye-right { right: 17px; }
.bunny-cheek { position: absolute; top: 34px; width: 12px; height: 7px; border-radius: 50%; background: #ffabc8; opacity: .8; }.bunny-cheek-left { left: 7px; }.bunny-cheek-right { right: 7px; }
.bunny-mouth { position: absolute; left: 31px; bottom: 9px; width: 12px; height: 7px; border: 2px solid var(--mint-deep); border-top: 0; border-radius: 0 0 12px 12px; }
.bunny-body { position: absolute; z-index: 2; top: 88px; left: 21px; width: 45px; height: 35px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 18px 18px 22px 22px; background: linear-gradient(155deg, #ffabc8, #f277a5); }
.bunny-body b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--amber); font-size: 12px; }
.bunny-paw { position: absolute; z-index: 1; top: 97px; width: 22px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }.bunny-paw-left { left: 3px; transform: rotate(26deg); }.bunny-paw-right { right: 3px; transform: rotate(-26deg); }

.round-meters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.round-meters div { min-width: 0; padding: 11px 12px; border-radius: 15px; background: var(--rail-surface); border: 1px solid var(--rail-border); box-shadow: 0 7px 18px var(--rail-shadow); }
.round-meters span { display: block; color: var(--rail-muted); font-size: 10px; font-weight: 800; }
.round-meters strong { display: block; margin-top: 4px; color: var(--rail-text); font-size: 22px; font-variant-numeric: tabular-nums; }
.round-meters div:nth-child(3) strong { color: var(--mint-deep); }
.round-meters div:nth-child(4) strong { color: var(--amber-deep); }

.history-section { min-height: 120px; display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.section-heading > div { display: flex; align-items: center; gap: 8px; }
.section-heading strong { font-size: 13px; letter-spacing: .05em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px var(--mint); }
.text-button { min-width: 44px; min-height: 44px; padding: 7px 9px; color: var(--rail-muted); background: transparent; font-size: 12px; font-weight: 800; }
.text-button:hover { color: var(--mint-deep); }
.history-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--mint) 42%, transparent) transparent; }
.empty-history { display: grid; place-items: center; min-height: 110px; padding: 18px; border: 1px dashed var(--rail-border); border-radius: 16px; color: var(--rail-muted); background: rgba(255, 255, 255, .36); text-align: center; font-size: 12px; line-height: 1.7; }
.history-item { display: grid; grid-template-columns: 27px 1fr auto; gap: 9px; align-items: center; padding: 10px; border-radius: 14px; background: var(--rail-surface); border: 1px solid var(--rail-border); }
.history-outcome { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 900; }
.history-item.correct .history-outcome { color: #174c43; background: color-mix(in srgb, var(--mint) 58%, #fff); }
.history-item.review .history-outcome { color: var(--amber-deep); background: color-mix(in srgb, var(--amber) 62%, #fff); }
.history-copy { min-width: 0; }
.history-copy strong { display: block; overflow: hidden; color: var(--rail-text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-copy small { display: block; overflow: hidden; margin-top: 2px; color: var(--rail-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.history-number { color: var(--rail-muted); font-size: 10px; font-weight: 800; }

.rail-footer { display: grid; gap: 7px; padding-top: 2px; }
.rail-button { width: 100%; min-height: 45px; border: 1px solid var(--rail-border); border-radius: 14px; color: var(--rail-text); background: var(--rail-surface); box-shadow: 0 6px 16px var(--rail-shadow); font-weight: 800; }
.rail-button:hover { border-color: color-mix(in srgb, var(--mint) 42%, var(--rail-border)); background: var(--rail-surface-strong); }
.rail-button:disabled { opacity: .58; box-shadow: none; cursor: default; }
.review-rail-button { position: relative; border-color: color-mix(in srgb, var(--amber) 48%, var(--rail-border)); color: var(--amber-deep); }
.review-rail-button em { font-style: normal; }
.review-rail-button b { min-width: 22px; height: 22px; display: inline-grid; place-items: center; margin-left: 5px; border-radius: 8px; color: var(--amber-deep); background: var(--amber); font-size: 10px; }
.rail-footer p { margin: 9px 0 0; color: var(--rail-muted); text-align: center; font-size: 10px; }

.app-shell.rail-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.app-shell.rail-collapsed .mission-rail { gap: 10px; padding: 72px 9px 12px; }
.app-shell.rail-collapsed .rail-collapse-button { top: 16px; right: 50%; transform: translateX(50%); }
.app-shell.rail-collapsed .rail-collapse-button:hover { transform: translateX(50%) translateY(-2px); }
.app-shell.rail-collapsed .brand-block { justify-content: center; min-height: 48px; }
.app-shell.rail-collapsed .brand-block > div { display: none; }
.app-shell.rail-collapsed .brand-orbit { flex: 0 0 44px; width: 44px; height: 44px; }
.app-shell.rail-collapsed .mascot-panel { min-height: 68px; height: 68px; display: grid; grid-template-columns: 1fr; padding: 3px; border-radius: 18px; }
.app-shell.rail-collapsed .mascot-copy { display: none; }
.app-shell.rail-collapsed .mascot-image { width: 62px; height: 64px; justify-self: center; align-self: center; transform: none; }
.app-shell.rail-collapsed .round-meters { grid-template-columns: 1fr; gap: 6px; }
.app-shell.rail-collapsed .round-meters div { padding: 7px 2px; border-radius: 12px; text-align: center; }
.app-shell.rail-collapsed .round-meters span { font-size: 8px; line-height: 1.25; white-space: nowrap; }
.app-shell.rail-collapsed .round-meters strong { margin-top: 2px; font-size: 18px; line-height: 1.1; }
.app-shell.rail-collapsed .history-section { display: none; }
.app-shell.rail-collapsed .rail-footer { margin-top: auto; }
.app-shell.rail-collapsed #undoButton,
.app-shell.rail-collapsed #resetRoundButton,
.app-shell.rail-collapsed .rail-footer p { display: none; }
.app-shell.rail-collapsed .review-rail-button { min-height: 56px; padding: 5px; border-radius: 16px; }
.app-shell.rail-collapsed .review-rail-button > span,
.app-shell.rail-collapsed .review-rail-button > em { display: none; }
.app-shell.rail-collapsed .review-rail-button b { margin: 0; }

.stage {
  height: 100dvh;
  min-width: 0;
  position: relative;
  overflow: auto;
  padding: 0 clamp(22px, 4vw, 64px) 32px;
  background:
    radial-gradient(circle at 90% 12%, var(--stage-glow-1), transparent 24%),
    radial-gradient(circle at 15% 88%, var(--stage-glow-2), transparent 25%),
    linear-gradient(145deg, var(--stage-a), var(--stage-b));
}
.stage::before { content: ""; position: absolute; top: 105px; right: 4vw; width: 88px; height: 88px; border: 1px solid rgba(13, 72, 90, .08); border-radius: 50%; box-shadow: 0 0 0 18px rgba(13, 72, 90, .025), 0 0 0 36px rgba(13, 72, 90, .02); pointer-events: none; }

.topbar { min-height: 78px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 10px; position: relative; z-index: 3; border-bottom: 1px solid var(--line); }
.class-context { flex: 1 1 140px; min-width: 0; }
.class-context span { display: block; color: #6d899e; font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.class-context strong { display: block; max-width: 44vw; overflow: hidden; margin-top: 4px; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; max-width: 100%; min-width: 0; gap: 8px; margin-left: auto; }
.icon-button, .top-button { min-width: 45px; min-height: 45px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255, 255, 255, .72); box-shadow: 0 4px 13px rgba(7, 27, 51, .04); font-weight: 900; }
.top-button { gap: 7px; padding: 0 15px; }
/* Utility actions retain both the icon and its meaning at every breakpoint. */
.top-button.utility-button { width: auto; min-width: 88px; min-height: 45px; flex-shrink: 0; padding: 0 12px; gap: 7px; font-size: 13px; white-space: nowrap; }
.top-button.utility-button > .toolbar-symbol { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; font-size: 19px; line-height: 1; }
.top-button.utility-button > .toolbar-label { display: inline; font-size: 13px; line-height: 1.4; }
.top-button.home-return-button { flex-shrink: 0; width: auto; min-width: 92px; padding-inline: 12px; color: var(--mint-deep); border-color: color-mix(in srgb, var(--mint) 42%, var(--line)); background: var(--rail-surface-strong); font-size: 13px; white-space: nowrap; }
.icon-button:hover, .top-button:hover { border-color: rgba(19, 155, 137, .35); background: #fff; }
.icon-button[aria-pressed="false"] { color: #94a4b1; text-decoration: line-through; }
.mode-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .62); }
.mode-switch button { min-height: 44px; padding: 0 12px; border-radius: 10px; color: #72889a; background: transparent; font-size: 12px; font-weight: 900; }
.mode-switch button.active { color: #fff; background: var(--ink-2); box-shadow: 0 4px 10px rgba(7, 27, 51, .16); }

.mission-intro { min-height: 136px; display: flex; align-items: center; justify-content: space-between; gap: 30px; position: relative; z-index: 1; }
.mission-kicker { color: var(--mint-deep); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.mission-kicker b { display: inline-grid; place-items: center; min-width: 25px; height: 21px; margin-left: 4px; border-radius: 7px; color: #fff; background: var(--coral); letter-spacing: 0; }
.mission-intro h1 { margin: 9px 0 6px; font-size: clamp(26px, 3.2vw, 46px); line-height: 1.1; letter-spacing: -.045em; }
.mission-intro h1 span { color: var(--mint-deep); }
.mission-intro p { margin: 0; color: #688197; font-size: clamp(12px, 1vw, 14px); }
.signal { height: 52px; display: flex; align-items: end; gap: 6px; padding-right: 14px; }
.signal i { width: 7px; border-radius: 9px; background: linear-gradient(to top, var(--mint), var(--sky)); animation: signal 1.15s ease-in-out infinite alternate; }
.signal i:nth-child(1) { height: 17px; animation-delay: -.4s; }.signal i:nth-child(2) { height: 36px; animation-delay: -.8s; }.signal i:nth-child(3) { height: 50px; animation-delay: -.2s; }.signal i:nth-child(4) { height: 29px; animation-delay: -.6s; }.signal i:nth-child(5) { height: 12px; }
@keyframes signal { to { transform: scaleY(.45); opacity: .45; } }

.draw-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(16px, 2vw, 26px); position: relative; z-index: 1; }
.draw-card {
  min-height: clamp(300px, 43vh, 470px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid rgba(7, 27, 51, .11);
  border-radius: clamp(22px, 2.4vw, 34px);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.draw-card::before { content: ""; position: absolute; z-index: -1; width: 230px; height: 230px; right: -100px; top: -100px; border-radius: 50%; opacity: .16; }
.student-card::before { background: var(--sky); }
.word-card::before { background: var(--mint); }
.draw-card::after { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 100%; }
.student-card::after { background: linear-gradient(var(--sky), #478bd3); }
.word-card::after { background: linear-gradient(var(--mint), var(--mint-deep)); }
.card-topline { position: absolute; left: clamp(22px, 3vw, 38px); right: clamp(22px, 3vw, 38px); top: 22px; display: flex; align-items: center; gap: 10px; }
.card-index { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #6f8798; font-size: 10px; font-weight: 900; }
.card-label { color: var(--ink); font-size: 14px; font-weight: 900; }
.card-state { margin-left: auto; color: #8aa0ad; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.display-value { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); text-align: center; font-weight: 950; line-height: 1.05; text-wrap: balance; }
.student-value { font-size: clamp(50px, 6vw, 94px); }
.word-value { font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: clamp(52px, 6.6vw, 108px); letter-spacing: -.04em; }
.word-pronunciation { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 7px; width: min(100%, 360px); margin: 16px auto 0; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--mint) 20%, var(--line)); border-radius: 13px; color: var(--ink-3); background: color-mix(in srgb, var(--mint) 7%, #fff); font-size: 10px; }
.word-pronunciation span { color: var(--mint-deep); font-weight: 900; }.word-pronunciation strong { color: var(--ink-2); font-family: "Segoe UI", sans-serif; font-size: 12px; letter-spacing: .02em; }
.display-value.long-value { font-size: clamp(32px, 4.6vw, 68px); line-height: 1.16; }
.display-value.very-long-value { font-size: clamp(24px, 3.4vw, 50px); line-height: 1.2; }
.draw-card > p { min-height: 22px; margin: 24px 0 0; color: #8093a3; text-align: center; font-size: clamp(13px, 1.05vw, 15px); line-height: 1.5; }
.scan-line { position: absolute; left: 8%; right: 8%; bottom: 18px; height: 2px; overflow: hidden; background: linear-gradient(90deg, transparent, rgba(19, 155, 137, .18), transparent); }
.scan-line::after { content: ""; position: absolute; width: 22%; height: 100%; background: linear-gradient(90deg, transparent, var(--mint), transparent); transform: translateX(-100%); }
.rolling .scan-line::after { animation: scan 1s linear infinite; }
.rolling .display-value { animation: flicker .13s linear infinite alternate; }
@keyframes scan { to { transform: translateX(530%); } }
@keyframes flicker { to { opacity: .55; transform: translateY(1px); } }
.locked { animation: lockCard .42s cubic-bezier(.2, .85, .3, 1.35); }
@keyframes lockCard { 0% { transform: scale(.96); } 65% { transform: scale(1.025); } 100% { transform: scale(1); } }

.answer-deck { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(300px, 1.25fr); gap: 18px; margin-top: 18px; position: relative; z-index: 1; }
.answer-main, .example-block { padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .7); }
.answer-main span, .example-block span { display: block; margin-bottom: 5px; color: #7890a0; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.answer-main strong { color: var(--coral); font-size: clamp(20px, 2vw, 30px); overflow-wrap: anywhere; }
.answer-main strong.long-value { font-size: clamp(18px, 1.7vw, 25px); }.answer-main strong.very-long-value { font-size: clamp(16px, 1.45vw, 21px); line-height: 1.4; }
.example-block p { margin: 0; color: var(--ink); font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 15px; font-weight: 800; }
.example-block small { display: block; margin-top: 5px; color: #6e8393; line-height: 1.5; }

.evaluation-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.evaluation-button { min-height: 64px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .75); text-align: left; }
.evaluation-button > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; font-weight: 950; }
.evaluation-button b { color: var(--ink); font-size: 14px; }
.evaluation-button small { color: #8698a6; font-size: 9px; }
.evaluation-button.reveal > span { color: #126b90; background: #dff3ff; }
.evaluation-button.correct > span { color: #087d70; background: #dff8f1; }
.evaluation-button.review > span { color: #9a5200; background: #fff0d7; }
.evaluation-button:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(7, 27, 51, .07); }
.evaluation-button:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

.classroom-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.classroom-controls button { min-height: 54px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed rgba(7, 27, 51, .2); border-radius: 15px; color: var(--ink); background: rgba(255, 255, 255, .5); text-align: left; }
.classroom-controls button:hover { border-style: solid; background: #fff; }
.classroom-controls span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); background: #e7f1ee; font-weight: 900; }
.classroom-controls b { font-size: 12px; }.classroom-controls small { color: #8094a2; font-size: 9px; }
.classroom-controls button:disabled { opacity: .42; cursor: default; }

.launch-dock { display: grid; justify-items: center; margin-top: 22px; }
.launch-button { min-width: min(100%, 340px); min-height: 66px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 20px; color: #fff; background: linear-gradient(130deg, var(--mint-deep), var(--mint)); box-shadow: 0 12px 0 var(--action-edge), 0 24px 34px var(--action-shadow); }
.launch-button:hover { transform: translateY(2px); box-shadow: 0 10px 0 var(--action-edge), 0 20px 28px var(--action-shadow); }
.launch-button:active { transform: translateY(7px); box-shadow: 0 5px 0 var(--action-edge); }
.launch-button.stop { background: linear-gradient(130deg, var(--coral-deep), var(--coral)); box-shadow: 0 12px 0 var(--coral-deep), 0 24px 34px rgba(233, 93, 78, .22); }
.launch-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .18); font-size: 16px; }
.launch-button b { text-align: center; font-size: 18px; letter-spacing: .07em; }
.launch-button small { padding: 5px 7px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 7px; color: rgba(255, 255, 255, .72); font-size: 8px; font-weight: 900; }
.launch-dock > p { margin: 18px 0 0; color: #8295a2; font-size: 10px; }

.modal-layer { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(4, 18, 34, .7); backdrop-filter: blur(12px); overflow: auto; }
.modal-card { width: min(980px, 100%); max-height: calc(100dvh - 44px); overflow: auto; border: 1px solid rgba(255, 255, 255, .7); border-radius: 28px; background: #f9fcfb; box-shadow: 0 30px 90px rgba(0, 0, 0, .3); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: rgba(249, 252, 251, .94); backdrop-filter: blur(10px); }
.modal-header span { color: var(--mint-deep); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.modal-header h2 { margin: 4px 0 0; color: var(--ink); font-size: clamp(20px, 2.5vw, 30px); }
.modal-close { width: 45px; height: 45px; border-radius: 14px; color: var(--ink); background: #eaf2ef; font-size: 28px; line-height: 1; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 24px 26px; }
.setup-column { min-width: 0; }
.setup-title { min-height: 45px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.setup-title > div { display: flex; align-items: center; gap: 9px; }
.setup-title > div span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--ink-2); font-size: 10px; font-weight: 900; }
.setup-title strong { font-size: 15px; }
.setup-title em { color: #7c91a0; font-size: 10px; font-style: normal; text-align: right; line-height: 1.5; }
.select-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; margin-bottom: 10px; }
.select-row select, .select-row button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; }
.select-row select { min-width: 0; padding: 0 11px; }
.select-row button { padding: 0 10px; }
.select-row .danger-lite { color: #bb4a40; background: #fff4f2; }
.setup-column textarea { width: 100%; min-height: 260px; resize: vertical; padding: 15px; border: 1px solid rgba(7, 27, 51, .15); border-radius: 15px; color: var(--ink); background: #f0f6f3; font-family: "Cascadia Mono", Consolas, "Microsoft YaHei", monospace; font-size: 12px; line-height: 1.7; }
#studentInput::placeholder, #wordInput::placeholder { color: color-mix(in srgb, var(--ink-3) 82%, transparent); opacity: 1; line-height: 1.9; }
.file-row { min-height: 44px; display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.file-row label, .backup-strip label { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid rgba(19, 155, 137, .2); border-radius: 11px; color: #087d70; background: #e8faf5; cursor: pointer; font-size: 11px; font-weight: 900; }
.file-row input, .backup-strip input { display: none; }
.template-link { color: #087d70; font-size: 10px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.template-link:hover, .template-link:focus-visible { color: #b13b67; }
.file-row span { margin-left: auto; color: #768d9d; font-size: 10px; }
.unit-approval { min-height: 54px; display: flex; align-items: center; gap: 10px; margin-top: 9px; padding: 9px 12px; border: 1px solid rgba(255, 190, 98, .5); border-radius: 14px; background: #fff8e9; cursor: pointer; }
.unit-approval input { width: 20px; height: 20px; accent-color: var(--mint-deep); }
.unit-approval b, .unit-approval small { display: block; }.unit-approval b { font-size: 11px; }.unit-approval small { margin-top: 3px; color: #8a7558; font-size: 9px; }
.setting-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 26px 14px; }
.setting-options label { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; }
.setting-options input { width: 20px; height: 20px; accent-color: var(--mint-deep); }
.setting-options b, .setting-options small { display: block; }
.setting-options b { font-size: 12px; }.setting-options small { margin-top: 3px; color: #7c91a0; font-size: 9px; line-height: 1.4; }
.music-settings { min-width: 0; margin: 22px 26px 0; padding: 20px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface-soft, #edf5f2); }
.music-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.music-heading span { color: var(--mint-deep); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.music-heading h3 { margin: 4px 0 0; font-size: 19px; }
.music-heading small, .music-toggle small, .music-settings-note { color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.music-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 800; }
.music-toggle input { width: 20px; height: 20px; accent-color: var(--mint-deep); }
.music-toggle small { display: block; font-weight: 400; }
.music-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; margin-top: 16px; }
.music-controls label { min-width: 0; font-size: 13px; font-weight: 800; }
.music-controls select { display: block; width: 100%; min-width: 0; min-height: 48px; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field, #fff); color: var(--ink); font-size: 14px; }
.music-controls button { min-height: 48px; padding: 10px 16px; }
.music-volume-label output { margin-left: 8px; color: var(--mint-deep); }
.music-volume-label input { display: block; width: 100%; min-width: 0; min-height: 44px; margin: 4px 0 0; accent-color: var(--mint-deep); }
#musicSettingsStatus { margin: 14px 0 6px; font-size: 13px; line-height: 1.6; }
.music-settings-note { margin: 0; }
.music-credits { margin-top: 16px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.music-credits summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 800; }
.music-credits a { color: var(--mint-deep); text-underline-offset: 3px; }
@media (max-width: 520px) {
  .music-settings { margin: 16px 16px 0; padding: 14px; }
  .music-controls { grid-template-columns: minmax(0, 1fr); }
  .music-controls button { width: 100%; }
}
.theme-picker { margin: 0 26px 16px; padding: 0; border: 0; }
.theme-modal { width: min(900px, 100%); }
.theme-modal .theme-picker { margin-top: 22px; margin-bottom: 22px; }
.theme-picker legend { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; margin-bottom: 10px; padding: 0; }
.theme-picker legend span { color: var(--mint-deep); font-size: 8px; font-weight: 900; letter-spacing: .15em; }.theme-picker legend strong { font-size: 14px; }.theme-picker legend small { margin-left: auto; color: #7c91a0; font-size: 9px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.theme-option { --preview-a: #fff0f7; --preview-b: #48cdb5; --preview-c: #ffca62; min-height: 66px; position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:focus-within { outline: 3px solid color-mix(in srgb, var(--mint) 48%, transparent); outline-offset: 2px; }
.theme-option:has(input:checked) { border-color: var(--mint-deep); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 24%, transparent); transform: translateY(-1px); }
.theme-option:has(input:checked)::after { content: "✓"; width: 21px; height: 21px; display: grid; place-items: center; position: absolute; right: 8px; top: 8px; border-radius: 7px; color: #fff; background: var(--mint-deep); font-size: 10px; font-weight: 900; }
.theme-swatch { width: 54px; height: 38px; flex: 0 0 auto; display: flex; align-items: end; gap: 4px; padding: 7px; border-radius: 11px; background: linear-gradient(135deg, var(--preview-a) 0 48%, color-mix(in srgb, var(--preview-b) 18%, #fff) 49% 100%); box-shadow: inset 0 0 0 1px rgba(86, 64, 110, .09); }
.theme-swatch i { width: 9px; height: 9px; border-radius: 50%; background: var(--preview-b); }.theme-swatch i:nth-child(2) { height: 16px; border-radius: 7px; background: var(--preview-c); }.theme-swatch i:nth-child(3) { height: 23px; border-radius: 7px; background: var(--preview-b); }
.theme-option > span:last-child { min-width: 0; padding-right: 18px; }.theme-option b, .theme-option small { display: block; }.theme-option b { color: var(--ink); font-size: 11px; }.theme-option small { margin-top: 3px; color: #7b8e9b; font-size: 9px; }
.theme-option[data-theme-option="sky"] { --preview-a: #e8f7ff; --preview-b: #5bbdf4; --preview-c: #ffd568; }
.theme-option[data-theme-option="forest"] { --preview-a: #efffe8; --preview-b: #60cb83; --preview-c: #ffd064; }
.theme-option[data-theme-option="galaxy"] { --preview-a: #f2ebff; --preview-b: #a99cf4; --preview-c: #f27faf; }
.theme-option[data-theme-option="sports"] { --preview-a: #eafbf4; --preview-b: #41ce99; --preview-c: #ff745f; }
.theme-option[data-theme-option="sunny"] { --preview-a: #fff3df; --preview-b: #f2a65b; --preview-c: #ffda72; }
.backup-strip { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin: 0 26px 20px; padding: 16px 18px; border: 1px dashed rgba(7, 27, 51, .18); border-radius: 17px; background: #edf5f2; }
.backup-strip > div strong, .backup-strip > div span { display: block; }
.backup-strip > div strong { font-size: 13px; }.backup-strip > div span { margin-top: 4px; color: #7a8f9d; font-size: 10px; }
.backup-strip button { min-height: 44px; padding: 0 12px; border-radius: 11px; color: #fff; background: var(--ink-2); font-size: 11px; font-weight: 900; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 26px 24px; border-top: 1px solid var(--line); }
.modal-footer p { margin: 0 auto 0 0; color: #788d9b; font-size: 10px; line-height: 1.5; }
.primary-button, .secondary-button { min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 900; }
.primary-button { color: #fff; background: linear-gradient(130deg, var(--mint-deep), var(--mint)); box-shadow: 0 7px 15px var(--action-shadow); }
.secondary-button { color: var(--ink); background: #e9f1ee; }

.help-modal { width: min(1080px, 100%); height: min(860px, calc(100dvh - 44px)); display: flex; flex-direction: column; overflow: hidden; }
.help-modal .modal-header, .help-modal .modal-footer { flex: 0 0 auto; }
.help-modal .modal-close, .help-modal .primary-button { flex-shrink: 0; }
.help-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px 26px; scrollbar-gutter: stable; color: var(--ink); overflow-wrap: anywhere; }
.help-body:focus-visible { outline: 3px solid var(--mint-deep); outline-offset: -4px; }
.help-intro { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(120deg, color-mix(in srgb, var(--mint) 12%, #fff), #fff); }
.help-intro-icon { flex: 0 0 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: #fff; font-size: 32px; }
.help-intro h3 { margin: 0; font-size: 19px; line-height: 1.5; }
.help-intro p { margin: 7px 0 0; color: var(--ink-3); font-size: 13px; line-height: 1.8; }
.help-intro p strong { display: block; color: var(--ink-2); font-weight: 700; }
.help-quickstart { margin: 24px 0; }
.help-quickstart > h3 { margin: 0 0 12px; font-size: 17px; }
.help-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.help-steps li { min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.help-step-number { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--mint-deep); background: color-mix(in srgb, var(--mint) 14%, #fff); font: 900 13px "Trebuchet MS", sans-serif; }
.help-steps h4 { margin: 4px 0 6px; font-size: 15px; }
.help-steps p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.8; }
.help-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-topic { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.help-topic h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; }
.help-topic h3 > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--mint-deep); background: color-mix(in srgb, var(--mint) 12%, #fff); font-size: 20px; }
.help-topic ul { margin: 0; padding-left: 19px; color: var(--ink-3); font-size: 14px; line-height: 1.8; }
.help-topic li + li { margin-top: 9px; }
.help-topic li::marker { color: var(--mint-deep); }
.help-topic strong { color: var(--ink); }
.help-actions { margin: 0; font-size: 14px; line-height: 1.8; }
.help-actions > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.help-actions > div:first-child { padding-top: 0; }
.help-actions dt { color: var(--ink); font-weight: 800; }.help-actions dd { margin: 0; color: var(--ink-3); }
.help-note, .help-notice { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; color: var(--ink-2); background: color-mix(in srgb, var(--mint) 8%, #fff); font-size: 12px; line-height: 1.8; }
.help-notice { border-left: 3px solid #dcac49; color: #79551d; background: #fff8e8; }
.shortcut-board { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 22px 0 0; padding: 20px; border-radius: 18px; color: #fff; background: var(--ink-2); font-size: 13px; }
.shortcut-board h3 { flex-basis: 100%; margin: 0 0 2px; font-size: 17px; }
.shortcut-board > span { display: inline-flex; align-items: center; gap: 8px; }
.shortcut-board p { flex-basis: 100%; margin: 3px 0 0; color: #fff; font-size: 12px; line-height: 1.8; }
.help-modal .modal-footer p { font-size: 12px; }
kbd { min-width: 25px; display: inline-grid; place-items: center; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 6px; color: #fff; background: rgba(255, 255, 255, .08); font-family: inherit; font-size: 9px; font-weight: 900; }

.stats-modal { width: min(1120px, 100%); }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 22px 26px 14px; }
.report-summary article { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.report-summary span, .report-summary small { display: block; }.report-summary span { color: #71899a; font-size: 10px; font-weight: 900; }.report-summary strong { display: block; margin: 5px 0; color: var(--ink); font-size: clamp(23px, 2.5vw, 36px); }.report-summary small { color: #94a4ae; font-size: 9px; }
.report-summary article:nth-child(2) strong { color: var(--mint-deep); }.report-summary article:nth-child(3) strong { color: #c06a14; }
.report-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 0 26px 16px; }
.report-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 26px 14px; padding: 11px 14px; border: 1px dashed rgba(7, 27, 51, .16); border-radius: 13px; color: #6e8494; background: #f0f6f3; font-size: 10px; }
.report-context strong { color: var(--ink-2); font-size: 11px; }
.report-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; padding: 0 26px 24px; }
.report-table-card { min-width: 0; border: 1px solid var(--line); border-radius: 19px; background: #fff; overflow: hidden; }
.report-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding: 16px 17px 12px; border-bottom: 1px solid var(--line); }
.report-heading span { color: var(--mint-deep); font-size: 8px; font-weight: 900; letter-spacing: .15em; }.report-heading h3 { margin: 3px 0 0; font-size: 15px; }.report-heading small { color: #8195a3; font-size: 9px; }
.table-scroll { max-height: 330px; overflow: auto; }
.report-table-card table, .import-table-wrap table { width: 100%; border-collapse: collapse; }
.report-table-card th, .report-table-card td, .import-table-wrap th, .import-table-wrap td { padding: 10px 11px; border-bottom: 1px solid rgba(7, 27, 51, .075); text-align: left; font-size: 10px; vertical-align: middle; }
.report-table-card th, .import-table-wrap th { position: sticky; z-index: 1; top: 0; color: #6e8595; background: #edf5f2; font-weight: 900; }
.report-table-card td strong { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }.report-table-card td small { display: block; max-width: 180px; overflow: hidden; margin-top: 2px; color: #8194a1; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.report-table-card .queue-toggle { min-height: 44px; padding: 0 9px; border-radius: 9px; color: #087d70; background: #e3f8f2; font-size: 9px; font-weight: 900; white-space: nowrap; }.report-table-card .queue-toggle.active { color: #7c4200; background: #ffebc8; }
.empty-table td { padding: 30px 12px; color: #8093a0; text-align: center; }

.import-preview-modal { width: min(900px, 100%); }
.import-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 26px 10px; }.import-summary strong { font-size: 14px; }.import-summary span { color: #7d91a0; font-size: 10px; }
.import-warnings { margin: 4px 26px 12px; padding: 12px 15px; border: 1px solid rgba(255, 190, 98, .55); border-radius: 14px; color: #7b4d14; background: #fff7e8; font-size: 10px; line-height: 1.65; white-space: pre-line; }
.import-table-wrap { max-height: 360px; margin: 0 26px 14px; border: 1px solid var(--line); border-radius: 16px; overflow: auto; background: #fff; }
.import-table-wrap td { max-width: 300px; overflow-wrap: anywhere; }.import-table-wrap tr.flagged td { background: #fffaf0; }
.import-approval { display: flex; align-items: center; gap: 11px; margin: 0 26px 18px; padding: 13px 15px; border: 1px solid rgba(46, 211, 183, .38); border-radius: 15px; background: #eaf9f5; cursor: pointer; }
.import-approval input { width: 22px; height: 22px; accent-color: var(--mint-deep); }.import-approval b, .import-approval small { display: block; }.import-approval b { font-size: 12px; }.import-approval small { margin-top: 3px; color: #688378; font-size: 9px; line-height: 1.5; }

.backup-preview-modal { width: min(720px, 100%); }
.backup-preview-copy { padding: 22px 26px 8px; }.backup-preview-copy strong { font-size: 15px; overflow-wrap: anywhere; }.backup-preview-copy p { margin: 8px 0 0; color: #718697; font-size: 11px; line-height: 1.7; }
.backup-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 26px 24px; }
.backup-preview-grid article { padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }.backup-preview-grid span, .backup-preview-grid strong { display: block; }.backup-preview-grid span { color: #788d9d; font-size: 10px; font-weight: 900; }.backup-preview-grid strong { margin-top: 5px; color: var(--ink); font-size: 24px; }
.danger-button { min-height: 46px; padding: 0 18px; border-radius: 13px; color: #fff; background: #c94f43; font-weight: 900; box-shadow: 0 7px 15px rgba(201, 79, 67, .18); }

.end-modal { width: min(520px, 100%); padding: 34px; text-align: center; }
.end-symbol { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 25px; color: var(--ink); background: var(--amber); box-shadow: 0 12px 24px rgba(255, 190, 98, .25); font-size: 30px; }
.end-modal > span { color: var(--mint-deep); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.end-modal h2 { margin: 8px 0; font-size: 26px; }.end-modal > p { margin: 0 auto 22px; max-width: 390px; color: #718697; font-size: 13px; line-height: 1.7; }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.end-modal > .text-button { color: #748b9b; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: min(500px, calc(100vw - 32px)); transform: translateX(-50%); padding: 13px 18px; border-radius: 14px; color: #fff; background: rgba(7, 27, 51, .94); box-shadow: 0 16px 40px rgba(0, 0, 0, .22); font-size: 12px; font-weight: 800; text-align: center; }

@media (max-width: 1180px) {
  .mission-rail { gap: 13px; padding: 18px; }
  .mascot-panel { grid-template-columns: 1fr 78px; padding: 14px; }
  .mascot { transform: scale(.82); transform-origin: right center; }
  .top-button span { display: none; }
  .stage { padding-left: 28px; padding-right: 28px; }
  .draw-card { min-height: clamp(270px, 38vh, 380px); }
}

@media (max-height: 820px) and (min-width: 961px) {
  .draw-card { min-height: clamp(248px, 34vh, 320px); }
  .student-value { font-size: clamp(44px, 5.4vw, 78px); }
  .word-value { font-size: clamp(46px, 5.9vw, 88px); }
  .draw-card > p { margin-top: 18px; font-size: 12px; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 220px 1fr; }
  .mission-rail { padding: 14px; }
  .brand-orbit { width: 40px; height: 40px; }
  .brand-block small, .mascot-copy p { display: none; }
  .mascot-panel { min-height: 108px; grid-template-columns: 1fr 60px; }
  .mascot { transform: scale(.62); }
  .round-meters div { padding: 9px; }.round-meters strong { font-size: 18px; }
  .stage { padding-left: 20px; padding-right: 20px; }
  .topbar { min-height: 70px; flex-wrap: wrap; padding: 9px 0; }
  .class-context { width: 100%; }.class-context strong { max-width: 100%; }
  .class-context { flex-basis: 100%; }
  .top-actions { width: 100%; justify-content: space-between; gap: 4px; }
  .mode-switch { flex: 1; }.mode-switch button { flex: 1; padding-left: 7px; padding-right: 7px; }
  .top-button { min-width: 45px; width: 45px; padding: 0; font-size: 0; }.top-button span { display: inline; font-size: 17px; }
  .mission-intro { min-height: 120px; }
  .signal { display: none; }
  .draw-grid { grid-template-columns: 1fr; }
  .draw-card { min-height: 210px; }
  .display-value { margin-top: 16px; }
  .student-value, .word-value { font-size: clamp(38px, 7vw, 64px); }
  .answer-deck { grid-template-columns: 1fr; }
  .evaluation-button { grid-template-columns: 32px 1fr; }.evaluation-button small { display: none; }
  .classroom-controls button { grid-template-columns: 28px 1fr; }.classroom-controls small { display: none; }
  .report-grid { grid-template-columns: 1fr; }.report-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell { display: block; max-height: none; }
  .rail-collapse-button { display: none; }
  .mission-rail { width: 100%; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
  .brand-block { grid-column: 1; }.mascot-panel { grid-column: 2; grid-row: 1; }
  .round-meters { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .history-section { grid-column: 1 / -1; max-height: 190px; }
  .rail-footer { grid-column: 1 / -1; }.rail-footer p { display: none; }
  .stage { height: auto; min-height: 100dvh; overflow: visible; padding-bottom: 34px; }
  .topbar { flex-wrap: wrap; padding: 10px 0; }
  .class-context { order: 1; width: 100%; }.class-context strong { max-width: 100%; }
  .top-actions { order: 2; width: 100%; justify-content: space-between; }
  .mission-intro { min-height: 120px; }
  .mode-switch { flex: 1; }.mode-switch button { flex: 1; }
  .setup-grid, .help-steps, .help-topics { grid-template-columns: 1fr; }
  .setup-column textarea { min-height: 220px; }
  .setting-options { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .backup-strip { grid-template-columns: 1fr 1fr; }.backup-strip > div { grid-column: 1 / -1; }
  .modal-footer { flex-wrap: wrap; }.modal-footer p { width: 100%; }
  .report-actions { flex-wrap: wrap; }.report-actions button { flex: 1; }
  .report-context { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .mission-rail { grid-template-columns: 1fr; }.mascot-panel { display: none; }.brand-block { grid-column: 1; }
  .round-meters { grid-template-columns: repeat(2, 1fr); }
  .stage { padding-left: 14px; padding-right: 14px; }
  .mission-intro h1 { font-size: 29px; }
  .draw-card { min-height: 205px; padding: 20px; }
  .card-topline { left: 20px; right: 20px; }
  .evaluation-panel { grid-template-columns: 1fr; }
  .classroom-controls { grid-template-columns: 1fr; }
  .evaluation-button { min-height: 54px; }
  .answer-main, .example-block { padding: 14px; }
  .modal-layer { padding: 8px; }.modal-card { max-height: calc(100dvh - 16px); border-radius: 20px; }
  .modal-header, .setup-grid, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .setting-options, .theme-picker, .backup-strip, .import-summary, .import-warnings, .import-table-wrap, .import-approval, .report-context { margin-left: 16px; margin-right: 16px; }
  .help-modal { height: calc(100dvh - 16px); }
  .help-body { padding: 16px; }
  .help-intro { align-items: flex-start; gap: 10px; padding: 14px; }
  .help-intro-icon { flex-basis: 36px; height: 36px; border-radius: 12px; font-size: 25px; }
  .help-intro h3 { font-size: 16px; }
  .help-topic { padding: 16px; }
  .help-actions > div { grid-template-columns: 1fr; gap: 2px; }
  .report-summary, .report-grid { padding-left: 16px; padding-right: 16px; }
  .report-actions { padding-left: 16px; padding-right: 16px; }
  .select-row { grid-template-columns: 1fr 1fr; }.select-row select { grid-column: 1 / -1; }
  .end-actions { grid-template-columns: 1fr; }
  .backup-preview-grid { grid-template-columns: repeat(2, 1fr); padding-left: 16px; padding-right: 16px; }
  .backup-preview-copy { padding-left: 16px; padding-right: 16px; }
  .theme-grid { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
  button, label[for], select, .unit-approval, .setting-options label, .import-approval { touch-action: manipulation; }
  .table-scroll, .import-table-wrap, .modal-card, .stage { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

@media (forced-colors: active) {
  button, .draw-card, .report-table-card, .modal-card { border: 1px solid ButtonText; }
  .status-dot, .brand-orbit i { forced-color-adjust: none; }
}

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

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
