/* ==========================================================================
   伴学 banxue.tech
   幼儿→初中 · 知识点成长地图
   设计原则：内容优先，克制配色，一处「路径」作为记忆点
   ========================================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #5b616e;
  --ink-3: #6b7280;
  --line: #e8eaee;
  --line-strong: #dcdfe5;

  --brand: #0b8266;
  --brand-ink: #086e57;
  --brand-soft: #e3f5ee;
  --amber: #f2a81d;
  --amber-soft: #fdf0d7;

  --blue: #3b82f6;
  --blue-soft: #e8f0fe;
  --red: #e5484d;
  --red-deep: #b91c1c;
  --red-soft: #fde9e9;
  --coral-deep: #c2410c;
  --green: #10b981;
  --green-soft: #e2f6ee;
  --violet: #8b5cf6;
  --violet-soft: #efe9fd;
  --orange: #f97316;
  --orange-soft: #feede1;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.05);
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.05), 0 8px 24px -14px rgba(22, 24, 29, 0.14);

  --px: 20px;
  --nav-h: 80px;
  --font: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(14, 164, 127, 0.35);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 10px;
}

/* ---------- 版心 ---------- */

.container {
  width: min(1120px, 100% - var(--px) * 2);
  margin-inline: auto;
}

.page {
  padding: clamp(18px, 3vw, 34px) 0 40px;
}

@media (min-width: 920px) {
  .page {
    padding-bottom: 72px;
  }
}

.stack > * + * {
  margin-top: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.grid--two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ---------- 顶部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
}

.brand__mark svg {
  width: 18px;
  height: 18px;
}

.brand__sub {
  display: none;
  margin-top: -3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.site-nav {
  display: none;
  gap: 2px;
}

.site-nav a {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.site-nav a:hover {
  background: #f2f3f5;
  color: var(--ink);
}

.site-nav a.is-active {
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.star-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #8a5a00;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.star-chip svg {
  width: 15px;
  height: 15px;
  color: var(--amber);
}

.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.avatar-chip__face {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 15px;
}

@media (min-width: 920px) {
  .site-nav {
    display: flex;
  }
}

/* ---------- 文字 ---------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.h2 {
  font-size: clamp(20px, 2.4vw, 26px);
}

.h3 {
  font-size: 17px;
}

.lead {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 32em;
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: 13.5px;
  line-height: 1.65;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(19px, 2.2vw, 24px);
}

.section-head__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink);
}

.section-head__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-ink);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn--sm {
  min-height: 38px;
  padding: 7px 15px;
  font-size: 14px;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.2vw, 24px);
  box-shadow: var(--shadow-sm);
}

.card--flat {
  box-shadow: none;
}

/* ---------- 首屏 ---------- */

.hero {
  display: grid;
  gap: 26px;
  align-items: start;
  padding: 10px 0 6px;
}

@media (min-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: 52px;
    padding: 26px 0 14px;
  }
}

.hero__title {
  margin: 0;
  max-width: 13em;
}

.hero__lead {
  margin: 16px 0 0;
  max-width: 28em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* 学段切换 */
.stage-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.stage-tabs a {
  padding: 7px 18px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.stage-tabs a:hover {
  color: var(--ink);
}

.stage-tabs a.is-active {
  background: var(--ink);
  color: #fff;
}

/* ---------- 学科卡 ---------- */

.subject-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.subject-card:hover {
  border-color: var(--subject, var(--brand));
  box-shadow: var(--shadow-sm);
}

.subject-card.is-active {
  border-color: var(--subject, var(--brand));
  box-shadow: 0 0 0 1px var(--subject, var(--brand));
}

.subject-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--subject-soft, var(--brand-soft));
  color: var(--subject, var(--brand-ink));
  font-size: 17px;
  font-weight: 750;
  flex: none;
}

.subject-card__body {
  flex: 1;
  min-width: 0;
}

.subject-card__body b {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.subject-card__body span {
  font-size: 12.5px;
  color: var(--ink-3);
}

.subject--blue {
  --subject: var(--blue);
  --subject-soft: var(--blue-soft);
}

.subject--red {
  --subject: var(--red);
  --subject-soft: var(--red-soft);
}

.subject--green {
  --subject: var(--green);
  --subject-soft: var(--green-soft);
}

.subject--violet {
  --subject: var(--violet);
  --subject-soft: var(--violet-soft);
}

.subject--orange {
  --subject: var(--orange);
  --subject-soft: var(--orange-soft);
}

/* ---------- 知识点地图 ---------- */

.map {
  position: relative;
  padding: 6px 0 10px;
}

.map__line {
  position: absolute;
  left: 22px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line-strong);
}

.map__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
  min-height: 58px;
}

.map__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-3);
}

