:root {
  --bg: #18222f;
  --bg-deep: #10131f;
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --panel-light: #ffffff;
  --ink: #f8fbff;
  --ink-muted: rgba(248, 251, 255, 0.72);
  --text: #172033;
  --subtext: #66708a;
  --brand: #58d6ff;
  --brand-2: #ffe36e;
  --good: #38d88b;
  --warn: #ffbe4d;
  --bad: #ff6b82;
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(55, 216, 139, 0.16) 0%, transparent 32%),
    linear-gradient(225deg, rgba(255, 107, 130, 0.16) 0%, transparent 34%),
    linear-gradient(165deg, #171625 0%, #123b35 42%, #3a2636 70%, #27301e 100%);
}

button,
input {
  font: inherit;
}

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

.app-shell {
  position: relative;
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
  overflow: hidden;
}

.app-shell::before,
.app-shell::after {
  position: fixed;
  z-index: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
  box-shadow:
    34px 68px currentColor,
    178px 42px currentColor,
    296px 126px currentColor,
    62px 308px currentColor,
    344px 370px currentColor,
    226px 548px currentColor,
    26px 640px currentColor,
    422px 720px currentColor;
  content: "";
  pointer-events: none;
}

.app-shell::before {
  top: 0;
  left: 0;
}

.app-shell::after {
  right: 0;
  bottom: 0;
  opacity: 0.45;
}

.app-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
}

.page {
  max-width: 900px;
  margin: 0 auto;
  animation: pageIn 180ms ease-out;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar,
.hero-card,
.glass-card,
.white-card,
.quiz-stage,
.panel-strip {
  border-radius: var(--radius);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.student-mini {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background:
    linear-gradient(145deg, #ffdc6b 0%, #ff8d66 48%, #5cc9ff 100%);
  box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.22);
  font-size: 24px;
}

.title-block {
  min-width: 0;
}

.app-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
}

.nickname,
.muted {
  color: var(--ink-muted);
  font-size: 13px;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 227, 110, 0.42);
  border-radius: 999px;
  background: rgba(255, 227, 110, 0.14);
  color: #fff3a5;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255, 190, 77, 0.34);
  border-radius: 999px;
  background: rgba(255, 190, 77, 0.12);
  color: #ffe2a1;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.progress-wrap {
  margin-top: 12px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 13px;
}

.progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58d6ff 0%, #38d88b 54%, #ffe36e 100%);
  transition: width 220ms ease;
}

