:root {
  --color-primary: #dc2626;
  --color-primary-deep: #991b1b;
  --color-secondary: #9a3412;
  --color-accent: #d97706;
  --color-accent-soft: #fef3c7;
  --color-background: #fffbeb;
  --color-surface: #fffef8;
  --color-surface-strong: #ffffff;
  --color-foreground: #0f172a;
  --color-body: #334155;
  --color-muted: #fdf2f2;
  --color-border: #eadfd1;
  --color-ring: #dc2626;
  --color-success: #166534;
  --color-success-soft: #dcfce7;
  --color-blue: #1d4ed8;
  --color-blue-soft: #dbeafe;
  --color-purple: #7e22ce;
  --color-purple-soft: #f3e8ff;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05);
  --shadow-md: 0 12px 30px rgb(99 53 24 / 0.08);
  --shadow-lg: 0 24px 60px rgb(99 53 24 / 0.14);
  --font-display: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 11% 18%, rgb(220 38 38 / 0.035) 0 14rem, transparent 14.1rem),
    radial-gradient(circle at 92% 7%, rgb(217 119 6 / 0.05) 0 12rem, transparent 12.1rem),
    var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

button:not(:disabled),
[role="button"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  border-radius: 0.5rem;
  background: var(--color-foreground);
  color: white;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 5rem;
  padding: 0.75rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgb(154 52 18 / 0.12);
  background: rgb(255 251 235 / 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 0.8rem;
  background: var(--color-primary);
  box-shadow: 0.25rem 0.25rem 0 var(--color-accent);
  color: white;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: -0.2rem;
  color: #64748b;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.topnav {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid rgb(154 52 18 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.62);
}

.topnav button {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 200ms ease, color 200ms ease;
}

.topnav button span {
  margin-right: 0.25rem;
  color: var(--color-primary);
  font-size: 0.72rem;
}

.topnav button:hover,
.topnav button.is-active {
  background: var(--color-foreground);
  color: white;
}

.topnav button:hover span,
.topnav button.is-active span {
  color: #fbbf24;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.875rem;
  font-weight: 700;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.5rem;
}
.topbar-actions .icon-text-button.is-active { background: var(--color-foreground); color: #fff; border-color: var(--color-foreground); }

.topbar-actions .icon-text-button { justify-self: auto; }

.icon-text-button:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.view {
  min-height: calc(100vh - 5rem);
}

.home-shell,
.lesson-shell {
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(25rem, 0.92fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
  min-height: min(46rem, calc(100vh - 5rem));
  padding: clamp(4rem, 8vw, 7.5rem) 0;
}

.eyebrow,
.section-number {
  color: var(--color-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.eyebrow span {
  width: 1.75rem;
  height: 2px;
  background: var(--color-primary);
}

.hero-kicker {
  margin: 2rem 0 0.25rem;
  color: #64748b;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.6vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero-copy h1 em {
  color: var(--color-primary);
  font-style: normal;
  background: linear-gradient(transparent 72%, rgb(217 119 6 / 0.22) 0);
  white-space: nowrap;
}

.hero-lead {
  max-width: 38rem;
  margin: 1.75rem 0 0;
  color: var(--color-body);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.9;
}

.hero-actions,
.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.3rem;
  border-radius: 0.8rem;
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
}

.button-primary {
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  box-shadow: 0.35rem 0.35rem 0 var(--color-foreground);
  color: white;
}

.button-primary:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 0.45rem 0.45rem 0 var(--color-foreground);
}

.button-primary:disabled {
  border-color: #cbd5e1;
  background: #cbd5e1;
  box-shadow: none;
  color: #475569;
}

.button-quiet {
  border: 1px solid var(--color-border);
  background: rgb(255 255 255 / 0.62);
  color: var(--color-foreground);
}

.button-quiet:hover {
  border-color: var(--color-accent);
  background: white;
  transform: translateY(-1px);
}

.learning-path {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2.5rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.learning-path i {
  width: 1.1rem;
  height: 1px;
  background: #cbd5e1;
}

.hero-visual {
  position: relative;
  display: grid;
  min-height: 34rem;
  place-items: center;
}

.hero-visual::before,
.hero-visual::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.hero-visual::before {
  width: 26rem;
  height: 26rem;
  border: 1px dashed rgb(154 52 18 / 0.32);
  transform: rotate(8deg);
}

.hero-visual::after {
  z-index: -1;
  width: 23rem;
  height: 23rem;
  background: #fef3c7;
  box-shadow: 2.4rem 2.4rem 0 rgb(220 38 38 / 0.06);
}

.strategy-card {
  position: relative;
  z-index: 2;
  width: min(26rem, 88vw);
  padding: 1.1rem;
  transform: rotate(1.3deg);
  border: 1px solid rgb(15 23 42 / 0.18);
  border-radius: 1.2rem;
  background: rgb(255 254 248 / 0.95);
  box-shadow: var(--shadow-lg);
}

.strategy-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.4rem 0.2rem 0.8rem;
  border-bottom: 1px solid var(--color-border);
}

.strategy-card-head span {
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.strategy-card-head strong {
  font-size: 0.92rem;
}

.strategy-card-head b {
  color: var(--color-primary);
  font-size: 1.4rem;
}

.race-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  margin: 0.65rem 0;
  padding: 0.8rem;
  border-radius: 0.85rem;
  background: #f8fafc;
}

.horse-token {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--color-foreground);
  color: white;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
}

.race-row b,
.race-row small {
  display: block;
}

.race-row b {
  font-size: 0.88rem;
}

.race-row small {
  color: #64748b;
  font-size: 0.75rem;
}

.race-result {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
}

.race-row.is-won .race-result { color: var(--color-primary); }
.race-row.is-lost .race-result { color: #64748b; }

.strategy-card > p {
  margin: 0.9rem 0 0;
  color: var(--color-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

.seal {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 0.65rem;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
}

.seal::after {
  position: absolute;
  inset: 0.25rem;
  border: 1px solid currentColor;
  content: "";
}

.seal-one { top: 2rem; right: 0.75rem; transform: rotate(8deg); }
.seal-two { bottom: 1rem; left: 1rem; transform: rotate(-10deg); color: var(--color-accent); }

.module-section {
  padding: 6rem 0;
  border-top: 1px solid rgb(154 52 18 / 0.14);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(17rem, 0.7fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.section-heading h2,
.story-title-block h2 {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.12;
}

.story-title-block h2 { white-space: nowrap; }

.section-heading p {
  margin: 0;
  color: #64748b;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.module-card {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow 250ms ease, transform 250ms ease, border-color 250ms ease;
  animation: card-in 420ms both;
}

.module-card:nth-child(2) { animation-delay: 60ms; }
.module-card:nth-child(3) { animation-delay: 120ms; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(1rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.module-card:hover,
.module-card:focus-within {
  border-color: currentColor;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.module-card > button {
  display: grid;
  align-content: start;
  width: 100%;
  min-height: 29rem;
  padding: 1.5rem;
  border: 0;
  background: transparent;
  text-align: left;
}

.module-quiz { background: #fff7d6; color: #854d0e; }
.module-game { background: #e2f5e7; color: #14532d; }
.module-debate { background: #f2e8ff; color: #581c87; }

.module-index {
  justify-self: end;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.module-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-top: 1.5rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.55);
}

.module-icon svg { width: 1.65rem; height: 1.65rem; }

.module-type {
  margin-top: 2.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.module-card h3 {
  margin: 0.5rem 0 0;
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

.module-card p {
  margin: 1rem 0 0;
  color: #334155;
  line-height: 1.85;
}

.module-link {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
  color: var(--color-foreground);
  font-weight: 800;
}

.role-preview {
  display: flex;
  align-items: center;
  margin-top: 1.1rem;
  color: #6b21a8;
  font-size: 0.78rem;
  font-weight: 700;
}

.role-preview i {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  margin-right: -0.25rem;
  place-items: center;
  border: 2px solid #f2e8ff;
  border-radius: 50%;
  background: white;
  font-family: var(--font-display);
  font-style: normal;
}

.role-preview i:last-of-type { margin-right: 0.55rem; }

.story-section {
  display: grid;
  grid-template-columns: minmax(16rem, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 8vw, 8rem);
  margin-bottom: 6rem;
  padding: clamp(2rem, 6vw, 5rem);
  border-radius: var(--radius-lg);
  background: var(--color-foreground);
  box-shadow: var(--shadow-lg);
  color: white;
}

.story-title-block .section-number { color: #fbbf24; }
.story-title-block h2 { color: white; }

.story-copy > p {
  margin: 0;
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 2;
}

.story-copy blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--color-accent);
  background: rgb(255 255 255 / 0.06);
  color: white;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
}

.story-copy .story-note {
  color: #fef3c7;
  font-size: 0.95rem;
}

.lesson-view {
  padding: clamp(2rem, 5vw, 4rem) 0 6rem;
  background:
    linear-gradient(rgb(255 251 235 / 0.9), rgb(255 251 235 / 0.9)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgb(154 52 18 / 0.05) 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 39px, rgb(154 52 18 / 0.05) 39px 40px);
}

.lesson-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.lesson-heading > div:nth-child(3) { min-width: 0; }

.lesson-heading span {
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lesson-heading h1 {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  line-height: 1.2;
}

.back-button,
.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.back-button:hover,
.dialog-close:hover {
  border-color: var(--color-primary);
  background: white;
  transform: translateX(-2px);
}

.lesson-badge {
  display: grid;
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 1rem;
}

.quiz-badge { background: #fef3c7; color: #854d0e; }
.game-badge { background: #dcfce7; color: #166534; }
.debate-badge { background: #f3e8ff; color: #7e22ce; }

.panel-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgb(255 254 248 / 0.96);
  box-shadow: var(--shadow-md);
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(24rem, 1.55fr) minmax(15rem, 0.8fr);
  align-items: stretch;
  gap: 1rem;
  min-height: 40rem;
}
.quiz-layout .summary-panel { order: 1; }
.quiz-layout .chat-panel { order: 2; }
.quiz-layout .class-panel { order: 3; }

/* Two explicit student steps; reporting and teacher controls stay secondary. */
.quiz-wizard { max-width: 52rem; margin: 0 auto; }
.quiz-steps { display: flex; justify-content: center; gap: clamp(1rem, 6vw, 4rem); list-style: none; padding: 0; margin: 0 0 1.5rem; }
.quiz-steps { scroll-margin-top: 6rem; }
.quiz-completed-notice { padding: 1.25rem 1.5rem; margin: 0; background: var(--color-background); color: var(--color-secondary); font-size: 1rem; line-height: 1.75; }
.quiz-steps li { display: flex; gap: .6rem; align-items: center; color: #475569; font-size: 1rem; font-weight: 700; }
.quiz-steps li span { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 1px solid var(--color-border); border-radius: 50%; background: white; }
.quiz-steps li[aria-current="step"] { color: var(--color-secondary); }
.quiz-steps li[aria-current="step"] span { border-color: var(--color-secondary); background: var(--color-secondary); color: white; }
.quiz-entry { max-width: 36rem; margin: 0 auto; padding: clamp(1.4rem, 4vw, 2.5rem); }
.quiz-entry h2 { margin: .55rem 0 .75rem; font-family: var(--font-display); font-size: clamp(1.7rem, 5vw, 2.2rem); }
.quiz-entry-lead { color: #475569; margin: 0 0 1.5rem; line-height: 1.7; }
.quiz-entry .group-select-label { font-size: 1rem; }
.quiz-entry #student-group-select { min-height: 3.5rem; padding: .8rem 1rem; font-size: 1.15rem; }
.quiz-entry .server-sync-note { font-size: .9rem; min-height: 1.6em; margin-top: .65rem; }
.quiz-next { width: 100%; min-height: 3.5rem; justify-content: center; margin-top: 1.35rem; font-size: 1.05rem; }
.quiz-next:disabled { opacity: .55; cursor: not-allowed; }
.quiz-teacher-settings { margin-top: 1.5rem; border-top: 1px solid var(--color-border); }
.quiz-teacher-settings > summary, .quiz-statistics > summary { cursor: pointer; padding: 1rem .25rem; min-height: 48px; color: #475569; font-size: .95rem; font-weight: 700; }
.quiz-teacher-settings .class-panel { padding: .25rem 0 0; }
.quiz-back-to-group { margin: 0 0 .85rem; font-size: .95rem; }
.quiz-ask-panel.chat-panel { display: block; }
.quiz-ask-panel .assistant-intro { padding: 1.25rem 1.5rem; }
.quiz-ask-panel h2 { margin: .3rem 0 .45rem; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 1.85rem); }
.quiz-ask-panel .assistant-intro p { font-size: 1rem; }
.quiz-ask-panel .composer { border-top: 0; padding: 1.25rem 1.5rem; }
.quiz-mic-entry { text-align: center; margin-bottom: 1.3rem; }
.quiz-mic-entry > p:first-child { margin: 0 0 .8rem; font-size: 1.05rem; font-weight: 700; }
.quiz-mic-entry .voice-button { width: 4.5rem; height: 4.5rem; border-radius: 50%; border-color: var(--color-accent); background: var(--color-background); }
.quiz-mic-entry .voice-button.is-listening { background: #fee2e2; border-color: var(--color-primary); }
.quiz-mic-entry .voice-button svg { width: 2rem; height: 2rem; }
.quiz-ask-panel .voice-status { font-size: .9rem; }
.quiz-ask-panel .composer label { font-size: 1rem; }
.quiz-ask-panel .composer-row { grid-template-columns: minmax(0, 1fr); }
.quiz-ask-panel .composer textarea { font-size: 1.05rem; min-height: 6rem; }
.quiz-ask-panel .send-button { width: 100%; height: auto; min-height: 3.25rem; display: flex; justify-content: center; align-items: center; gap: .65rem; font-size: 1.05rem; }
.quiz-records-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.5rem 0; border-top: 1px solid var(--color-border); }
.quiz-records-heading h3 { margin: 0; font-size: 1rem; }
.quiz-finish-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 1.5rem 1.25rem; padding: 1.25rem; border: 1px solid var(--color-accent); border-radius: 1rem; background: var(--color-background); }
.quiz-finish-panel h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.quiz-finish-panel p { margin: 0; color: #475569; font-size: 1rem; line-height: 1.65; }
.quiz-confirm-button { min-height: 52px; flex-shrink: 0; border: 2px solid var(--color-secondary); background: white; color: var(--color-secondary); font-size: 1rem; }
.quiz-confirm-button:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 560px) {
  .quiz-finish-panel { flex-direction: column; align-items: stretch; margin-inline: 1rem; padding: 1rem; }
  .quiz-confirm-button { width: 100%; justify-content: center; }
}
.quiz-records-heading .text-button { margin: 0; font-size: .9rem; }
.quiz-ask-panel .messages { min-height: 5rem; max-height: 20rem; padding: 1rem 1.5rem; }
.quiz-ask-panel .message { font-size: 1rem; }
.quiz-statistics { margin-top: 1rem; }
.quiz-wizard summary:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.class-panel,
.summary-panel {
  padding: 1.25rem;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.panel-heading svg { width: 1.1rem; height: 1.1rem; }

.class-panel h2,
.summary-panel h2,
.perspective-panel h2,
.horse-bench h2 {
  margin: 0.6rem 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.35;
}

.group-count {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.group-count button {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: white;
  font-size: 1.2rem;
  transition: border-color 200ms ease, background 200ms ease;
}

.group-count button:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.group-count output {
  color: var(--color-foreground);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 900;
  text-align: center;
}

.group-progress {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.group-select-label {
  display: block;
  margin-top: 1.1rem;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

#student-group-select {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: white;
  color: var(--color-foreground);
  font-weight: 700;
}

.server-sync-note {
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.55;
}

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.group-item.is-current {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: #92400e;
}

.group-item.is-done {
  border-color: #86efac;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.group-item span:last-child {
  font-size: 0.72rem;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  margin-top: 1.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.text-button:hover { color: var(--color-primary); }
.text-button svg { width: 1rem; height: 1rem; }

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(18rem, 1fr) auto;
  min-width: 0;
  overflow: hidden;
}

.assistant-intro {
  display: flex;
  gap: 0.8rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #fffbeb;
}

.assistant-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--color-accent);
  color: white;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
}

.assistant-intro b { font-size: 0.95rem; }
.assistant-intro p { margin: 0.15rem 0 0; color: #64748b; font-size: 0.78rem; }

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 29rem;
  padding: 1.25rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  max-width: 87%;
  animation: message-in 220ms ease-out both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

.message > div {
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem 0.9rem 0.9rem 0.25rem;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.7;
}

.message.user {
  align-self: flex-end;
}

.message.user > div {
  border-radius: 0.9rem 0.9rem 0.25rem 0.9rem;
  background: var(--color-foreground);
  color: white;
}

.message.assistant > div {
  border: 1px solid #fde68a;
  background: #fffbeb;
}

.message.summary {
  max-width: 100%;
}

.message.summary > div {
  width: 100%;
  border: 1px solid #86efac;
  background: var(--color-success-soft);
}

.message b { display: block; margin-bottom: 0.2rem; }

.summary-lines {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.summary-lines span {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  background: rgb(255 255 255 / 0.65);
  font-size: 0.78rem;
}

.composer {
  padding: 1rem 1.25rem 1.1rem;
  border-top: 1px solid var(--color-border);
  background: white;
}

.composer label {
  display: block;
  margin-bottom: 0.45rem;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 3rem;
  align-items: end;
  gap: 0.55rem;
}

.voice-console {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
}
.quiz-layout .chat-panel { grid-template-rows: auto minmax(12rem, 1fr) auto; }
.voice-console-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.voice-console-actions button { min-height: 44px; white-space: nowrap; }
.voice-console .button { font-size: .88rem; padding: .6rem 1rem; }
.voice-status { margin: .6rem 0 0; font-size: .82rem; line-height: 1.6; color: #475569; overflow-wrap: anywhere; }
.voice-status[data-state="error"] { color: #b91c1c; }
.voice-status[data-state="listening"] { color: #166534; }
#debate-voice-interrupt { display: none; }
.voice-console:has([data-state="speaking"]) #debate-voice-interrupt { display: inline-flex; }
.voice-button { min-height: 48px; white-space: nowrap; }
.send-button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 420px) {
  .composer-row { grid-template-columns: minmax(0, 1fr) auto 2.75rem; gap: .35rem; }
  .voice-button { padding-inline: .45rem; font-size: .75rem; }
}

.composer textarea {
  width: 100%;
  min-height: 3rem;
  max-height: 8rem;
  padding: 0.75rem 0.9rem;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  background: white;
  color: var(--color-foreground);
  font-size: 1rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.composer textarea:focus {
  border-color: var(--color-ring);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 0.12);
}

.composer small {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.75rem;
}

.send-button {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 0;
  border-radius: 0.8rem;
  background: var(--color-primary);
  color: white;
  transition: transform 200ms ease, background 200ms ease;
}

.send-button:hover { background: var(--color-primary-deep); transform: translateY(-1px); }
.send-button svg { width: 1.2rem; height: 1.2rem; }

.category-list {
  display: grid;
  gap: 0.65rem;
}

.category-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: white;
}

.category-symbol {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 0.6rem;
  background: #f1f5f9;
  font-family: var(--font-display);
  font-weight: 900;
}

.category-item b,
.category-item small { display: block; }
.category-item b { font-size: 0.83rem; }
.category-item small { color: #64748b; font-size: 0.72rem; }
.category-item strong { font-family: var(--font-display); font-size: 1.25rem; }
.category-item[role="button"] { cursor: pointer; }
.category-item[role="button"]:focus-visible { outline: 3px solid rgb(217 119 6 / 0.35); outline-offset: 2px; }
.category-item.is-expanded { border-color: var(--color-primary); background: #fff7ed; }
.category-detail { grid-column: 1 / -1; border-top: 1px dashed #fed7aa; padding-top: 0.65rem; margin-top: 0.2rem; }
.category-detail ul { margin: 0; padding-left: 1.1rem; color: #475569; font-size: 0.78rem; line-height: 1.6; }

.quiz-summary-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.quiz-summary-controls > strong { color: var(--color-secondary); font-size: .85rem; }
.quiz-summary-controls .button { min-height: 44px; padding: .55rem .85rem; }
.quiz-summary-note { margin: .65rem 0 0; color: #475569; font-size: .8rem; line-height: 1.65; }
.quiz-summary-subtitle { margin: 1.25rem 0 .65rem; font-size: .95rem; color: var(--color-secondary); }
.quiz-summary-list { display: grid; gap: .65rem; margin-top: .85rem; }
.quiz-question-disclosure { min-width: 0; border: 1px solid var(--color-border); border-radius: .75rem; background: white; }
.quiz-disclosure-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 56px; padding: .75rem; cursor: pointer; list-style: none; border-radius: .75rem; transition: background-color 180ms ease; }
.quiz-disclosure-toggle::-webkit-details-marker { display: none; }
.quiz-disclosure-toggle:hover { background: var(--color-background); }
.quiz-disclosure-toggle:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.quiz-disclosure-toggle b, .quiz-disclosure-toggle small { display: block; overflow-wrap: anywhere; }
.quiz-disclosure-toggle b { font-size: .9rem; }
.quiz-disclosure-toggle small { margin-top: .2rem; color: #475569; font-size: .78rem; }
.quiz-disclosure-arrow { flex: 0 0 auto; color: var(--color-secondary); font-size: 1.4rem; transition: transform 180ms ease; }
.quiz-question-disclosure[open] > summary .quiz-disclosure-arrow { transform: rotate(90deg); }
.quiz-disclosure-questions { margin: 0; padding: .25rem .8rem .85rem 2.1rem; font-size: .85rem; line-height: 1.75; overflow-wrap: anywhere; }
.quiz-disclosure-questions li + li { margin-top: .6rem; }
.quiz-disclosure-questions strong { display: block; color: var(--color-secondary); font-size: .75rem; }
.quiz-disclosure-empty { margin: 0; padding: 0 .75rem .85rem; color: #475569; font-size: .8rem; }
.quiz-similar-section { margin-top: 1.25rem; padding-top: .25rem; border-top: 1px solid var(--color-border); }

.summary-empty {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.8rem;
  color: #64748b;
  font-size: 0.78rem;
  text-align: center;
}

.score-chip {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 0.75rem;
  margin-left: auto;
  padding: 0.55rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  background: white;
}

.score-chip span { grid-column: 1 / -1; color: #64748b; font-size: 0.7rem; }
.score-chip strong { grid-column: 1 / -1; font-family: var(--font-display); font-size: 1.25rem; text-align: center; }

.game-board {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgb(255 254 248 / 0.97);
  box-shadow: var(--shadow-md);
}

.board-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.board-note span {
  color: var(--color-secondary);
  font-weight: 900;
}

.board-note p {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.lane-labels,
.team-row {
  display: grid;
  grid-template-columns: 8.5rem repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.lane-labels {
  margin-bottom: 0.5rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.lane-labels span:first-child { grid-column: 2; }

.team-row {
  align-items: stretch;
  padding: 0.8rem;
  border-radius: 1rem;
}

.king-row { background: #fef2f2; }
.king-slot { cursor: grab; color: var(--color-foreground); text-align: left; transition: border-color 180ms ease, box-shadow 180ms ease; }
.king-slot:active { cursor: grabbing; }
.king-slot.is-selected, .king-slot.is-target { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.king-slot:hover { border-color: var(--color-secondary); }
.king-round-label { grid-column: 1 / -1; }
.king-order-status { min-height: 1.5rem; margin: .75rem .8rem 0; color: var(--color-secondary); font-size: .9rem; }
#shuffle-king { flex-shrink: 0; min-height: 44px; }
.teacher-view-note { color: #475569; line-height: 1.7; }
.teacher-controls { margin: 0 0 1.25rem; padding: 0 1.25rem; }
.teacher-controls .class-panel { max-width: 36rem; padding-bottom: 1rem; }
.teacher-controls .class-panel p { color: #475569; line-height: 1.7; }
.teacher-access-bar { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.teacher-login-dialog { width: min(29rem, calc(100vw - 2rem)); padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--color-border); border-radius: 1.25rem; background: var(--color-background); color: var(--color-foreground); box-shadow: var(--shadow-lg); }
.teacher-login-dialog::backdrop { background: rgb(15 23 42 / .5); }
.teacher-login-dialog h2 { margin: 0 0 .8rem; font-family: var(--font-display); }
.teacher-login-dialog p { color: #475569; line-height: 1.7; }
.teacher-login-dialog label { display: block; margin-bottom: .5rem; font-weight: 700; }
.teacher-login-dialog input { width: 100%; min-height: 48px; padding: .7rem .85rem; border: 1px solid #94a3b8; border-radius: .6rem; font-size: 1rem; background: white; }
.teacher-login-dialog input:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.teacher-login-dialog #teacher-login-error { min-height: 1.7em; margin: .5rem 0 1rem; color: var(--color-secondary); }
.teacher-login-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; }
.teacher-login-dialog > small { display: block; color: #475569; line-height: 1.6; margin-top: 1rem; }
body[data-page="quiz"] .topbar-actions,
body[data-page="quiz"] .topnav,
body[data-page="dashboard"] .topnav { display: none; }
body:not([data-page="home"]) .global-reset { display: none; }
.tian-row { background: #eff6ff; }

.team-name {
  display: grid;
  align-content: center;
  padding: 0.4rem;
}

.team-name small,
.team-name strong { display: block; }
.team-name small { color: #475569; font-size: 0.72rem; }
.team-name strong { font-family: var(--font-display); font-size: 1.25rem; }

.horse-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 5.5rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: white;
  box-shadow: var(--shadow-sm);
}

.horse-card b,
.horse-card small { display: block; }
.horse-card b { font-size: 0.9rem; }
.horse-card small { color: #64748b; font-size: 0.74rem; }

.horse-rank {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 50% 45% 50% 35%;
  background: var(--color-foreground);
  color: white;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  transform: rotate(-4deg);
}

.opponent .horse-rank { background: var(--color-primary); }

.versus-line {
  position: relative;
  display: grid;
  height: 3.75rem;
  place-items: center;
}

.versus-line::before {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--color-border);
  content: "";
}

.versus-line span {
  z-index: 1;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-secondary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.race-slot {
  position: relative;
  display: grid;
  min-height: 6.25rem;
  place-items: center;
  padding: 0.75rem;
  border: 2px dashed #93c5fd;
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 0.58);
  color: #64748b;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.race-slot:hover,
.race-slot.is-target {
  border-color: var(--color-blue);
  background: white;
  transform: translateY(-1px);
}

.race-slot > span:first-child {
  position: absolute;
  top: 0.45rem;
  left: 0.55rem;
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: var(--color-blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
}

.race-slot .horse-card {
  width: 100%;
  min-height: 4.5rem;
  border: 0;
  box-shadow: none;
}

.race-slot small { font-size: 0.75rem; }

.horse-bench {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 0.8rem;
}

.horse-bench h2 { margin: 0.15rem 0 0; font-size: 1.15rem; }

.bench-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.bench-horse {
  position: relative;
  border: 2px solid transparent;
  text-align: left;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease, opacity 200ms ease;
}

.bench-horse:hover,
.bench-horse.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgb(217 119 6 / 0.12);
  transform: translateY(-2px);
}

.bench-horse.is-used {
  opacity: 0.35;
  pointer-events: none;
}

.game-actions {
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.result-board {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-md);
}

.dashboard-heading { margin-bottom: 1.5rem; }
.dashboard-badge { background: #e0f2fe; color: #0369a1; }

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 800;
}

.live-status i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgb(245 158 11 / 0.14);
}

.live-status.is-live { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.live-status.is-live i { background: #16a34a; box-shadow: 0 0 0 4px rgb(22 163 74 / 0.14); }
.live-status.is-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.live-status.is-error i { background: #dc2626; box-shadow: 0 0 0 4px rgb(220 38 38 / 0.14); }

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.kpi-card {
  display: grid;
  align-content: start;
  min-height: 8.5rem;
  padding: 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-sm);
}

.kpi-card > span { color: #64748b; font-size: 0.78rem; font-weight: 800; }
.kpi-card strong { margin-top: 0.55rem; font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1; }
.kpi-card small { margin-top: 0.55rem; color: #64748b; font-size: 0.74rem; }
.kpi-groups { border-top: 4px solid var(--color-accent); }
.kpi-questions { border-top: 4px solid var(--color-primary); }
.kpi-top { border-top: 4px solid var(--color-purple); }
.kpi-updated { border-top: 4px solid #0284c7; }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.dashboard-layout.is-group-stage { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 901px) {
  .dashboard-kpis.is-group-stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .is-group-stage .dashboard-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.dashboard-view .group-report-detail, .dashboard-view .dashboard-category-detail ul { font-size: 1rem; line-height: 1.8; }

.dashboard-panel { min-width: 0; padding: 1.4rem; }
.dashboard-confirm-bar { margin: 1rem 0 1.25rem; padding: 1rem 1.25rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; border:1px solid #bae6fd; background:linear-gradient(135deg,#f0f9ff,#ffffff); }
.dashboard-confirm-bar strong { display:block; margin-top:.25rem; font-family:var(--font-display); font-size:1.2rem; }
.dashboard-confirm-bar p { margin:.3rem 0 0; color:#64748b; font-size:.82rem; }
.similar-panel { margin: 0 0 1.25rem; }
.similar-groups { display:grid; gap:.8rem; margin-top:1rem; }
.similar-group { border:1px solid #e2e8f0; border-radius:.8rem; padding:.9rem 1rem; background:#fff; }
.similar-group-head { display:flex; justify-content:space-between; gap:1rem; align-items:center; font-weight:800; }
.similar-group-head small { color:#64748b; font-weight:700; }
.similar-group ul { margin:.6rem 0 0; padding-left:1.2rem; color:#475569; font-size:.83rem; line-height:1.6; }
.student-category-row { display:grid; grid-template-columns:auto minmax(14rem, 1fr); gap:.4rem .7rem; align-items:center; margin:.55rem 0 .65rem; }
.student-category-row label { font-size:.78rem; font-weight:800; color:#475569; }
.student-category-row select { min-height:2.45rem; padding:.45rem .65rem; border:1px solid #cbd5e1; border-radius:.65rem; background:#fff; color:var(--color-foreground); font-weight:700; }
.student-category-row small { grid-column:2; color:#64748b; font-size:.72rem; }
.dashboard-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dashboard-panel h2 { margin: 0.35rem 0 0; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.25; }
.panel-caption { color: #64748b; font-size: 0.72rem; }

.dashboard-bars { display: grid; gap: 1.05rem; margin-top: 1.7rem; }
.dashboard-bar-row { display: grid; grid-template-columns: 5.2rem 1fr 3rem; align-items: center; gap: 0.75rem; }
.dashboard-category-detail { grid-column: 1 / -1; border-top: 1px dashed #fed7aa; padding-top: .55rem; }
.dashboard-category-detail ul { margin: 0; padding-left: 1.1rem; color: #475569; font-size: .8rem; line-height: 1.6; }
.category-filter-label { display:block; margin-top:1.25rem; color:#475569; font-size:.8rem; font-weight:800; }
.category-filter-select { width:100%; margin-top:.45rem; min-height:2.75rem; padding:.5rem .7rem; border:1px solid #cbd5e1; border-radius:.7rem; background:#fff; color:var(--color-foreground); font-weight:700; }
.category-question-list { margin-top:.65rem; max-height:12rem; overflow:auto; }
.category-question-list ul { margin:0; padding-left:1.1rem; color:#475569; font-size:.82rem; line-height:1.65; }
.dashboard-bar-row[role="button"] { cursor: pointer; }
.dashboard-bar-label { font-size: 0.82rem; font-weight: 800; }
.dashboard-bar-track { height: 0.85rem; overflow: hidden; border-radius: 999px; background: #f1f5f9; }
.dashboard-bar-fill { height: 100%; min-width: 0.35rem; border-radius: inherit; transition: width 250ms ease; }
.dashboard-bar-value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; text-align: right; }
.bar-content { background: var(--color-accent); }
.bar-writing { background: var(--color-primary); }
.bar-lesson { background: var(--color-purple); }
.bar-other { background: #0284c7; }
.dashboard-empty { margin: 1.5rem 0 0; padding: 1rem; border: 1px dashed #cbd5e1; border-radius: 0.8rem; color: #64748b; font-size: 0.78rem; text-align: center; }

.dashboard-groups { display: grid; gap: 0.7rem; margin-top: 1.25rem; }
.group-report { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 0.85rem; background: white; }
.group-report-toggle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.75rem; padding: 0.7rem 0.85rem; border: 0; background: transparent; text-align: left; }
.group-report-toggle:hover { background: #f8fafc; }
.group-report-index { display: grid; width: 2.1rem; height: 2.1rem; place-items: center; border-radius: 0.6rem; background: #fef3c7; color: #92400e; font-family: var(--font-display); font-weight: 900; }
.group-report.is-done .group-report-index { background: var(--color-success-soft); color: var(--color-success); }
.group-report-title b, .group-report-title small { display: block; }
.group-report-title b { font-size: 0.86rem; }
.group-report-title small { color: #64748b; font-size: 0.74rem; }
.group-report-chevron { color: #64748b; transition: transform 200ms ease; }
.group-report-toggle[aria-expanded="true"] .group-report-chevron { transform: rotate(90deg); }
.group-report-detail { padding: 0.2rem 0.85rem 0.9rem 3.7rem; }
.group-report-detail[hidden] { display: none; }
.group-report-detail ul { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.group-report-detail li { padding: 0.55rem 0.7rem; border-left: 3px solid var(--color-accent); border-radius: 0 0.55rem 0.55rem 0; background: #fffbeb; color: #334155; font-size: 0.8rem; }
.group-report-detail li strong { display: block; margin-bottom: 0.15rem; color: var(--color-secondary); font-size: 0.72rem; }

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.result-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.result-head p { margin: 0.35rem 0 0; color: #64748b; }

.result-score {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
}

.round-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.round-result {
  padding: 0.8rem;
  border-radius: 0.8rem;
  background: #f8fafc;
  font-size: 0.82rem;
}

.round-result.is-win { background: var(--color-success-soft); color: var(--color-success); }
.round-result.is-loss { background: #fef2f2; color: var(--color-primary-deep); }
.round-result b { display: block; }

.debate-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.78fr) minmax(24rem, 1.35fr);
  gap: 1rem;
  min-height: 40rem;
}

.perspective-panel {
  padding: 1.5rem;
}

.perspective-panel > p {
  color: #64748b;
  font-size: 0.88rem;
}

.character-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.character-list button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.4rem;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: white;
  text-align: left;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.character-list button:hover,
.character-list button.is-selected {
  border-color: var(--color-purple);
  background: var(--color-purple-soft);
  transform: translateX(2px);
}

.character-list button > span {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--color-foreground);
  color: white;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
}
.character-portrait { width: 3rem; height: 3rem; flex: 0 0 3rem; object-fit: cover; object-position: center top; border-radius: 50%; border: 2px solid #f1f5f9; }
.role-preview img { width: 1.75rem; height: 1.75rem; object-fit: cover; object-position: center top; border-radius: 50%; vertical-align: middle; margin-right: 0.2rem; border: 1px solid #e2e8f0; }
.voice-button { display: inline-grid; place-items: center; width: 3rem; height: 3rem; min-width: 44px; min-height: 44px; padding: .65rem; border: 1px solid #cbd5e1; border-radius: 0.75rem; background: #fff; color: var(--color-foreground); transition: background-color 180ms ease, border-color 180ms ease; }
.voice-button svg { width: 1.35rem; height: 1.35rem; }
.voice-button .voice-stop-icon { display: none; }
.voice-button.is-listening .voice-mic-icon { display: none; }
.voice-button.is-listening .voice-stop-icon { display: block; }
.voice-button:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.composer-row .voice-button { align-self: end; }
.voice-button.is-listening { background: #fee2e2; border-color: var(--color-primary); color: var(--color-primary); }
.global-reset { position: fixed; right: 1rem; bottom: 0.75rem; z-index: 20; opacity: 0.45; font-size: 0.7rem; color: #64748b; background: transparent; border: 0; }
.global-reset:hover, .global-reset:focus-visible { opacity: 1; color: var(--color-primary); }

.character-list b,
.character-list small { display: block; }
.character-list b { font-size: 0.9rem; }
.character-list small { color: #64748b; font-size: 0.75rem; }
.character-list button.is-selected small { color: #4c1d95; }
.character-list i { width: 0.75rem; height: 0.75rem; border: 2px solid #cbd5e1; border-radius: 50%; }
.character-list button.is-selected i { border-color: var(--color-purple); background: var(--color-purple); box-shadow: inset 0 0 0 2px white; }

.thinking-tip {
  margin-top: 1.5rem;
  padding: 1rem;
  border-left: 3px solid var(--color-purple);
  border-radius: 0 0.8rem 0.8rem 0;
  background: #faf5ff;
}

.thinking-tip b { color: #6b21a8; font-size: 0.82rem; }
.thinking-tip p { margin: 0.25rem 0 0; color: #475569; font-size: 0.78rem; }

.debate-chat {
  grid-template-rows: auto auto minmax(17rem, 1fr) auto auto;
}

.debate-call-console { background: #faf5ff; border-color: #e9d5ff; }
.debate-call-console .button { background: var(--color-purple); }
.debate-call-console .button.is-listening { background: #b91c1c; }
#debate-call-duration { color: #6b21a8; font-variant-numeric: tabular-nums; font-weight: 800; }
.debate-records { overflow: auto; max-height: 32rem; padding: 1rem; background: white; }
#debate-empty { color: #475569; font-size: .88rem; line-height: 1.65; }
.debate-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: .84rem; line-height: 1.7; }
.debate-table caption { text-align: left; padding: 0 0 .55rem; font-weight: 800; color: #6b21a8; }
.debate-table th, .debate-table td { padding: .7rem .65rem; border-bottom: 1px solid #e2e8f0; vertical-align: top; text-align: left; overflow-wrap: anywhere; white-space: pre-wrap; }
.debate-table thead th { position: sticky; top: -1rem; background: #f3e8ff; color: #581c87; z-index: 1; }
.debate-table thead th:nth-child(1) { width: 3.2rem; }
.debate-table thead th:nth-child(2) { width: 5.4rem; }
.debate-table thead th:nth-child(3) { width: 30%; }
.debate-table tbody tr:nth-child(even) { background: #faf5ff; }
.debate-table tbody th { color: #6b21a8; font-variant-numeric: tabular-nums; }
.debate-direction { color: #6b21a8; font-weight: 700; }
.debate-table .is-pending { color: #64748b; }
@media (max-width: 560px) {
  .board-note { flex-direction: column; align-items: stretch; }
  .debate-table, .debate-table tbody, .debate-table tr { display: block; }
  .debate-table thead { display: none; }
  .debate-table tbody tr { border: 1px solid #e9d5ff; border-radius: .65rem; margin-bottom: .75rem; overflow: hidden; }
  .debate-table tbody th, .debate-table tbody td { display: grid; grid-template-columns: 5.8rem minmax(0, 1fr); gap: .4rem; }
  .debate-table tbody th::before, .debate-table tbody td::before { content: attr(data-label); color: #6b21a8; font-weight: 700; }
}

.debate-intro { background: #faf5ff; }
.debate-intro .assistant-avatar { background: var(--color-purple); }
.debate-intro p { color: #475569; }
.debate-chat .message.assistant > div { border-color: #d8b4fe; background: #faf5ff; }

.prompt-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.25rem 0.8rem;
  background: white;
}

.prompt-tools button {
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #d8b4fe;
  border-radius: 999px;
  background: #faf5ff;
  color: #6b21a8;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 200ms ease, border-color 200ms ease;
}

.prompt-tools button:hover { border-color: var(--color-purple); background: var(--color-purple-soft); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid rgb(154 52 18 / 0.14);
  background: var(--color-background);
  color: #64748b;
  font-size: 0.78rem;
}

.site-footer span { color: var(--color-foreground); font-family: var(--font-display); font-weight: 900; }
.site-footer p { margin: 0; }

.qr-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  color: var(--color-foreground);
  text-align: center;
}

.qr-dialog::backdrop {
  background: rgb(15 23 42 / 0.58);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.dialog-close:hover { transform: rotate(4deg); }

.qr-dialog h2 {
  margin: 0.4rem 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
}

.qr-frame {
  display: grid;
  width: min(17rem, 80%);
  aspect-ratio: 1;
  margin-inline: auto;
  place-items: center;
  padding: 1rem;
  border-radius: 1rem;
  background: white;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; text-align:center; }
.qr-pair > div > b { display:block; margin-top:.5rem; color:#475569; }
@media (max-width:560px){ .qr-pair { grid-template-columns:1fr; } }
.qr-dialog p { margin: 1rem 0 0.25rem; color: #64748b; font-size: 0.8rem; }
.qr-dialog code { color: var(--color-primary); font-size: 0.85rem; }

.toast {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  max-width: min(24rem, calc(100% - 2rem));
  padding: 0.75rem 1rem;
  transform: translateY(2rem);
  border-radius: 0.75rem;
  background: var(--color-foreground);
  box-shadow: var(--shadow-lg);
  color: white;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1024px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .hero-section { grid-template-columns: 1fr 0.9fr; gap: 2rem; }
  .module-card > button { min-height: 31rem; }
  .quiz-layout { grid-template-columns: 14rem 1fr; }
  .summary-panel { grid-column: 1 / -1; }
  .category-list { grid-template-columns: repeat(4, 1fr); }
  .category-item { grid-template-columns: auto 1fr; }
  .category-item strong { grid-column: 1 / -1; text-align: right; }
}

@media (max-width: 820px) {
  .home-shell,
  .lesson-shell { width: min(100% - 1.25rem, 44rem); }
  .hero-section { grid-template-columns: 1fr; min-height: auto; padding-top: 4rem; }
  .hero-copy { text-align: center; }
  .eyebrow,
  .hero-actions,
  .learning-path { justify-content: center; }
  .hero-lead { margin-inline: auto; }
  .hero-visual { min-height: 31rem; }
  .section-heading { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card > button { min-height: 22rem; }
  .story-section { grid-template-columns: 1fr; }
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-layout .chat-panel { order: 1; }
  .quiz-layout .class-panel { order: 2; }
  .chat-panel { min-height: 39rem; }
  .quiz-layout .summary-panel { order: 3; }
  .category-list { grid-template-columns: repeat(2, 1fr); }
  .score-chip { display: none; }
  .lane-labels { display: none; }
  .team-row { grid-template-columns: 5.3rem repeat(3, minmax(0, 1fr)); gap: 0.4rem; padding: 0.55rem; }
  .horse-card { grid-template-columns: 1fr; justify-items: center; gap: 0.35rem; text-align: center; }
  .horse-rank { width: 2.2rem; height: 2.2rem; }
  .horse-bench { grid-template-columns: 1fr; }
  .bench-cards { gap: 0.4rem; }
  .debate-layout { grid-template-columns: 1fr; }
  .perspective-panel { order: 2; }
  .dashboard-kpis { grid-template-columns: repeat(2, 1fr); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-confirm-bar { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 560px) {
  .topbar { min-height: 4.4rem; padding: 0.6rem 0.75rem; }
  .brand-mark { width: 2.35rem; height: 2.35rem; }
  .brand strong { font-size: 1rem; }
  .brand small { display: none; }
  .icon-text-button { width: 2.75rem; padding: 0; justify-content: center; }
  .icon-text-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .view { min-height: calc(100vh - 4.4rem); }
  .hero-section { padding: 3rem 0 4rem; }
  .hero-copy h1 { font-size: clamp(2.75rem, 15vw, 4.6rem); }
  .hero-kicker { font-size: 0.85rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .learning-path { flex-wrap: wrap; }
  .learning-path i { width: 0.7rem; }
  .hero-visual { min-height: 27rem; }
  .hero-visual::before { width: 20rem; height: 20rem; }
  .hero-visual::after { width: 18rem; height: 18rem; }
  .strategy-card { width: calc(100vw - 2.5rem); padding: 0.8rem; }
  .strategy-card-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .seal { width: 3rem; height: 3rem; }
  .seal-one { right: -0.1rem; }
  .seal-two { left: -0.1rem; }
  .module-section { padding: 4rem 0; }
  .module-card > button { min-height: 25rem; }
  .story-section { margin-bottom: 4rem; padding: 2rem 1.25rem; }
  .lesson-view { padding-top: 1.25rem; }
  .lesson-heading { gap: 0.65rem; margin-bottom: 1.25rem; }
  .lesson-badge { display: none; }
  .back-button { width: 2.75rem; height: 2.75rem; }
  .quiz-layout { min-height: auto; }
  .chat-panel { min-height: calc(100vh - 11rem); }
  .messages { max-height: 50vh; }
  .category-list { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: 1fr; }
  .team-name { grid-column: 1; padding-left: 0; }
  .team-name small,
  .team-name strong { display: inline; margin-right: 0.35rem; }
  .horse-card { grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
  .race-slot { min-height: 5rem; }
  .bench-cards { grid-template-columns: 1fr; }
  .game-actions { display: grid; grid-template-columns: 1fr; }
  .round-results { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .dashboard-kpis { gap: 0.55rem; }
  .kpi-card { min-height: 7.5rem; padding: 0.9rem; }
  .dashboard-panel { padding: 1rem; }
  .dashboard-panel-head { flex-direction: column; }
  .dashboard-panel-head .text-button { margin-top: 0; }
  .dashboard-bar-row { grid-template-columns: 4.1rem 1fr 2.3rem; gap: 0.45rem; }
  .student-category-row { grid-template-columns:1fr; }
  .student-category-row small { grid-column:auto; }
  .group-report-detail { padding-left: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* 小问课堂大字版：以投屏问题正文为视觉重点。 */
body { font-size: 20px; font-weight: 600; }
body[data-page] h1, body[data-page] h2, body[data-page] h3 { font-family: var(--font-body); font-weight: 900; }
body[data-page] .button, body[data-page] .topnav button, body[data-page] .icon-text-button { font-size: 20px; font-weight: 800; min-height: 48px; }
body[data-page] .lesson-heading h1 { font-size: clamp(32px, 3vw, 48px); }
.quiz-home { max-width: 1000px; margin: auto; padding: 80px 24px 100px; text-align: center; }
.quiz-home > .assistant-avatar { width: 88px; height: 88px; margin: auto; font-size: 48px; }
body[data-page] .quiz-home h1 { margin: 20px 0 48px; font-size: clamp(56px, 7vw, 88px); }
.quiz-home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
body[data-page] .quiz-home-actions .button { min-height: 144px; font-size: clamp(26px, 3vw, 36px); border: 2px solid var(--color-border); }
body[data-page] .quiz-home-actions svg { width: 32px; height: 32px; }
body[data-page="dashboard"] .lesson-shell { max-width: 1600px; }
body[data-page="dashboard"] .dashboard-heading { margin-bottom: 20px; }
body[data-page="dashboard"] .dashboard-kpis { gap: 12px; margin: 16px 0; }
body[data-page="dashboard"] .kpi-card { min-height: auto; padding: 16px 20px; }
body[data-page="dashboard"] .kpi-card > span { font-size: 22px; font-weight: 800; }
body[data-page="dashboard"] .kpi-card > strong { font-size: 36px; font-weight: 900; }
body[data-page="dashboard"] .kpi-card > small { font-size: 18px; color: #334155; }
body[data-page="dashboard"] .dashboard-confirm-bar { margin-bottom: 18px; padding: 16px 24px; }
body[data-page="dashboard"] #dashboard-phase-title { font-size: 28px; font-weight: 900; }
body[data-page="dashboard"] .dashboard-panel h2 { font-size: 28px; }
body[data-page="dashboard"] .group-report-toggle { padding: 18px; gap: 16px; }
body[data-page="dashboard"] .group-report-title b { font-size: 26px; font-weight: 900; }
body[data-page="dashboard"] .group-report-title small { font-size: 20px; color: #334155; }
body[data-page="dashboard"] .group-report-index { width: 48px; height: 48px; font-size: 28px; }
body[data-page="dashboard"] .group-report-detail { padding: 0 20px 20px; }
body[data-page="dashboard"] .group-report-detail li,
body[data-page="dashboard"] .dashboard-category-detail ul,
body[data-page="dashboard"] .similar-group li { font-size: clamp(28px, 2.5vw, 36px); font-weight: 800; line-height: 1.65; color: #0f172a; overflow-wrap: anywhere; }
body[data-page="dashboard"] .group-report-detail li strong { font-size: 22px; font-weight: 800; }
body[data-page="dashboard"] .dashboard-bar-label,
body[data-page="dashboard"] .dashboard-bar-value,
body[data-page="dashboard"] .similar-group-head { font-size: 26px; font-weight: 900; }
body[data-page="dashboard"] .dashboard-bar-row { grid-template-columns: 110px minmax(20px, 1fr) auto; padding: 18px 12px; }
body[data-page="dashboard"] .dashboard-category-detail { padding-top: 16px; }
.dashboard-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; color: #64748b; font-size: 18px; }
.dashboard-steps li + li::before { content: "→"; margin-right: 8px; color: #64748b; }
.dashboard-steps [aria-current="step"] { color: #075985; font-weight: 900; }
body[data-page="dashboard"] #dashboard-phase-note { font-size: 18px; line-height: 1.6; }
body[data-page="dashboard"] #dashboard-confirm { flex-shrink: 0; }
body[data-page="dashboard"] .group-report-title h3 { margin: 0; font-size: 26px; line-height: 1.5; }
body[data-page="dashboard"] .group-report-toggle { grid-template-columns: auto minmax(0, 1fr); }
body[data-page="dashboard"] .group-report-toggle:hover { background: transparent; }
body[data-page="dashboard"] .dashboard-bars { align-items: start; }
body[data-page="dashboard"] .dashboard-bar-row { min-width: 0; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; background: #fff; }
body[data-page="dashboard"] .dashboard-bar-label { margin: 0; }
body[data-page="dashboard"] .dashboard-category-detail ul { display: grid; gap: 16px; padding: 0; list-style: none; }
body[data-page="dashboard"] .dashboard-category-detail li { display: grid; gap: 4px; padding: 12px 16px; border-radius: 10px; background: #f8fafc; }
body[data-page="dashboard"] .dashboard-question-group { color: #475569; font-size: 20px; }
body[data-page="dashboard"] .similar-summary,
body[data-page="dashboard"] .similar-cluster-note { margin: 10px 0 0; color: #475569; font-size: 18px; line-height: 1.6; }
body[data-page="dashboard"] .similar-groups { align-items: start; gap: 20px; }
body[data-page="dashboard"] .similar-group { min-width: 0; padding: 20px; border: 2px solid #fed7aa; background: #fffcf5; }
body[data-page="dashboard"] .similar-group-head { flex-wrap: wrap; }
body[data-page="dashboard"] .similar-group-head h3 { margin: 0; font-size: 26px; }
body[data-page="dashboard"] .similar-category { padding: 4px 12px; border-radius: 999px; background: #ffedd5; color: #9a3412; font-size: 18px; }
body[data-page="dashboard"] .similar-group ul { display: grid; gap: 12px; padding: 0; list-style: none; }
body[data-page="dashboard"] .similar-group li { display: grid; gap: 4px; padding: 12px 16px; border-radius: 10px; background: white; }
@media (min-width: 1100px) {
  body[data-page="dashboard"] .dashboard-bars,
  body[data-page="dashboard"] .similar-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body[data-page="quiz"] .quiz-entry h2,
body[data-page="quiz"] #quiz-ask-title { font-size: clamp(30px, 3vw, 40px); }
body[data-page="quiz"] #student-group-select,
body[data-page="quiz"] #quiz-input,
body[data-page="quiz"] .message { font-size: 26px; font-weight: 800; line-height: 1.6; }
body[data-page="quiz"] .composer label,
body[data-page="quiz"] .quiz-steps,
body[data-page="quiz"] .quiz-mic-entry > p:first-child,
body[data-page="quiz"] .quiz-finish-panel h3 { font-size: 24px; font-weight: 800; }
@media (max-width: 700px) {
  .quiz-home { padding: 48px 20px; }
  .quiz-home-actions { grid-template-columns: 1fr; gap: 16px; }
  body[data-page] .quiz-home-actions .button { min-height: 100px; }
  body[data-page] .topnav button, body[data-page] .icon-text-button { font-size: 16px; }
  body[data-page="dashboard"] .group-report-title b { font-size: 22px; }
  body[data-page="dashboard"] .group-report-title h3 { font-size: 22px; }
  body[data-page="dashboard"] .group-report-detail li,
  body[data-page="dashboard"] .dashboard-category-detail ul,
  body[data-page="dashboard"] .similar-group li { font-size: 24px; }
  body[data-page="dashboard"] .dashboard-bar-row { grid-template-columns: 90px minmax(10px, 1fr) auto; }
  body[data-page="dashboard"] .dashboard-bar-label { font-size: 22px; }
  body[data-page="quiz"] #quiz-input { font-size: 24px; }
}