.map__item.is-done .map__dot {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.map__item.is-current .map__dot {
  border-color: var(--amber);
  background: var(--amber);
  color: #fff;
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.map__card {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.map__item.is-current .map__card {
  border-color: var(--amber);
}

.map__card b {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
}

.map__card small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map__item.is-locked .map__card {
  background: #fafafa;
  border-color: var(--line);
}

.map__item.is-locked .map__card b {
  color: var(--ink-3);
}

.map__tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #8a5a00;
  font-size: 11px;
  font-weight: 700;
}

.map__item.is-done .map__tag {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

/* 地图卡片容器（首页右侧） */
.map-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.map-panel__head b {
  font-size: 15px;
  font-weight: 700;
}

.map-panel__head span {
  font-size: 12.5px;
  color: var(--ink-3);
}

.map-panel__body {
  padding: 10px 18px 14px;
}

.map-panel__foot {
  display: flex;
  justify-content: center;
  padding: 0 18px 16px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 48px;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}

.site-footer__grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.site-footer .brand {
  font-size: 16px;
}

.site-footer .brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.site-footer__links {
  display: grid;
  gap: 5px;
}

.site-footer__links strong {
  font-size: 13px;
  color: var(--ink);
}

.site-footer__links a {
  color: var(--ink-2);
}

.site-footer__links a:hover {
  color: var(--brand-ink);
}

/* ---------- 页头 ---------- */

.page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.page-head__title {
  font-size: clamp(26px, 3.3vw, 36px);
  letter-spacing: -0.02em;
}

.page-head .lead {
  margin: 0;
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-3);
}

.breadcrumb a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 小练习卡片 ---------- */

.game-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.game-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.game-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-card__title {
  font-size: 17px;
  font-weight: 700;
}

.game-card__desc {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.game-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}

.game-card__foot > span:last-child {
  color: var(--brand-ink);
  font-weight: 700;
}

.tile {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex: none;
  font-weight: 750;
}

.tile svg {
  width: 20px;
  height: 20px;
}

.tile--orange {
  background: var(--orange-soft);
  color: #c2410c;
}

.tile--blue {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.tile--teal,
.tile--green {
  background: var(--green-soft);
  color: #047857;
}

.tile--pink,
.tile--violet {
  background: var(--violet-soft);
  color: #6d28d9;
}

.tile--yellow {
  background: var(--amber-soft);
  color: #92600a;
}

.tile__math {
  font-size: 15px;
}

.tile__hanzi {
  font-size: 20px;
  line-height: 1;
}

.star-row {
  display: inline-flex;
  gap: 2px;
  color: var(--amber);
  font-size: 13px;
}

.star-row .off {
  color: var(--line-strong);
}

/* ---------- 文章 ---------- */

.prose {
  font-size: 16.5px;
  line-height: 1.9;
  color: #2b3038;
}

.prose > * + * {
  margin-top: 14px;
}

.prose h2 {
  font-size: 21px;
  margin-top: 32px;
}

.prose h3 {
  font-size: 17px;
  margin-top: 22px;
}

.prose ul,
.prose ol {
  padding-left: 20px;
}

.prose li + li {
  margin-top: 4px;
}

.prose strong {
  font-weight: 700;
  color: var(--ink);
}

.prose .callout {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--amber-soft);
  font-size: 15px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  font-weight: 700;
  background: #f7f8fa;
}

.article-layout {
  display: grid;
  gap: 28px;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}

.toc {
  position: sticky;
  top: 90px;
  font-size: 14px;
}

.toc a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.toc a:hover {
  color: var(--brand-ink);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 16px;
  margin-bottom: 8px;
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--brand);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0 0 13px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- 提示 ---------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(400px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: toast-in 0.2s ease;
}

.toast--success,
.toast--star {
  background: var(--brand-ink);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
}

.alert--success {
  background: var(--green-soft);
  color: #047857;
}

/* ---------- 表单 ---------- */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field label,
.field > span.small {
  font-size: 13.5px;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.field textarea {
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.field--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-picker label {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 22px;
  cursor: pointer;
}

.avatar-picker input:checked + label {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- 空状态 / 表格 ---------- */

.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--ink-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.empty__emoji {
  display: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 14px;
}

.table th,
.table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  background: #f7f8fa;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}

.table tr:last-child td {
  border-bottom: 0;
}

/* ---------- 我的 ---------- */

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--brand-soft);
  font-size: 36px;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stat {
  padding: 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.stat__value {
  display: block;
  font-size: 25px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: 12.5px;
  color: var(--ink-3);
}

.badge-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.badge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.badge__emoji {
  font-size: 18px;
  line-height: 1.4;
}

.badge__text strong {
  display: block;
  font-size: 14px;
}

.badge__text span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

.badge.is-locked {
  opacity: 0.55;
}

/* ---------- 小元素 ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.chip--coral {
  background: var(--red-soft);
  color: #b91c1c;
}

.chip--sun {
  background: var(--amber-soft);
  color: #8a5a00;
}

.chip--teal,
.chip--green {
  background: var(--green-soft);
  color: #047857;
}

.chip--violet {
  background: var(--violet-soft);
  color: #6d28d9;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.divider {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}

/* ---------- 游戏页 ---------- */

.game-shell {
  max-width: 760px;
  margin-inline: auto;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.hud-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.hud-item strong {
  font-size: 19px;
  font-weight: 750;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.timer-track {
  height: 8px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
  margin-bottom: 16px;
}

.timer-track__bar {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.25s linear;
}

.timer-track.is-low .timer-track__bar {
  background: var(--amber);
}

.stage {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stage--question {
  display: grid;
  gap: 22px;
  place-items: center;
  min-height: 320px;
}

.question {
  font-size: clamp(40px, 8vw, 58px);
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

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

.answer {
  min-height: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

.answer:hover {
  border-color: var(--brand);
}

.answer.is-correct {
  background: var(--green-soft);
  border-color: var(--green);
  color: #047857;
}

.answer.is-wrong {
  background: var(--red-soft);
  border-color: var(--red);
  color: #b91c1c;
  animation: shake 0.3s ease;
}

.answer:disabled {
  cursor: default;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.level-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.level-pill {
  min-width: 54px;
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.level-pill:hover {
  border-color: var(--brand);
}

.level-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* 记忆牌 */
.memory-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 500px;
  margin-inline: auto;
}

@media (max-width: 420px) {
  .memory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.memory-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.memory-card__inner {
  position: absolute;
  inset: 0;
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

.memory-card.is-flipped .memory-card__inner,
.memory-card.is-matched .memory-card__inner {
  transform: rotateY(180deg);
}

.memory-card__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: clamp(24px, 5.5vw, 32px);
}

.memory-card__back {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
}

.memory-card__back::after {
  content: "?";
  font-weight: 700;
}

.memory-card__front {
  background: var(--surface);
  border: 1px solid var(--line);
  transform: rotateY(180deg);
}

.memory-card.is-matched .memory-card__front {
  border-color: var(--green);
  background: var(--green-soft);
}

/* 汉字配对 */
.match-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-column {
  display: grid;
  gap: 8px;
}

.match-item {
  min-height: 58px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.match-item small {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.match-item:hover {
  border-color: var(--brand);
}

.match-item.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.match-item.is-done {
  border-color: var(--green);
  background: var(--green-soft);
  color: #047857;
  cursor: default;
}

.match-item.is-error {
  border-color: var(--red);
  background: var(--red-soft);
  color: #b91c1c;
  animation: shake 0.3s ease;
}

/* ---------- 结算 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(22, 24, 29, 0.45);
}

.modal.is-open {
  display: grid;
}

.modal__panel {
  width: min(400px, 100%);
  padding: 26px 24px;
  text-align: center;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 30px 60px -24px rgba(22, 24, 29, 0.4);
  animation: pop-in 0.22s ease;
}

.modal__emoji {
  display: none;
}

.modal__title {
  font-size: 23px;
  font-weight: 750;
}

.modal__stars {
  margin: 6px 0 2px;
  font-size: 30px;
  letter-spacing: 0.1em;
  color: var(--amber);
}

.modal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 20px;
  border-radius: 12px;
  background: #f7f8fa;
}

.modal__stat {
  padding: 10px 6px;
}

.modal__stat span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
}

.modal__stat strong {
  font-size: 19px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.modal__actions {
  display: grid;
  gap: 8px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(6px);
  }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* ---------- 后台 ---------- */

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 220px minmax(0, 1fr);
  background: #f7f8fa;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.admin-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.admin-nav a:hover {
  background: #f2f3f5;
}

.admin-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.admin-main {
  padding: 26px clamp(18px, 3vw, 36px) 60px;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  :root {
    --px: 16px;
  }

  .brand__sub {
    display: none;
  }

  .header-actions .avatar-chip span:last-child {
    display: none;
  }

  .question {
    font-size: clamp(34px, 11vw, 48px);
  }
}

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

/* ---------- 口算闯关：火箭升空 ---------- */

.hearts {
  color: #e5484d;
  letter-spacing: 1px;
  font-size: 17px;
  font-weight: 700;
}

.stage--question {
  position: relative;
}

.launch {
  width: 100%;
}

.launch__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.launch__track {
  position: relative;
  height: 30px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: visible;
}

.launch__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--green));
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.launch__milestone {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line-strong);
  color: var(--ink-3);
  font-size: 11px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.launch__milestone.is-hit {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.15);
}

.launch__rocket {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.launch__rocket svg {
  width: 100%;
  height: 100%;
}

.launch__rocket.is-launching {
  animation: launchUp 0.7s ease-in forwards;
}

@keyframes launchUp {
  to {
    transform: translate(-50%, -220px);
    opacity: 0;
  }
}

.float-score {
  position: absolute;
  z-index: 6;
  font-size: 20px;
  font-weight: 750;
  color: var(--green);
  pointer-events: none;
  animation: floatUp 0.7s ease forwards;
}

.float-score.bonus {
  color: var(--amber);
}

@keyframes floatUp {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -42px);
  }
}

/* Learning space: shared visual system */
:root {
  --bg: #f5f7fc;
  --ink: #202942;
  --ink-2: #5d6880;
  --ink-3: #737f95;
  --brand: #505bd5;
  --brand-ink: #3e48b4;
  --brand-soft: #eef0ff;
  --line: #e4e8f2;
  --r-lg: 22px;
  --shadow: 0 12px 36px -18px #293b6b30;
}
.container { width: min(1180px, 100% - var(--px) * 2); }
.site-header__inner { height: 80px; }
.brand { font-size: 24px; gap: 12px; }
.brand__mark { width: 42px; height: 42px; border-radius: 14px; }
.brand__mark svg { width: 26px; height: 26px; }
.brand__sub { display: block; font-size: 12px; letter-spacing: .08em; font-weight: 400; margin-top: 0; }
.site-nav { gap: 12px; }
.site-nav a { padding: 10px 18px; }
.btn { border-radius: 12px; }
.btn--primary { box-shadow: 0 5px 12px #505bd522; }
.hero { position: relative; align-items: center; padding: 40px; gap: 40px; border: 1px solid #e0e5f4; border-radius: 30px; background: radial-gradient(ellipse at 90% 10%, #d7f3ec 0, transparent 45%), linear-gradient(120deg, #edf0ff, #f9faff); }
.hero__copy { padding: 12px 0; }
.hero__eyebrow { display: inline-block; color: var(--brand-ink); background: #ffffffb8; border: 1px solid #fff; border-radius: 30px; padding: 6px 14px; font-size: 14px; margin-bottom: 22px; }
.hero__title { font-size: clamp(32px, 4.3vw, 54px); line-height: 1.35; letter-spacing: -.04em; }
.hero__title em { color: var(--brand); font-style: normal; }
.hero__lead { color: var(--ink-2); line-height: 1.95; }
.hero__actions { margin-top: 28px; }
.hero__note { font-size: 14px; }
.map-panel { box-shadow: 0 16px 40px #34437413; border: 5px solid #ffffffaa; border-radius: 22px; }
.map-panel__head { padding: 16px 20px; background: #fafbff; }
.map-panel__head b { font-size: 17px; }
.map-panel__head span { font-size: 14px; }
.map-panel__body { padding: 12px 18px; }
.map__line { left: 12px; background: #dce1f2; }
.map__item { gap: 12px; }
.map__card { border: 0; box-shadow: none; padding: 9px 12px; }
.map__card small { font-size: 14px; }
.map__item.is-current .map__card { background: #eff2ff; }
.map__item.is-current .map__dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.map__item.is-locked .map__card { background: #f8f9fc; }
.map__item.is-locked .map__card b { color: var(--ink-2); }
.learning-values { display: flex; justify-content: space-around; gap: 20px; padding: 24px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.learning-values b { color: var(--ink); margin-right: 10px; }
.section-kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--brand); margin-bottom: 8px; }
#points { scroll-margin-top: 100px; }
.stage-tabs { background: #e9edf6; border: 0; padding: 5px; flex-wrap: wrap; }
.stage-tabs a { padding: 9px 24px; }
.stage-tabs a.is-active { color: var(--brand-ink); background: #fff; box-shadow: 0 2px 6px #20294212; }
.subject-grid { gap: 16px; }
.subject-card { min-height: 108px; padding: 22px; border-radius: 18px; transition: transform .2s, box-shadow .2s; }
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.subject-card.is-active { background: #fff; box-shadow: 0 4px 20px #3443740c; }
.subject-card__icon { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; }
.subject-card__body b { font-size: 18px; }
.subject-card__body span { font-size: 14px; }
.game-grid { gap: 20px; }
.game-card { padding: 24px; gap: 16px; box-shadow: var(--shadow); }
.game-card__desc { font-size: 15px; }
.game-card__foot { font-size: 14px; padding-top: 16px; }
.tile { width: 52px; height: 52px; border-radius: 16px; }
.page-head { padding: 20px 0; }
.site-footer { background: #edf0f7; padding: 40px 0; }
.tabbar { display: none; }
@media (max-width: 919px) {
  .hero { padding: 28px; }
  .hero__copy { padding: 0; }
  .learning-values { flex-wrap: wrap; justify-content: flex-start; }
  .tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr); background: #fffffff5; border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px); }
  .tabbar__item { display: grid; justify-items: center; gap: 3px; font-size: 12px; color: var(--ink-2); }
  .tabbar__item svg { width: 23px; height: 23px; }
  .tabbar__item.is-active { color: var(--brand); font-weight: 700; }
  body { padding-bottom: 76px; }
  .toast-stack { bottom: 90px; }
}
@media (max-width: 540px) {
  .site-header__inner { height: 68px; }
  .hero { padding: 24px 20px; border-radius: 22px; gap: 24px; }
  .hero__actions .btn { flex: 1; padding-inline: 12px; font-size: 14px; }
  .learning-values { display: grid; gap: 8px; padding: 20px 4px; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .subject-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .stage-tabs a { padding-inline: 18px; }
}

/* Course catalog and reading flow */
.catalog-hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; min-height: 310px; padding: 40px 48px; border-radius: 26px; background: #eaf0fc; overflow: hidden; }
.catalog-hero h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.45; letter-spacing: -.04em; }
.catalog-hero h1 span { color: var(--brand); }
.catalog-hero p { color: var(--ink-2); margin-bottom: 0; }
.catalog-art { position: relative; min-height: 260px; display: grid; place-items: center; }
.catalog-art__orbit { position: absolute; width: 290px; height: 240px; border: 1px solid #c6d3ef; border-radius: 50%; transform: rotate(-25deg); background: #dfe8fa; }
.catalog-art__book { z-index: 1; display: grid; gap: 16px; width: 175px; padding: 24px; border-radius: 5px 18px 18px 5px; color: #fff; background: #505bd5; border-left: 8px solid #404bbd; box-shadow: 14px 16px 0 #bac8e8; transform: rotate(-12deg); }
.catalog-art__book b { font-size: 14px; color: #d6f4d9; }
.catalog-art__book > span { font-size: 25px; font-weight: 700; line-height: 1.4; }
.catalog-art__book small { font-size: 10px; letter-spacing: .09em; }
.catalog-art__spark { position: absolute; top: 0; right: 12%; font-size: 60px; color: #edb55c; z-index: 2; }
.catalog-art__tag { position: absolute; bottom: 0; right: 0; z-index: 3; padding: 9px 18px; background: #ffffffee; border-radius: 12px; color: #45655b; font-size: 14px; box-shadow: var(--shadow); }
.catalog-filter { background: #fff; border: 1px solid var(--line); border-radius: 18px; margin-top: 24px; padding: 22px 28px; }
.catalog-filter__row { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #edf0f6; }
.catalog-filter__label { font-size: 14px; margin-right: 16px; }
.catalog-filter .chip { border-radius: 8px; padding: 7px 16px; font-size: 14px; background: transparent; }
.catalog-filter .chip:hover { background: #f3f5fb; }
.catalog-filter .chip--teal { color: #086e57; background: var(--brand-soft); }
.catalog-heading { margin-top: 34px; }
.catalog-heading p { color: var(--ink-2); font-size: 14px; margin: 8px 0 6px; }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.course-card { --cover: #fcebdd; --cover-ink: #b86b36; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 5px 16px #293b6b06; transition: transform .2s, box-shadow .2s; }
.course-card.accent-teal { --cover: #e1f2ed; --cover-ink: #378474; }
.course-card.accent-sky { --cover: #e5edfd; --cover-ink: #5678c6; }
.course-card.accent-sun { --cover: #eef1d9; --cover-ink: #7d8840; }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px #293b6b16; }
.course-card__cover { position: relative; display: grid; place-items: center; height: 160px; background: var(--cover); color: var(--cover-ink); overflow: hidden; }
.course-card__cover::before, .course-card__cover::after { content: ''; position: absolute; width: 140px; height: 140px; border: 1px solid currentColor; opacity: .15; border-radius: 50%; right: -30px; top: -40px; }
.course-card__cover::after { left: -70px; top: 80px; width: 200px; height: 200px; }
.course-card__symbol { font-family: Georgia, serif; font-size: 65px; font-weight: 700; line-height: 1; transform: rotate(-8deg); }
.course-card__cover-label { font-size: 12px; letter-spacing: .13em; position: absolute; bottom: 14px; }
.course-card__content { display: flex; flex: 1; flex-direction: column; padding: 20px; gap: 12px; }
.course-card__top { display: flex; align-items: center; justify-content: space-between; }
.course-card__top .tile { display: none; }
.course-card__meta-top { font-size: 12px; color: var(--cover-ink); background: var(--cover); padding: 3px 9px; border-radius: 6px; }
.course-card__title { display: block; font-size: 18px; font-weight: 700; line-height: 1.5; }
.course-card__summary { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.8; flex: 1; }
.course-card__meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.course-card__action { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; color: var(--brand); font-size: 14px; font-weight: 600; }
.catalog-guide { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; align-items: center; gap: 30px; margin-top: 38px; padding: 30px; border-radius: 20px; background: #edf1f6; }
.catalog-guide h2 { font-size: 22px; line-height: 1.5; }
.catalog-guide p { font-size: 14px; color: var(--ink-2); margin-bottom: 0; }
.course-hero { display: grid; gap: 22px; padding: 36px; background: #eef1fc; border: 1px solid var(--line); border-radius: 24px; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); background: #fff; border-radius: 16px; }
.lesson-row:hover { border-color: var(--brand); }
.lesson-row__index { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.lesson-row__body { display: grid; gap: 5px; flex: 1; }
.lesson-row__body span, .lesson-row__time { font-size: 14px; color: var(--ink-2); }
@media (max-width: 1000px) { .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .catalog-guide { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .catalog-hero { grid-template-columns: 1fr; padding: 26px; } .catalog-art { min-height: 240px; margin-top: 20px; } .catalog-art__orbit { width: 230px; height: 210px; } .catalog-filter { padding: 20px; } .catalog-filter .row { gap: 6px; } .catalog-filter__label { width: 100%; margin-bottom: 6px; } .catalog-filter .chip { padding: 7px 11px; } .catalog-grid { grid-template-columns: 1fr; } .course-card__cover { height: 180px; } .catalog-guide { grid-template-columns: 1fr; gap: 20px; } .course-hero { padding: 24px; } .lesson-row { flex-wrap: wrap; } }

.learning-filter {
  margin-top: 0;
  margin-bottom: 20px;
}

.catalog-filter .chip {
  min-height: 44px;
}

.catalog-filter .chip--teal:hover {
  background: var(--brand-soft);
}

.catalog-hero__filter {
  margin-top: 16px;
}

#subjects,
#course-filters {
  scroll-margin-top: 100px;
}

/* ==========================================================================
   游戏化皮肤：等级 HUD / 闯关地图 / 立体反馈
   只叠加视觉与动效，不改变既有布局结构
   ========================================================================== */

:root {
  --lv: #505bd5;
  --lv-ink: #3e48b4;
  --lv-soft: #eef0ff;
  --gold: #f6ad2b;
  --gold-soft: #fff4d6;
}

/* ---------- 立体按钮：按下去有「咔哒」感 ---------- */

.btn {
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn--primary {
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--lv-ink), 0 8px 18px -10px #505bd580;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--lv-ink), 0 12px 22px -10px #505bd580;
}

.btn--primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--lv-ink);
}

.btn--ghost {
  border-radius: 14px;
  box-shadow: 0 3px 0 #e6e9f2;
}

.btn--ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #e6e9f2;
}

.btn--ghost:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #e6e9f2;
}

.btn--sm.btn--primary {
  box-shadow: 0 3px 0 var(--lv-ink);
}

.btn--sm.btn--ghost {
  box-shadow: 0 2px 0 #e6e9f2;
}

/* ---------- 玩家 HUD ---------- */

.player-hud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 4px 9px 4px 5px;
  border: 1px solid #e2e6f5;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #f7f9ff);
  box-shadow: 0 3px 10px -4px #293b6b33, inset 0 -2px 0 #e8ebf6;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-hud__level {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--lv);
  color: #fff;
  font-size: 11px;
  box-shadow: inset 0 -2px 0 var(--lv-ink);
}

.player-hud__level b {
  margin-left: 2px;
  font-size: 13px;
}

.player-hud__xp {
  width: 46px;
  height: 6px;
  border-radius: 999px;
  background: #e7eaf6;
  overflow: hidden;
}

.player-hud__xp-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b94f2, var(--lv));
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.player-hud__xp-text {
  color: var(--ink-3);
  font-size: 11px;
}

.player-hud__star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #b97818;
}

.player-hud__star svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  filter: drop-shadow(0 1px 0 #d98f14);
}

.player-hud__streak {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #e2622b;
}

/* ---------- 首屏挑战条 ---------- */

.hero {
  position: relative;
}

.hero__eyebrow::after {
  content: ' ✦';
  color: var(--gold);
}

.quest-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.quest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid #e6e9f5;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 2px 0 #e8ebf4;
}

.quest b {
  font-size: 14px;
}

.quest strong {
  color: var(--lv-ink);
  font-variant-numeric: tabular-nums;
}

.learning-values__icon {
  margin-right: 4px;
  font-size: 16px;
}

/* ---------- 闯关地图 ---------- */

.map-panel {
  border-color: #dfe4f4;
  box-shadow: 0 18px 40px -22px #34437455, 0 4px 0 #eaedf7;
}

.map-panel__head b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-panel__badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--lv-soft);
  font-size: 15px;
}

.map-panel__route {
  display: flex;
  justify-content: space-between;
  padding: 2px 2px 8px;
  color: #8b94ad;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.map__line {
  left: 16px;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(to bottom, #cbd3ea 0 6px, transparent 6px 12px);
}

.map__item {
  gap: 12px;
  min-height: 62px;
}

.map__dot {
  width: 34px;
  height: 34px;
  border: 2px solid #d8deee;
  font-size: 13px;
  color: #98a2ba;
  box-shadow: 0 3px 0 #e2e6f2;
}

.map__item.is-current .map__dot {
  border-color: var(--lv);
  background: linear-gradient(180deg, #6a75ea, var(--lv));
  color: #fff;
  font-size: 12px;
  box-shadow: 0 0 0 5px var(--lv-soft), 0 4px 0 var(--lv-ink);
  animation: levelPulse 2.2s ease-in-out infinite;
}

.map__item.is-locked .map__dot {
  border-style: dashed;
  background: #f7f8fc;
  font-size: 12px;
  box-shadow: none;
}

.map__item.is-done .map__dot {
  border-color: #24b47e;
  background: #24b47e;
  color: #fff;
}

.map__card {
  padding: 10px 14px;
  border: 1px solid #e7eaf4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 #edeff7;
}

.map__stage {
  display: inline-block;
  margin-bottom: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f3fa;
  color: #7c86a1;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.map__card b {
  font-size: 15px;
}

.map__item.is-current .map__card {
  border-color: #c8cff8;
  background: linear-gradient(135deg, #f5f6ff, #fff);
  box-shadow: 0 4px 0 #d9def9;
}

.map__item.is-current .map__stage {
  background: var(--lv);
  color: #fff;
}

.map__item.is-locked .map__card {
  background: #f9fafd;
  opacity: 0.78;
}

.map__item.is-current .map__tag {
  background: var(--gold-soft);
  color: #a46a00;
}

@keyframes levelPulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px var(--lv-soft), 0 4px 0 var(--lv-ink);
  }
  50% {
    box-shadow: 0 0 0 9px #eef0ff88, 0 4px 0 var(--lv-ink);
  }
}

/* ---------- 学科 / 游戏卡片 ---------- */

.subject-card {
  position: relative;
  border-color: #e6eaf5;
  box-shadow: 0 4px 0 #eaedf6;
}

.subject-card:hover {
  box-shadow: 0 7px 0 #e2e6f3, var(--shadow);
}

.subject-card.is-active {
  box-shadow: 0 4px 0 #d9def2, var(--shadow);
}

.subject-card__go {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--subject-soft, var(--lv-soft));
  color: var(--subject, var(--lv));
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.15s ease;
}

.subject-card:hover .subject-card__go {
  transform: translate(2px, -2px);
}

.game-card {
  position: relative;
  border-color: #e5e9f4;
  box-shadow: 0 4px 0 #eaedf6, var(--shadow);
}

.game-card:hover {
  border-color: #ccd4f5;
  box-shadow: 0 8px 0 #e2e6f3, var(--shadow);
}

.game-card__head .star-row {
  color: var(--gold);
  font-size: 17px;
  letter-spacing: 1px;
}

.star-row .off {
  color: #dfe3ee;
}

.star-row.is-empty {
  opacity: 0.75;
}

.game-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--lv-ink);
  font-weight: 800;
}

.game-card__cta span {
  transition: transform 0.15s ease;
}

.game-card:hover .game-card__cta span {
  transform: translateX(3px);
}

/* ---------- 徽章墙 ---------- */

.badge {
  box-shadow: 0 3px 0 #eaedf6;
}

.badge:not(.is-locked) {
  border-color: #dfe3f7;
  background: linear-gradient(180deg, #fff, #fafbff);
}

.badge__emoji {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gold-soft);
  font-size: 19px;
}

.badge.is-locked .badge__emoji {
  background: #f1f2f6;
  filter: grayscale(1);
  opacity: 0.5;
}

/* ---------- 入场动效 ---------- */

.hero__copy > *,
.map-panel,
.subject-card,
.game-card {
  animation: riseIn 0.45s backwards;
}

.hero__copy > *:nth-child(2) { animation-delay: 0.05s; }
.hero__copy > *:nth-child(3) { animation-delay: 0.1s; }
.hero__copy > *:nth-child(4) { animation-delay: 0.15s; }
.hero__copy > *:nth-child(5) { animation-delay: 0.2s; }
.map-panel { animation-delay: 0.15s; }
.subject-card:nth-child(2) { animation-delay: 0.06s; }
.subject-card:nth-child(3) { animation-delay: 0.12s; }
.subject-card:nth-child(4) { animation-delay: 0.18s; }
.game-card:nth-child(2) { animation-delay: 0.06s; }
.game-card:nth-child(3) { animation-delay: 0.12s; }

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 700px) {
  .player-hud {
    gap: 6px;
    height: 34px;
  }

  .player-hud__xp-text,
  .player-hud__streak {
    display: none !important;
  }

  .player-hud__xp {
    width: 34px;
  }

  .quest {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .subject-card__go {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__copy > *,
  .map-panel,
  .subject-card,
  .game-card,
  .map__dot {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   知识点探索页：翻卡 / 易错雷达 / 前置关卡链
   ========================================================================== */

.point-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 30px 34px;
  border: 1px solid #e0e5f4;
  border-radius: 28px;
  background: radial-gradient(ellipse at 92% 8%, #d7f3ec 0, transparent 46%), linear-gradient(120deg, #edf0ff, #f9faff);
}

.point-hero__main {
  min-width: 0;
}

.point-hero__badge {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 28px;
  background: var(--lv);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  box-shadow: 0 7px 0 var(--lv-ink), 0 18px 30px -16px #505bd580;
  transform: rotate(6deg);
}

.point-block {
  margin-top: 34px;
}

.point-links {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.point-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e4e8f4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 #eaedf6;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.point-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #e2e6f3;
}

.point-link__dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--lv-soft);
  color: var(--lv-ink);
  font-weight: 800;
}

.point-link b,
.point-link small {
  display: block;
}

.point-link small {
  color: var(--ink-3);
  font-size: 12px;
}

.flip-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.flip-card {
  height: 170px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

.flip-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
}

.flip-card__front {
  border: 1px solid #dfe4f4;
  background: linear-gradient(160deg, #fff, #f2f5ff);
  box-shadow: 0 6px 0 #e1e6f4;
}

.flip-card__num {
  color: var(--lv);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.flip-card__hint {
  color: var(--ink-3);
  font-size: 12px;
}

.flip-card__back {
  border: 1px solid #cdd5f8;
  background: linear-gradient(160deg, #f5f6ff, #fff);
  box-shadow: 0 6px 0 #d9def9;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.7;
  transform: rotateY(180deg);
}

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

.trap {
  border: 1px solid #f2dfb9;
  border-radius: 14px;
  background: #fffdf7;
  overflow: hidden;
}

.trap summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.trap summary::-webkit-details-marker {
  display: none;
}

.trap__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: #a46a00;
}

.trap p {
  margin: 0;
  padding: 0 16px 14px 50px;
  color: #7a5b22;
  font-size: 14px;
}

.game-coming {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px dashed #cdd5f8;
  border-radius: 18px;
  background: #f8f9ff;
}

.game-coming__art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 0 #e1e6f4;
  font-size: 30px;
}

.game-coming p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.point-finish {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding: 22px 26px;
  border: 1px solid #dfe4f4;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 700px) {
  .point-hero {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .point-hero__badge {
    display: none;
  }

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

  .flip-card {
    height: 150px;
  }

  .flip-card__back {
    font-size: 12.5px;
    padding: 12px;
  }

  .point-finish {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   首页课程推荐 + 课程页完整学习路径
   ========================================================================== */

.course-spotlight {
  border: 1px solid #dfe4f4;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 16px 40px #34437413, 0 4px 0 #eaedf7;
  overflow: hidden;
}

.course-spotlight__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbff;
}

.course-spotlight__head b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
}

.course-spotlight__head span {
  color: var(--ink-3);
  font-size: 12.5px;
}

.course-spotlight__body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.course-spotlight__cover {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 20px;
  background: var(--cover, var(--gold-soft));
  color: var(--cover-ink, var(--brand));
  font-size: 36px;
  box-shadow: 0 4px 0 #e4e8f4;
}

.course-spotlight__cover.accent-teal { --cover: #e1f2ed; --cover-ink: #378474; }
.course-spotlight__cover.accent-sky { --cover: #e5edfd; --cover-ink: #5678c6; }
.course-spotlight__cover.accent-sun { --cover: #eef1d9; --cover-ink: #7d8840; }

.course-spotlight__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.course-spotlight__meta {
  color: var(--lv-ink);
  font-size: 12px;
  font-weight: 800;
}

.course-spotlight__text b {
  font-size: 19px;
}

.course-spotlight__text small {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.course-spotlight__foot {
  display: flex;
  gap: 10px;
  padding: 0 20px 18px;
}

.course-spotlight__empty {
  padding: 24px 20px;
}

.course-spotlight__empty p {
  color: var(--ink-2);
  font-size: 14px;
}

.learning-path-section {
  position: relative;
  margin-top: 30px;
  padding: 26px 26px 30px;
  border: 1px solid #e0e5f4;
  border-radius: 24px;
  background: linear-gradient(180deg, #fafbff, #fff);
  scroll-margin-top: 100px;
}

/* 当前关卡：做成醒目的路标横幅，而不是又一个矩形卡片 */
.path-current {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 28px;
  padding: 16px 18px 16px 22px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(115deg, #545fd6, #7a6ee8);
  box-shadow: 0 10px 22px -12px #4a55c999;
  overflow: hidden;
}

.path-current::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -40px;
  top: -70px;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  box-shadow: 0 0 0 26px #ffffff12, 0 0 0 52px #ffffff0a;
}

.path-current b {
  position: relative;
  flex: 1;
  font-size: 16px;
}

.path-current__tag {
  position: relative;
  padding: 4px 11px;
  border-radius: 999px;
  background: #ffffff33;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.path-current .btn--primary {
  position: relative;
  background: #fff;
  color: var(--lv-ink);
  box-shadow: 0 3px 0 #d8dcf7;
}

/* 一条贯穿的主线，把章节站点串起来 */
.path-units {
  position: relative;
  display: grid;
  gap: 24px;
  padding-left: 4px;
}

.path-units::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(#c9d2f5, #e4e8f7);
}

/* 章节 = 主线上的站点，去掉矩形外壳 */
.path-unit {
  position: relative;
  padding-left: 52px;
}

.path-unit__station {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 12px;
  background: #e8ecfa;
  color: var(--lv-ink);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px #3443741a;
}

.path-unit.is-current .path-unit__station {
  background: var(--lv);
  color: #fff;
  box-shadow: 0 0 0 4px var(--lv-soft);
}

.path-unit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding: 0;
  cursor: pointer;
  list-style: none;
  background: none;
  border: 0;
}

.path-unit__head::-webkit-details-marker {
  display: none;
}

.path-unit__title,
.path-unit__progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.path-unit__title b {
  font-size: 15px;
}

.path-unit__title b::after {
  content: '⌄';
  margin-left: 8px;
  color: var(--ink-3);
  font-weight: 400;
}

.path-unit[open] .path-unit__title b::after {
  content: '⌃';
}

.path-unit__next {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lv);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.path-unit__bar {
  width: 80px;
  height: 6px;
  border-radius: 999px;
  background: #e7eaf6;
  overflow: hidden;
}

.path-unit__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lv);
}

/* 章节下挂卡片网格 */
.path-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 14px 0 2px;
}

.path-cards:has(> .path-card:only-child) {
  grid-template-columns: minmax(240px, 340px);
}

.path-card {
  --tone-a: #8b94f2;
  --tone-b: #505bd5;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 0 #eef0f7;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.path-card.tone-green { --tone-a: #7ed8b0; --tone-b: #2f9e73; }
.path-card.tone-blue { --tone-a: #8cc8f8; --tone-b: #3a76c8; }
.path-card.tone-orange { --tone-a: #f7c27d; --tone-b: #d9822b; }
.path-card.tone-violet { --tone-a: #b6a4f6; --tone-b: #6c4fd0; }
.path-card.tone-red { --tone-a: #f4a6a6; --tone-b: #cf5757; }
.path-card.tone-teal { --tone-a: #86d5d0; --tone-b: #2f9a94; }

.path-card:hover {
  transform: translateY(-3px);
  border-color: var(--tone-b);
  box-shadow: 0 10px 22px -12px #34437455;
}

.path-card__cover {
  position: relative;
  height: 108px;
  overflow: hidden;
  background: #eef0f7;
}

.path-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.path-card:hover .path-card__cover img {
  transform: scale(1.04);
}

.path-card__badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ffffffd9;
  color: var(--tone-b);
  font-size: 11px;
  font-weight: 800;
}

.path-card__glyph {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 4px 0 #0000001f);
}

.path-card__check {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #24b47e;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.path-card__body {
  display: grid;
  gap: 4px;
  flex: 1;
  padding: 13px 14px 6px;
}

.path-card__body b {
  font-size: 15px;
  line-height: 1.4;
}

.path-card__body small {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.path-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 13px;
}

.path-card__state {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}

.path-card__go {
  color: var(--lv-ink);
  font-size: 12px;
  font-weight: 800;
}

.path-card.is-next {
  border-color: var(--lv);
  box-shadow: 0 0 0 3px var(--lv-soft), 0 8px 20px -12px #4a55c999;
}

.path-card.is-mastered .path-card__state {
  color: #16875c;
}

.path-card.is-available .path-card__state,
.path-card.is-next .path-card__state {
  color: var(--lv-ink);
}

.path-card.is-locked {
  opacity: 0.66;
}

.path-card.is-locked .path-card__cover {
  filter: grayscale(0.7);
}

@media (max-width: 700px) {
  .course-spotlight__body {
    padding: 16px;
  }

  .course-spotlight__cover {
    width: 62px;
    height: 62px;
    font-size: 28px;
  }

  .learning-path-section {
    padding: 18px 14px 24px;
  }

  .path-current {
    flex-wrap: wrap;
    padding: 14px;
  }

  .path-current .btn--primary {
    width: 100%;
  }

  .path-unit {
    padding-left: 44px;
  }

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

  .path-card__cover {
    height: 84px;
  }

  .path-card__body {
    padding: 10px 10px 4px;
  }

  .path-card__foot {
    padding: 6px 10px 10px;
  }

  .path-unit__bar {
    width: 50px;
  }
}

/* ==========================================================================
   上传游戏包 · 运行舞台
   ========================================================================== */

.game-package-stage {
  position: relative;
  min-height: 420px;
  border: 1px solid #dfe4f4;
  border-radius: 22px;
  background: linear-gradient(160deg, #f7f9ff, #fff);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-package-stage.is-ready {
  background: #fff;
}

.game-sandbox-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.game-package-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg, #f7f9ff, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-2);
}

.game-package-loading.is-error {
  color: var(--coral-deep);
}

.game-package-loading__cube {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--lv);
  box-shadow: inset -6px -6px 0 #3e48b4;
  animation: cubeSpin 1.4s ease-in-out infinite;
}

.game-package-loading__icon {
  font-size: 34px;
}

@keyframes cubeSpin {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-6px); }
}

/* ==========================================================================
   公开开发者中心：SDK 文档 / 示例包 / 提交页
   ========================================================================== */

.admin-nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.dev-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 34px;
  min-height: 330px;
  margin-top: 26px;
  padding: 44px 48px;
  border: 1px solid #dfe8f3;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(circle at 82% 18%, #d9f4e9 0, transparent 42%),
    linear-gradient(125deg, #edf0ff 0%, #f7fbff 60%, #eaf7f1 100%);
}

.dev-hero .h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.32;
}

.dev-hero .h1 em {
  color: var(--brand);
  font-style: normal;
}

.dev-hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
}

.dev-hero__art b {
  position: relative;
  z-index: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(44px, 6vw, 74px);
  font-weight: 800;
  letter-spacing: -.06em;
  color: var(--brand-ink);
  text-shadow: 0 3px 0 #fff;
}

.dev-hero__cube {
  position: absolute;
  border-radius: 18px;
  box-shadow: inset -8px -8px 0 #0000000d, 0 14px 26px -12px #34437466;
}

.dev-hero__cube--a { width: 150px; height: 150px; left: 8%; top: 6%; background: #ffd7a8; transform: rotate(-8deg); }
.dev-hero__cube--b { width: 110px; height: 110px; right: 10%; top: 22%; background: #b9e5d5; transform: rotate(12deg); }
.dev-hero__cube--c { width: 90px; height: 90px; left: 30%; bottom: 4%; background: #cdd6ff; transform: rotate(6deg); }

.dev-section {
  margin-top: 34px;
  scroll-margin-top: 100px;
}

.dev-section code,
.dev-hero code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1f3f8;
  color: var(--brand-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.dev-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dev-step {
  position: relative;
  padding: 22px 22px 22px 68px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.dev-step > span {
  position: absolute;
  left: 18px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 800;
}

.dev-step b {
  display: block;
  font-size: 16px;
}

.dev-step p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
}

.dev-code {
  margin: 0;
  padding: 20px 22px;
  border-radius: 12px;
  background: #1e2430;
  color: #e6edf7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.85;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.dev-code code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.dev-comment {
  color: #8b98ad;
}

.dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dev-table th,
.dev-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.dev-table th {
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: .04em;
  background: #fafbfe;
}

.dev-table tr:last-child td {
  border-bottom: 0;
}

.dev-table code {
  white-space: nowrap;
}

.dev-sample {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}

.dev-sample + .dev-sample {
  border-top: 1px solid var(--line);
}

.dev-sample b {
  font-size: 16px;
}

.dev-sample .chip {
  margin-left: 8px;
}

.dev-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid #dce7ef;
  border-radius: 20px;
  background: linear-gradient(120deg, #e7f5ef, #eef0ff);
}

@media (max-width: 860px) {
  .dev-hero { grid-template-columns: 1fr; padding: 30px 26px; }
  .dev-hero__art { min-height: 180px; }
  .dev-steps { grid-template-columns: 1fr; }
  .dev-cta { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   邮箱登录 / 注册
   ========================================================================== */

.field input[type="email"] {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 12% 8%, #e9eefe 0, transparent 38%),
    radial-gradient(circle at 88% 92%, #e5f6ee 0, transparent 34%),
    var(--bg);
}

.auth-brand {
  position: absolute;
  top: 24px;
  left: 28px;
}

.auth-main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 96px 18px 40px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  box-shadow: 0 16px 40px -24px #34437466;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--ink-2);
  font-size: 13.5px;
}

.auth-switch a {
  color: var(--brand-ink);
  font-weight: 700;
}

.auth-switch + .auth-switch {
  margin-top: 8px;
}

.auth-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-menu__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   H5 / 移动端整体增强
   ========================================================================== */

html, body {
  overflow-x: hidden;
}

@media (max-width: 640px) {
  :root {
    --px: 14px;
  }

  /* header：品牌 + 紧凑操作区，绝不换行溢出 */
  .site-header__inner {
    gap: 8px;
    height: 60px;
  }

  .brand {
    flex: none;
    font-size: 17px;
    gap: 8px;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .brand__sub {
    display: none !important;
  }

  .header-actions {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .player-hud {
    display: none !important;
  }

  .header-actions > .btn--ghost {
    display: none;
  }

  .header-actions form .btn--ghost {
    padding: 6px 9px;
    font-size: 12px;
  }

  .avatar-chip span:not(.avatar-chip__face) {
    display: none;
  }

  .auth-menu__name {
    display: none;
  }

  /* hero：去掉桌面卡壳的内边距，铺满单列 */
  .hero {
    padding: 20px;
    border-radius: 18px;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
  }

  .hero__copy {
    min-width: 0;
  }

  .hero__lead,
  .hero__note {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero__title {
    font-size: clamp(28px, 8vw, 36px);
  }

  .hero__actions {
    display: grid;
    gap: 10px;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .course-spotlight__body {
    padding: 14px;
    gap: 12px;
  }

  .course-spotlight__head {
    padding: 12px 14px;
  }

  /* 课程/首页插画：收敛绝对定位装饰，不越界 */
  .catalog-hero {
    padding: 22px 20px;
  }

  .catalog-art__orbit {
    width: min(230px, 70%);
    height: auto;
    aspect-ratio: 1.2;
  }

  .catalog-art__star,
  .catalog-art__bubble,
  .catalog-art__spark {
    display: none !important;
  }

  /* 登录注册页：卡片收窄，输入框不溢出 */
  .auth-main {
    padding: 84px 14px 28px;
    display: block;
  }

  .auth-card {
    width: 100%;
    min-width: 0;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px;
    border-radius: 16px;
  }

  .auth-card form,
  .auth-card .field,
  .auth-card .field input {
    max-width: 100%;
    min-width: 0;
  }

  .auth-brand {
    top: 16px;
    left: 16px;
  }

  /* 筛选 chips：年份行可换行，学科行横向滚动不撑破 */
  .catalog-filter__row {
    flex-wrap: wrap;
  }

  .catalog-filter nav.row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .catalog-filter__row .catalog-filter__label {
    flex: none;
    width: 100%;
  }

  .catalog-filter nav.row .catalog-filter__label {
    width: auto;
    flex: none;
  }

  .catalog-filter__row .small,
  .catalog-filter__row a.small {
    width: 100%;
    margin-left: 0 !important;
  }

  .catalog-filter nav.row .chip {
    flex: none;
    white-space: nowrap;
  }

  /* tabbar 安全区 */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .site-header__inner .btn--ghost {
    display: none;
  }

  .hero {
    padding: 16px;
  }
}
