:root {
  --bg-top: #d9e6f2;
  --bg-bot: #f0e4d4;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --inner: rgba(0, 0, 0, 0.045);
  --text: #111111;
  --muted: #8a8a8e;
  --label: #6b6b70;
  --blue: #3aa0ff;
  --blue-deep: #2b8ef0;
  --green: #34c759;
  --orange: #ff9f0a;
  --teal: #30b0c7;
  --purple: #af52de;
  --pill-bg: rgba(120, 120, 128, 0.14);
  --pill-active: rgba(255, 255, 255, 0.92);
  --shadow: 0 8px 28px rgba(40, 50, 70, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-max: 100%;
  --pad-x: 16px;
  --tap: 44px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg-top) 0%, #e4e0dc 48%, var(--bg-bot) 100%);
  background-attachment: fixed;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.shell-body {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x) calc(48px + var(--safe-bottom));
  flex: 1;
}

/* —— 顶栏胶囊 —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(12px + var(--safe-top)) var(--pad-x) 8px;
  background: linear-gradient(180deg, rgba(217,230,242,0.94) 0%, rgba(217,230,242,0.55) 70%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pill-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--pill-bg);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.35);
}

.pill-nav .tab {
  border: 0;
  background: transparent;
  color: #3a3a3c;
  font-size: 14px;
  font-weight: 500;
  min-height: var(--tap);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pill-nav .tab.active {
  background: var(--pill-active);
  color: #000;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 12px;
  border: 0;
  background: var(--pill-bg);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.content {
  padding: 8px 0 0;
  min-width: 0;
}

.view { display: none; }
.view.active { display: block; }

.overlay-view.active {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--bg-top) 0%, #e4e0dc 48%, var(--bg-bot) 100%);
  padding: calc(12px + var(--safe-top)) var(--pad-x) calc(48px + var(--safe-bottom));
  overflow-y: auto;
}
.overlay-view.active .page-head,
.overlay-view.active .card {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}
.overlay-view.active .card { margin-bottom: 14px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 10px;
}
.kp-section-label { margin-top: 4px; }

/* —— 分段胶囊 —— */
.seg-pill {
  display: inline-flex;
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.seg-pill.wide {
  display: flex;
  width: 100%;
  margin-bottom: 14px;
}
.seg {
  border: 0;
  background: transparent;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}
.seg-pill:not(.wide) .seg { flex: initial; }
.seg.active {
  background: var(--pill-active);
  color: #000;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* —— 卡片 —— */
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 0.5px solid rgba(255,255,255,0.65);
}
.card.soft { background: rgba(255,255,255,0.72); }

.card-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--blue-deep);
  font-weight: 500;
  margin-bottom: 8px;
}
.card-kicker .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.blue { background: var(--blue); }
.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.teal { background: var(--teal); }

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.card-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.inner-block {
  position: relative;
  background: var(--inner);
  border-radius: var(--radius-sm);
  padding: 14px 12px 12px;
}
.inner-block .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.inner-block .val {
  font-size: 20px;
  font-weight: 700;
}
.inner-block .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.status-pill {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.status-pill.green { background: rgba(52,199,89,0.15); color: #1a8f3c; }
.status-pill.orange { background: rgba(255,159,10,0.18); color: #c46a00; }
.status-pill.gray { background: rgba(120,120,128,0.14); color: #6b6b70; }
.status-pill.red { background: rgba(255,59,48,0.14); color: #d70015; }
.status-pill.blue { background: rgba(58,160,255,0.16); color: #0070c9; }

/* —— 学年主线：Boss 双关卡条 —— */
.boss-strip {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(255,248,235,0.88) 100%);
  border: 1px solid rgba(255,159,10,0.22);
  box-shadow: 0 10px 32px rgba(255,159,10,0.12), var(--shadow);
}
.boss-head .boss-title { margin-bottom: 4px; }
.boss-head .boss-sub { margin-bottom: 16px; }

.boss-track {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 16px;
}
.boss-path-dot {
  width: 10px;
  align-self: center;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--orange), #ffd60a);
  box-shadow: 0 0 0 4px rgba(255,159,10,0.18);
  position: relative;
}
.boss-path-dot::before,
.boss-path-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 3px;
  background: rgba(255,159,10,0.35);
  border-radius: 2px;
  transform: translateY(-50%);
}
.boss-path-dot::before { right: 100%; margin-right: 2px; }
.boss-path-dot::after { left: 100%; margin-left: 2px; }

.boss-node {
  position: relative;
  background: var(--inner);
  border-radius: 18px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.boss-node.active-boss {
  background: rgba(255,159,10,0.12);
  box-shadow: inset 0 0 0 1.5px rgba(255,159,10,0.35);
}
.boss-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(160deg, #ffe8b8, #ffc857);
  box-shadow: 0 4px 12px rgba(255,159,10,0.28);
}
.boss-badge.soft {
  background: linear-gradient(160deg, #e8e8ed, #d1d1d6);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.boss-meta { position: relative; padding-right: 4px; }
.boss-meta .status-pill {
  position: static;
  display: inline-block;
  margin-bottom: 6px;
}
.boss-name {
  font-size: 15px;
  font-weight: 700;
}
.boss-date {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.boss-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.boss-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  margin-top: 2px;
}
.boss-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffd60a);
}
.boss-node.final .boss-bar i {
  background: linear-gradient(90deg, #a0a0a5, #c7c7cc);
}

/* —— 紧凑闯关路径 —— */
.path-card { padding-bottom: 12px; }
.path-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 12px;
  line-height: 1.4;
}

.level-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
  position: relative;
  padding: 4px 0 2px;
}

.lv-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 8px 4px 6px;
  border: 0;
  background: transparent;
  cursor: default;
  min-height: var(--tap);
  border-radius: 16px;
}
.lv-node.clickable {
  cursor: pointer;
}
.lv-node.clickable:active .lv-orb {
  transform: scale(0.94);
}

.lv-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  position: relative;
  transition: transform 0.12s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.lv-node.done .lv-orb {
  background: linear-gradient(160deg, #5adf7a, var(--green));
  box-shadow: 0 4px 14px rgba(52,199,89,0.35);
}
.lv-node.now .lv-orb {
  background: linear-gradient(160deg, #ffc14d, var(--orange));
  box-shadow: 0 0 0 4px rgba(255,159,10,0.28), 0 6px 16px rgba(255,159,10,0.4);
  animation: pulse-now 1.8s ease-in-out infinite;
}
.lv-node.locked .lv-orb {
  background: linear-gradient(160deg, #d8d8dc, #c7c7cc);
  color: #8a8a8e;
  box-shadow: none;
}
.lv-star {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.lv-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.lv-sub {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.lv-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52,199,89,0.14);
  color: #1a8f3c;
}
.lv-node.now .lv-badge {
  background: rgba(255,159,10,0.18);
  color: #c46a00;
}
.lv-node.locked .lv-badge {
  background: rgba(120,120,128,0.12);
  color: #6b6b70;
}

@keyframes pulse-now {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,159,10,0.28), 0 6px 16px rgba(255,159,10,0.4); }
  50% { box-shadow: 0 0 0 7px rgba(255,159,10,0.12), 0 6px 18px rgba(255,159,10,0.45); }
}

/* 蛇形错落：第二行反向一点视觉节奏 */
.lv-node:nth-child(4) { transform: translateY(4px); }
.lv-node:nth-child(5) { transform: translateY(4px); }
.lv-node:nth-child(6) { transform: translateY(4px); }

/* —— 学期：图形化冲刺面板 —— */
.sprint-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.sprint-panel {
  border: 0;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow);
  border: 0.5px solid rgba(255,255,255,0.65);
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--tap);
  transition: transform 0.1s, box-shadow 0.15s;
}
.sprint-panel:active { transform: scale(0.98); }
.sprint-panel.active {
  box-shadow: 0 0 0 2px rgba(255,159,10,0.45), var(--shadow);
  background: rgba(255,255,255,0.95);
}
.sprint-panel.final.active {
  box-shadow: 0 0 0 2px rgba(58,160,255,0.4), var(--shadow);
}

.sp-ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.sp-ring svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}
.sp-bg {
  fill: none;
  stroke: rgba(0,0,0,0.06);
  stroke-width: 3;
}
.sp-fg {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
}
.sp-fg.mid { stroke: var(--orange); }
.sp-fg.final { stroke: var(--blue); }
.sp-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.sp-body { min-width: 0; flex: 1; }
.sp-label {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.sp-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.sp-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  margin: 6px 0 4px;
}
.sp-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffd60a);
}
.sp-bar.soft i {
  background: linear-gradient(90deg, var(--blue), #7ac4ff);
}
.sp-hint {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}

/* —— 知识点地图节点（图形化） —— */
.kb-map {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kb-node {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  box-shadow: var(--shadow);
  border: 0.5px solid rgba(255,255,255,0.65);
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.kb-node.key {
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,244,220,0.9));
  border-color: rgba(255,159,10,0.25);
}
.kb-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 8px;
  background: linear-gradient(160deg, #e8f3ff, #d4e9ff);
  box-shadow: 0 3px 10px rgba(58,160,255,0.18);
}
.kb-node.key .kb-icon {
  background: linear-gradient(160deg, #ffe8b8, #ffc857);
  box-shadow: 0 3px 10px rgba(255,159,10,0.25);
}
.kb-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}
.kb-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.kb-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue-deep);
  margin-bottom: 4px;
}
.kb-node.key .kb-tag { color: #c46a00; }

.kp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.kp-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--inner);
  color: #3a3a3c;
  line-height: 1.25;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.kb-node .btn-primary,