.hero-card {
  position: relative;
  margin-top: 18px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    linear-gradient(28deg, rgba(56, 216, 139, 0.18), rgba(255, 227, 110, 0.12) 46%, rgba(255, 107, 130, 0.12));
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background:
    linear-gradient(150deg, #45d6ff 0%, #4f6dff 44%, #183054 100%);
  box-shadow:
    inset -16px -18px 0 rgba(0, 0, 0, 0.12),
    0 0 0 14px rgba(88, 214, 255, 0.08);
  content: "";
}

.hero-card::before {
  position: absolute;
  right: 8px;
  bottom: 30px;
  z-index: 1;
  width: 132px;
  height: 22px;
  border: 4px solid rgba(255, 227, 110, 0.86);
  border-right-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
  content: "";
}

.card-content {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 8px;
  color: #fff4b8;
  font-size: 14px;
  font-weight: 800;
}

.hero-title {
  margin: 0;
  max-width: 430px;
  font-size: clamp(28px, 8vw, 52px);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 390px;
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.7;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 460px;
  margin-top: 16px;
}

.task-chip {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.task-chip strong {
  display: block;
  font-size: 18px;
}

.task-chip span {
  color: var(--ink-muted);
  font-size: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-btn {
  margin-top: 18px;
  background: linear-gradient(135deg, #ffe36e 0%, #ffb84f 100%);
  color: #283047;
  box-shadow: 0 12px 24px rgba(255, 190, 77, 0.24);
}

.secondary-btn {
  background: #e9f8ff;
  color: #15617d;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.nav-item:active,
.option-btn:active,
.chapter-link:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.ghost-btn:focus-visible,
.nav-item:focus-visible,
.option-btn:focus-visible,
.chapter-link:focus-visible,
.profile-row:focus-visible {
  outline: 2px solid #ffe36e;
  outline-offset: 2px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.ability-grid,
.stats-grid,
.profile-grid {
  display: grid;
  gap: 10px;
}

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

.glass-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(16px);
}

.ability-card {
  min-height: 98px;
  padding: 14px;
}

.ability-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.ability-card small {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

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

.ability-performance-card {
  min-height: 116px;
  padding: 14px;
}

.ability-performance-card strong,
.ability-performance-card small,
.ability-pending {
  display: block;
}

.ability-performance-card strong {
  color: var(--text);
}

.ability-performance-card small {
  margin-top: 6px;
  color: var(--subtext);
  font-size: 12px;
}

.ability-pending {
  margin-top: 18px;
  color: #7a86a0;
  font-size: 13px;
  font-weight: 800;
}

.stars {
  display: block;
  margin-top: 14px;
  color: #ffe36e;
  font-size: 18px;
  letter-spacing: 0;
}

.daily-radar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.course-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 13px 14px;
}

.course-context > div {
  min-width: 0;
}

.course-context strong,
.course-context small,
.context-kicker {
  display: block;
}

.context-kicker {
  color: #fff3a5;
  font-size: 11px;
  font-weight: 800;
}

.course-context strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
}

.course-context small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

.daily-tasks {
  margin-top: 4px;
}

.task-list,
.history-list {
  display: grid;
  gap: 8px;
}

.task-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  font-weight: 700;
}

.task-row small {
  display: block;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
}

.task-row > strong {
  color: #fff3a5;
  font-size: 12px;
  white-space: nowrap;
}

.task-check {
  color: var(--ink-muted);
  font-size: 20px;
}

.task-row.done .task-check {
  color: var(--good);
}

.completion-note,
.sample-notice {
  max-width: 460px;
  margin: 14px 0 0;
  color: #fff3a5;
  font-size: 13px;
  line-height: 1.6;
}

.sample-notice {
  color: #c5f3e2;
}

.quota-summary {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.mini-stat {
  padding: 13px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
}

.mini-stat span {
  color: var(--ink-muted);
  font-size: 12px;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.study-summary-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.study-summary-link span,
.study-summary-link small {
  display: block;
}

.study-summary-link span {
  font-weight: 800;
}

.study-summary-link small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
}

.study-summary-link b {
  grid-row: span 2;
  color: #fff3a5;
  font-size: 18px;
}

.challenge-board {
  margin-top: 18px;
}

.panel-strip {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.stage-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stage-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.stage-card.current {
  border-color: rgba(88, 214, 255, 0.5);
  background: rgba(88, 214, 255, 0.14);
}

.stage-card.completed {
  border-color: rgba(56, 216, 139, 0.42);
  background: rgba(56, 216, 139, 0.12);
}

.stage-card.locked {
  opacity: 0.66;
}

.challenge-subtitle {
  margin-left: 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

.stage-badge {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: rgba(88, 214, 255, 0.18);
  color: #9ee8ff;
  font-weight: 900;
}

.stage-card h3,
.stage-card p {
  margin: 0;
}

.stage-card p {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 13px;
}

.stage-count {
  color: #fff3a5;
  font-weight: 900;
}

.quiz-stage {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: var(--shadow);
}

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

.hud-item {
  min-height: 68px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.hud-item span {
  color: var(--ink-muted);
  font-size: 12px;
}

.hud-item strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.question-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.question-box h2 {
  margin: 0;
  color: #29324a;
  font-size: 20px;
  line-height: 1.55;
  letter-spacing: 0;
}

.question-meta {
  margin-bottom: 9px;
  color: var(--subtext);
  font-size: 12px;
  font-weight: 700;
}

.question-instruction {
  margin: -2px 0 12px;
  color: #277b91;
  font-size: 13px;
  font-weight: 800;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.option-btn {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid #dfe6f5;
  border-radius: var(--radius);
  background: #f7faff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.option-btn:not(:disabled):active {
  transform: translateY(1px);
}

.option-btn:not(:disabled):focus-visible {
  outline: 3px solid rgba(39, 125, 155, 0.26);
  outline-offset: 2px;
}

.option-btn:disabled {
  cursor: default;
}

.option-key {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e6eefc;
  color: #35527a;
  font-weight: 900;
}

.option-btn.correct {
  border-color: rgba(56, 216, 139, 0.7);
  background: #e9fff4;
}

.option-btn.correct .option-key {
  background: var(--good);
  color: #052313;
}

.option-btn.wrong {
  border-color: rgba(255, 107, 130, 0.66);
  background: #fff0f3;
}

.option-btn.wrong .option-key {
  background: var(--bad);
  color: #fff;
}

.option-btn.selected {
  border-color: #55bdc6;
  background: #e9faff;
}

.question-box > .secondary-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  font-size: 16px;
  font-weight: 800;
}

.question-image {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 12px auto;
  border-radius: var(--radius);
  object-fit: contain;
  background: #f5f8ff;
}

.option-btn .question-image {
  max-height: 100px;
  margin: 8px 0 0;
}

.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.feedback {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: #f4f7ff;
  color: var(--text);
}

.feedback strong {
  display: block;
  margin-bottom: 6px;
}

.feedback-answer,
.feedback-why {
  padding: 10px 0;
  border-top: 1px solid #e5eaf4;
}

.feedback-answer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.feedback-answer span,
.feedback-why > span {
  color: var(--subtext);
  font-size: 12px;
  font-weight: 800;
}

.feedback-answer strong {
  margin: 0;
  color: #277b91;
  font-size: 16px;
}

.feedback-why > span {
  display: block;
  margin-bottom: 4px;
}

.analysis-copy {
  line-height: 1.7;
}

.feedback-why .analysis-copy {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.feedback-reward {
  margin: 8px 0 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.6;
}

.milestone-note {
  margin: 10px 0 0;
  color: #a26b00;
  font-size: 13px;
  font-weight: 900;
}

.feedback-tag {
  margin: 0;
  color: #0c8a52;
  font-size: 12px;
  font-weight: 800;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.feedback-actions .secondary-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.feedback .primary-btn {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  box-shadow: 0 8px 18px rgba(22, 42, 78, 0.18);
}

.feedback.good strong {
  color: #0c8a52;
}

.feedback.bad strong {
  color: #d6405a;
}

.completion-panel,
.stage-complete-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 227, 110, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    rgba(255, 227, 110, 0.08);
  box-shadow: var(--shadow);
}

.completion-panel h2,
.stage-complete-panel h2 {
  margin: 0;
  font-size: 26px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.summary-grid > div {
  min-width: 0;
  padding: 11px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  font-size: 20px;
}

.summary-grid span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
}

.stage-complete-panel .primary-btn,
.completion-panel .primary-btn {
  margin-top: 16px;
}

.white-card {
  padding: 16px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(7, 16, 32, 0.18);
}

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

.stat-card {
  min-height: 118px;
  padding: 15px;
}

.stat-card span {
  color: var(--subtext);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.badge-list {
  display: grid;
  gap: 10px;
}

.badge-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e8edf8;
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.badge-item.locked {
  color: #8b94a7;
  background: #f5f6f9;
}

.badge-item small {
  margin-left: auto;
  color: var(--subtext);
  font-size: 11px;
  white-space: nowrap;
}

.badge-item.selected {
  border-color: #92dfff;
  background: #eefaff;
}

.badge-item > span:nth-child(2) {
  min-width: 0;
}

.badge-condition {
  display: block;
  margin: 4px 0 0;
  color: var(--subtext) !important;
  font-size: 11px !important;
  font-weight: 600;
  white-space: normal !important;
}

.bank-tree {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.bank-stat-list {
  display: grid;
  gap: 10px;
}

.bank-stat-card {
  padding: 14px;
}

.bank-stat-card p {
  text-align: left;
}

.bank-stat-card .bank-stat-head {
  width: 100%;
}

.bank-detail-summary {
  margin-top: 16px;
}

.bank-detail-section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.09);
}

.bank-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.bank-detail-head b {
  color: #fff3a5;
}

.bank-detail-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bank-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.bank-detail-row small {
  color: var(--ink-muted);
  white-space: nowrap;
}

.bank-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bank-stat-head b {
  color: var(--text);
  white-space: nowrap;
}

.bank-stat-card p,
.bank-stat-card small {
  display: block;
  margin: 8px 0 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.5;
}

.bank-path {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}

.bank-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-height: 96px;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.bank-choice strong {
  color: var(--text);
  font-size: 18px;
}

.bank-choice small {
  margin-top: 10px;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.5;
}

.bank-choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.grade-card {
  padding: 14px;
}

.grade-card h3 {
  margin: 0 0 12px;
  color: var(--text);
}

.chapter-grid {
  display: grid;
  gap: 8px;
}

.chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #e5ebf6;
  border-radius: var(--radius);
  background: #f8fbff;
  color: #27334d;
  cursor: pointer;
  font-weight: 800;
}

.chapter-link small {
  color: var(--subtext);
  font-weight: 700;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.profile-head .avatar {
  width: 64px;
  height: 64px;
  font-size: 32px;
}

.profile-grid {
  margin-top: 16px;
}

.study-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.study-summary div {
  min-width: 0;
}

.study-summary strong,
.study-summary span {
  display: block;
}

.study-summary span {
  margin-top: 4px;
  color: var(--subtext);
  font-size: 12px;
}

.learning-subjects,
.learning-map,
.today-breakthrough {
  margin-top: 20px;
}

.subject-progress-list,
.breakthrough-list {
  display: grid;
  gap: 10px;
}

.subject-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.6fr) auto;
  align-items: center;
  width: 100%;
  min-height: 58px;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.subject-progress-card.selected {
  border-color: rgba(88, 214, 255, 0.72);
  background: rgba(88, 214, 255, 0.14);
}

.subject-progress-card strong,
.subject-progress-card span,
.subject-progress-card b {
  display: block;
}

.subject-progress-card span {
  color: var(--ink-muted);
  font-size: 12px;
}

.subject-progress-card b {
  color: #fff3a5;
  font-size: 12px;
  white-space: nowrap;
}

.map-intro {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.map-path {
  display: grid;
  gap: 0;
}

.map-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
}

.map-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--ink-muted);
  font-size: 18px;
  font-weight: 900;
}

.map-mastered .map-marker {
  border-color: rgba(56, 216, 139, 0.72);
  color: var(--good);
}

.map-improving .map-marker {
  border-color: rgba(255, 227, 110, 0.72);
  color: #ffe36e;
}

.map-breakthrough .map-marker {
  border-color: rgba(255, 190, 77, 0.72);
  color: var(--warn);
}

.map-node-head,
.breakthrough-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-node-head span {
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
}

.map-node-body p,
.breakthrough-card p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.map-link {
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ee8ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.map-connector {
  width: 2px;
  height: 13px;
  margin-left: 29px;
  background: rgba(255, 255, 255, 0.24);
}

.breakthrough-card {
  padding: 15px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(7, 16, 32, 0.18);
}

.breakthrough-head strong,
.breakthrough-head span {
  display: block;
}

.breakthrough-head strong {
  color: var(--text);
}

.breakthrough-head span {
  margin-top: 4px;
  color: var(--subtext);
  font-size: 12px;
}

.breakthrough-head b {
  flex: 0 0 auto;
  color: #c77819;
  font-size: 13px;
}

.breakthrough-card p {
  color: var(--subtext);
}

.breakthrough-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.breakthrough-success {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 216, 139, 0.42);
  border-radius: var(--radius);
  background: rgba(56, 216, 139, 0.12);
  color: #b9f5d6;
  font-size: 13px;
  font-weight: 800;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.profile-row span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-row:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.subpage-back {
  margin-top: 16px;
}

.history-list {
  margin-top: 16px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  line-height: 1.5;
}

.history-row small {
  flex: 0 0 auto;
  color: var(--subtext);
}

.settings-id {
  overflow-wrap: anywhere;
  color: var(--subtext);
  font-size: 12px;
}

.onboarding .bottom-nav {
  display: none;
}

.onboarding .app-main {
  padding-bottom: 24px;
}

.welcome-page .hero-card {
  margin-top: 0;
}

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

.welcome-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 76px;
  gap: 7px;
  padding: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.welcome-choice strong {
  font-size: 18px;
}

.welcome-choice span {
  color: var(--ink-muted);
  font-size: 12px;
}

.choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.choice-head > span {
  flex: 0 0 auto;
  color: #fff3a5;
  font-size: 12px;
  font-weight: 800;
}

.course-choice {
  min-height: 140px;
}

.course-choice .course-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  margin-top: 4px;
}

.course-choice .course-metrics small {
  min-width: 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
}

.course-choice em {
  margin-top: auto;
  color: #9ee8ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 16, 32, 0.88);
  box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(248, 251, 255, 0.62);
  cursor: pointer;
  font-size: 12px;
}

.nav-icon {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
  line-height: 1;
}

.nav-item.active {
  background: rgba(88, 214, 255, 0.16);
  color: #9ee8ff;
}

.empty-note {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-muted);
}

@media (min-width: 720px) {
  .app-main {
    padding-right: 28px;
    padding-left: 28px;
  }

  .desktop-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 18px;
    align-items: start;
  }

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

  .stage-card {
    grid-template-columns: 1fr;
  }

  .quiz-stage {
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
  }

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

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

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

@media (max-width: 410px) {
  .topbar {
    align-items: flex-start;
  }

  .app-title {
    font-size: 22px;
  }

  .task-grid,
  .ability-grid {
    grid-template-columns: 1fr;
  }

  .quiz-hud {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .daily-radar {
    grid-template-columns: 1fr;
  }

  .course-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .course-context .compact-btn {
    width: 100%;
  }

  .course-choice .course-metrics {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .study-summary {
    grid-template-columns: 1fr;
  }

  .hero-card::after {
    opacity: 0.62;
  }

  .history-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Parent report: compact, readable summaries for a quick mobile check-in. */
.parent-report-page {
  color: var(--text);
}

.parent-report-page .topbar {
  color: var(--ink);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.report-empty,
.report-overview,
.report-volume,
.report-week,
.report-insight,
.report-review,
.report-streak {
  margin-top: 16px;
}

.report-empty {
  padding: 24px 18px;
  text-align: center;
}

.report-empty h2,
.report-section-head h2,
.report-review h2 {
  margin: 0;
  color: var(--text);
}

.report-empty > p:not(.privacy-note) {
  margin: 10px auto 0;
  color: var(--subtext);
  line-height: 1.7;
}

.report-kicker {
  margin: 0 0 6px;
  color: #287d9b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.report-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.report-section-head > span {
  flex: 0 0 auto;
  color: var(--subtext);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.report-overview {
  padding: 18px;
}

.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.report-stat-grid > div {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid #e5edf6;
  border-radius: var(--radius);
  background: #f7fbff;
}

.report-stat-grid strong,
.report-stat-grid span {
  display: block;
}

.report-stat-grid strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
}

.report-stat-grid span {
  margin-top: 5px;
  color: var(--subtext);
  font-size: 12px;
}

.report-volume,
.report-week {
  padding: 16px 18px;
}

.report-volume-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.report-volume-line strong {
  color: #167b67;
  font-size: 18px;
}

.report-volume-line span {
  color: var(--subtext);
  font-size: 12px;
  text-align: right;
}

.report-day-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.report-day-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(74px, auto);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: #f7f9fd;
  color: var(--subtext);
  font-size: 13px;
}

.report-day-row strong {
  white-space: nowrap;
}

.report-day-row small {
  color: var(--subtext);
  font-size: 12px;
  text-align: right;
}

.report-day-row .has-study {
  color: #168461;
}

.report-day-row .no-study {
  color: #9aa3b5;
}

.report-section {
  margin-top: 20px;
}

.report-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.report-subject-card {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.report-subject-card strong {
  color: var(--text);
}

.report-subject-card span,
.report-subject-card b {
  color: var(--subtext);
  font-size: 12px;
  font-weight: 700;
}

.report-subject-card b {
  color: #167b67;
}

.report-muted {
  color: var(--subtext);
  font-size: 13px;
}

.report-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.report-insight {
  min-width: 0;
  padding: 16px 18px;
}

.report-bullet-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--subtext);
  line-height: 1.6;
}

.report-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.report-review p:not(.report-kicker) {
  margin: 8px 0 0;
  color: var(--subtext);
}

.report-review .secondary-btn {
  flex: 0 0 auto;
}

.report-streak {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
}

.report-streak strong {
  color: var(--text);
}

.report-streak span {
  color: var(--subtext);
  font-size: 13px;
  text-align: right;
}

.privacy-note {
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.parent-report-page > .report-empty .privacy-note {
  color: var(--subtext);
}

@media (max-width: 410px) {
  .report-stat-grid,
  .report-subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-section-head,
  .report-volume-line,
  .report-review,
  .report-streak {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-section-head > span,
  .report-volume-line span,
  .report-streak span {
    text-align: left;
  }

  .report-day-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .report-day-row small {
    grid-column: 1 / -1;
    text-align: left;
  }

  .report-two-col {
    grid-template-columns: 1fr;
  }

  .report-review .secondary-btn {
    width: 100%;
  }
}