.kb-node .btn-ghost {
  margin-top: auto;
  width: 100%;
  font-size: 13px;
  padding: 10px 14px;
}

/* —— 按钮 —— */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  min-height: var(--tap);
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(58,160,255,0.35);
  transition: transform 0.1s, background 0.15s;
  white-space: nowrap;
}
.btn-primary:active { transform: scale(0.98); background: var(--blue-deep); }
.btn-primary.full { width: 100%; }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  border: 0;
  background: var(--pill-bg);
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* —— 任务 —— */
.task-list { width: 100%; }
.task-group-title {
  font-size: 15px;
  font-weight: 700;
  margin: 6px 0 10px;
}
.task-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 0.5px solid rgba(255,255,255,0.65);
  cursor: pointer;
  user-select: none;
  min-height: var(--tap);
}
.task-card.done .task-body { opacity: 0.45; }
.task-card.done .task-title { text-decoration: line-through; }

.check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #c7c7cc;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.task-card.done .check {
  background: var(--green);
  border-color: var(--green);
}
.task-card.done .check::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.task-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.task-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.task-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 6px;
}
.task-tag.learn { background: rgba(58,160,255,0.14); color: #0070c9; }
.task-tag.recheck { background: rgba(255,159,10,0.16); color: #c46a00; }
.task-tag.listen { background: rgba(48,176,199,0.16); color: #008299; }

.empty-hint {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
  list-style: none;
}

.done-list { list-style: none; }
.done-list li:not(.empty-hint) {
  font-size: 14px;
  padding: 10px 12px;
  background: var(--inner);
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.voice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.voice-status {
  font-size: 13px;
  color: var(--muted);
}
#voicePlayback {
  width: 100%;
  margin-top: 12px;
}

.history-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.history-card .when {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.history-card .htitle {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.history-card .hbody {
  font-size: 13px;
  color: #3a3a3c;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* —— 自测 —— */
.quiz-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.quiz-btn {
  border: 0;
  border-radius: 999px;
  min-height: var(--tap);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  background: var(--inner);
  color: var(--text);
}
.quiz-btn.ok { background: rgba(52,199,89,0.14); color: #1a8f3c; }
.quiz-btn.warn { background: rgba(255,159,10,0.16); color: #c46a00; }
.quiz-btn.bad { background: rgba(255,59,48,0.12); color: #d70015; }

.summary-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.summary-compose,
.summary-result { min-width: 0; }

.desk-rail { display: none; }

/* 窄屏：Boss 条可叠成上下 */
@media (max-width: 380px) {
  .boss-track {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .boss-path-dot {
    width: 8px;
    height: 8px;
    margin: 0 auto;
  }
  .boss-path-dot::before,
  .boss-path-dot::after {
    width: 3px;
    height: 12px;
    left: 50%;
    right: auto;
    margin: 0;
    transform: translateX(-50%);
  }
  .boss-path-dot::before { top: auto; bottom: 100%; margin-bottom: 2px; }
  .boss-path-dot::after { top: 100%; margin-top: 2px; }
  .sprint-panels { grid-template-columns: 1fr; }
  .kb-map { grid-template-columns: 1fr; }
}

/* ========================================
   iPad 主线：768px – 1199px
   ======================================== */
@media (min-width: 768px) {
  :root {
    --content-max: 800px;
    --pad-x: 32px;
    --tap: 46px;
  }

  .topbar {
    padding-top: calc(16px + var(--safe-top));
    padding-bottom: 10px;
  }
  .topbar-inner { gap: 14px; }
  .pill-nav {
    gap: 6px;
    padding: 5px;
  }
  .pill-nav .tab {
    font-size: 15px;
    padding: 10px 22px;
  }
  .icon-btn {
    width: 46px;
    height: 46px;
    font-size: 22px;
    border-radius: 14px;
  }

  .page-head h1 { font-size: 32px; }
  .card { padding: 20px 22px 18px; }
  .card-title { font-size: 20px; }
  .seg {
    font-size: 14px;
    min-height: 40px;
    padding: 8px 16px;
  }

  .level-map {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px 6px;
  }
  .lv-node:nth-child(n) { transform: none; }
  .lv-orb { width: 56px; height: 56px; font-size: 17px; }

  .boss-date { font-size: 22px; }
  .sprint-panels { gap: 14px; }
  .kb-map {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .kb-name { font-size: 15px; }

  .summary-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
  }
  .summary-result .section-label { margin-top: 0; }
}

@media (min-width: 768px) and (max-width: 899px) {
  :root { --content-max: 720px; --pad-x: 24px; }
}

@media (min-width: 900px) and (max-width: 1199px) {
  :root { --content-max: 840px; --pad-x: 36px; }
}

/* ========================================
   Mac：≥1200 — 主栏 + 右侧窄栏
   ======================================== */
@media (min-width: 1200px) {
  :root {
    --content-max: 1180px;
    --pad-x: 40px;
    --tap: 48px;
  }

  .shell-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
  }

  .content {
    max-width: 960px;
    justify-self: center;
    width: 100%;
  }

  .desk-rail {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: calc(72px + var(--safe-top));
    padding-top: 8px;
  }
  .rail-card { margin-bottom: 14px; }
  .rail-nodes {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .rail-today-title { font-size: 17px; }

  .pill-nav .tab {
    font-size: 16px;
    padding: 11px 26px;
  }
  .page-head h1 { font-size: 34px; }

  .kb-map {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .summary-layout {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 20px;
  }

  .overlay-view.active .card,
  .overlay-view.active .page-head {
    max-width: 720px;
  }
}

@media (min-width: 1400px) {
  :root { --content-max: 1280px; }
  .shell-body {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
  }
}
