/* ==========================================================================
   数学 · 数学探索世界（/math/）—— 温暖绘本图解版
   依赖全站设计系统 /assets/site.css（浅绿/浅黄护眼配色变量 / 顶栏 / btn / chip）。
   主题色只做装饰：每个主题提供 --t（柔光底色）与 --t-ink（深色墨水），卡片始终带文字标签。
   ========================================================================== */
.page { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page > main { flex: 1 0 auto; }

/* ---------- 主题色（绿/黄/珊瑚/蓝/紫/沙/薄荷） ---------- */
[data-tone="green"]  { --t: #dff1e4; --t-ink: #236545; }
[data-tone="yellow"] { --t: #fbf0c4; --t-ink: #7a5f10; }
[data-tone="coral"]  { --t: #ffe3dc; --t-ink: #9e432b; }
[data-tone="blue"]   { --t: #e0ebff; --t-ink: #2f5496; }
[data-tone="lav"]    { --t: #ece5ff; --t-ink: #563fa0; }
[data-tone="sand"]   { --t: #f8ead7; --t-ink: #845520; }
[data-tone="mint"]   { --t: #d4f3ea; --t-ink: #1d6a57; }

/* ---------- Hero（温暖绘本横幅） ---------- */
.m-hero {
  margin: 22px 0 18px;
  padding: clamp(26px, 4vw, 42px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 260px at 8% 0%, var(--acc-softer), transparent 72%),
    radial-gradient(440px 260px at 96% 100%, rgba(246, 208, 118, .18), transparent 72%),
    var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 28px;
  align-items: center;
}
.m-hero h1 {
  margin: 12px 0 12px;
  font-size: clamp(30px, 4.3vw, 46px);
  line-height: 1.16;
  letter-spacing: -.035em;
}
.m-hero h1 em {
  font-style: normal;
  color: var(--acc);
  background: linear-gradient(180deg, transparent 62%, var(--acc-soft) 62%);
  padding: 0 2px;
  border-radius: 4px;
}
.m-lede {
  max-width: 44ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}
.m-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.m-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--acc-softer);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--acc);
}
.m-art {
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 26px rgba(30, 45, 37, .06);
}
.m-art svg { width: 100%; height: auto; display: block; }
.m-float { animation: mFloat 5.4s ease-in-out infinite; }
.m-f2 { animation-delay: -1.8s; }
.m-f3 { animation-delay: -3.4s; }
@keyframes mFloat {
  0%, 100% { transform: translate(var(--tx, 0), var(--ty, 0)); }
  50% { transform: translate(var(--tx, 0), calc(var(--ty, 0) - 5px)); }
}
.m-f1 { --tx: 56px; --ty: 42px; }
.m-f2 { --tx: 216px; --ty: 26px; }
.m-f3 { --tx: 388px; --ty: 122px; }

/* ---------- 年龄段选择（全局筛选） ---------- */
.age-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.age-bar h2 { margin: 0; font-size: 14.5px; }
.age-bar p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.age-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.age-chip {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 0 rgba(30, 45, 37, .04);
  transition: background .16s, color .16s, border-color .16s, transform .14s;
}
.age-chip:hover { border-color: var(--acc); color: var(--ink); transform: translateY(-1px); }
.age-chip[aria-pressed="true"] {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
  box-shadow: 0 4px 12px var(--ring);
}
.age-note {
  margin: 10px 0 0;
  padding: 10px 15px;
  border-radius: 12px;
  background: var(--acc-softer);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.age-note[hidden] { display: none; }

/* ---------- 视图切换（tablist） ---------- */
.m-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-top: 18px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  font-size: 14px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.m-tab:hover { color: var(--ink); background: var(--acc-softer); }
.m-tab[aria-selected="true"] { color: var(--acc); font-weight: 800; }
.m-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 10px -1px 10px;
  border-block-end: 3px solid var(--acc);
  border-radius: 3px 3px 0 0;
}
.m-panel { padding: clamp(20px, 3.4vw, 34px) 0 clamp(40px, 6vw, 72px); }
.m-panel[hidden] { display: none; }
.m-sec { margin-top: clamp(26px, 4vw, 44px); }
.m-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.m-sec-head h2 { margin: 4px 0 0; font-size: clamp(20px, 2.6vw, 26px); }
.m-sec-head p { margin: 0; max-width: 40ch; font-size: 13px; color: var(--muted); text-align: right; }

/* ---------- 主题页顶部栏（返回 + 实时过滤框） ---------- */
.topic-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.topic-topbar .back-btn { margin-top: 0; }
.m-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min(310px, 100%);
  height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.m-search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }
.m-search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.m-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.m-search input::placeholder { color: var(--faint); }

/* ---------- 课程卡片（绘本卡片质感） ---------- */
.mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 15px; }
.mcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 168px;
  padding: 18px 18px 16px;
  background:
    radial-gradient(200px 110px at 100% 0%, color-mix(in srgb, var(--t, var(--acc-soft)) 46%, transparent), transparent 76%),
    var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--t, var(--line-strong));
  border-radius: 18px;
  color: inherit;
  box-shadow: 0 2px 6px rgba(30, 45, 37, .03);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s ease, border-color .18s ease;
}
.mcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.mcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-right: 54px; }
.mcard h3 { margin: 2px 0 0; font-size: 16.5px; line-height: 1.35; }
.mcard p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); flex: 1; }
.mtags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mtag { display: inline-flex; align-items: center; gap: 5px; padding: 3.5px 9.5px; border-radius: 999px; background: var(--t); color: var(--t-ink); font-size: 11.5px; font-weight: 750; }
.mtag.age { background: var(--surface-3); color: var(--muted); font-family: var(--font-mono); border: 1px solid var(--line); }
.mtag.vid { background: #fff3e6; color: #b55b2a; }
.mcard .go { font-size: 12.5px; font-weight: 750; color: var(--acc); transition: transform .15s; }
.mcard:hover .go { transform: translateX(3px); }
.mcard .done {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--acc-soft);
  font-size: 11px;
  font-weight: 800;
  color: var(--acc);
}
.mcard.challenge p.ch { color: var(--ink-soft); }

/* ---------- 七个主题入口（带专属绘本插画角标） ---------- */
.topics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.topic {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 176px;
  padding: 18px;
  text-align: left;
  background:
    linear-gradient(155deg, var(--surface-2) 45%, color-mix(in srgb, var(--t) 44%, var(--surface-2)) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s ease, border-color .18s ease;
}
.topic:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.topic-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.topic .ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--t);
  color: var(--t-ink);
  font-size: 20px;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.05);
}
.topic-art {
  width: 78px;
  height: 50px;
  flex: none;
  opacity: .94;
  transition: transform .22s cubic-bezier(.2,.7,.2,1);
}
.topic:hover .topic-art { transform: scale(1.07) rotate(-2deg); }
.topic strong { font-size: 15.5px; position: relative; z-index: 1; }
.topic small { font-size: 12.5px; color: var(--muted); line-height: 1.55; position: relative; z-index: 1; }
.topic .cnt {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 650;
}
.topic.wide { grid-column: span 2; }
.topic.wide .topic-art { width: 108px; height: 56px; }

/* ---------- 知识地图 ---------- */
.map-grid { display: grid; grid-template-columns: 1.32fr .68fr; gap: 16px; }
.map-box {
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-box svg { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; user-select: none; max-height: 72vh; }
.map-box svg.dragging { cursor: grabbing; }
.map-tools { position: absolute; top: 18px; right: 18px; z-index: 2; display: grid; gap: 5px; }
.map-tool { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: 17px; font-weight: 800; line-height: 1; box-shadow: var(--shadow); }
.map-tool:hover { border-color: var(--acc); background: var(--acc-softer); }
.map-edge { stroke: var(--line-strong); stroke-width: 1.5; fill: none; transition: stroke .15s; }
.map-edge.is-hi { stroke: var(--acc); stroke-width: 2.8; }
.map-node { cursor: pointer; }
.map-node circle { fill: var(--surface-2); stroke: var(--t); stroke-width: 6; transition: stroke .15s, r .15s; }
.map-node[data-tone] circle { stroke: var(--t); }
.map-node:hover circle, .map-node.is-on circle { stroke: var(--acc); stroke-width: 3.5; }
.map-node text { font-size: 10.5px; font-weight: 750; fill: var(--ink); text-anchor: middle; pointer-events: none; }
.map-node.is-on text { fill: var(--acc); font-weight: 800; }
.map-hub { fill: var(--acc); }
.map-hub-text { fill: #fff; font-size: 11px; font-weight: 800; text-anchor: middle; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.map-legend i { display: inline-block; width: 18px; height: 0; margin-right: 5px; vertical-align: middle; border-top: 2px solid var(--line-strong); }
.map-legend i.hi { border-color: var(--acc); }
.map-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; align-self: start; box-shadow: var(--shadow); }
.map-side h3 { margin: 8px 0 8px; font-size: 19px; }
.map-side p { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.map-side .mtags { margin: 10px 0 14px; }
.map-side ul { list-style: none; display: grid; gap: 7px; margin-top: 8px; }
.map-side li a { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 13px; font-weight: 650; transition: border-color .15s, background .15s; }
.map-side li a:hover { border-color: var(--acc); background: var(--acc-softer); }

/* ---------- 年龄段 ---------- */
.ages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.age-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(30, 45, 37, .03);
  transition: border-color .15s, box-shadow .15s;
}
.age-card.is-on { border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }
.age-card .lab {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--acc-softer);
  color: var(--acc);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.age-card h3 { margin: 10px 0 6px; font-size: 18px; }
.age-card > p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.age-card ul { list-style: none; margin: 14px 0 0; display: grid; gap: 6px; }
.age-card li a {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .15s, background .15s;
}
.age-card li a:hover { border-color: var(--acc); background: var(--acc-softer); }
.age-card ul.scroll { max-height: 5.9em; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.age-card ul.scroll li a { min-height: 38px; padding: 6px 10px; align-items: center; }
.age-card ul.scroll::-webkit-scrollbar { width: 6px; }
.age-card ul.scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.age-card .none { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-3); font-size: 12.5px; color: var(--muted); }

/* ---------- 家长指南 ---------- */
.parents { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; }
.parents-note {
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(150deg, var(--acc-softer), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.parents-note h2 { margin: 6px 0 12px; font-size: 24px; line-height: 1.3; }
.parents-note p { font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.steps { display: grid; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  padding: 15px 17px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.step b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--acc-soft);
  color: var(--acc);
  font-weight: 800;
}
.step h3 { margin: 0; font-size: 15px; }
.step p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.callout { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--acc); border-radius: 0 14px 14px 0; background: var(--acc-softer); font-size: 13.5px; color: var(--ink-soft); }

/* ---------- 实验室演示桥接 ---------- */
.demos { display: grid; gap: 10px; }
.demo { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.demo b { font-size: 14.5px; }
.demo p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.demo span { flex: none; font-size: 12.5px; font-weight: 700; color: var(--acc); }

/* ---------- 课程页（五步绘本学习流） ---------- */
.back-btn { margin-top: 18px; }
.lesson-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lesson-nav a:not(.btn):hover { color: var(--acc); }
.crumb-trail a { font-weight: 650; color: var(--muted); }
.lesson-head {
  margin-top: 12px;
  padding: 22px 26px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--surface-2), var(--acc-softer));
  border: 1px solid var(--line);
}
.lesson-head h1 { margin: 10px 0 8px; font-size: clamp(26px, 4vw, 38px); }
.lesson-head p { max-width: 60ch; color: var(--muted); font-size: 14.5px; }
.lesson-tools { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.lesson-age { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); font-weight: 650; }
.lesson-age select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.flow { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; padding: 24px 0 60px; align-items: start; }
.stage { display: grid; gap: 18px; }
.st {
  padding: 22px 25px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(30, 45, 37, .03);
}
.st-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.st-head b {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--acc-softer);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--acc);
}
.st-head h2 { margin: 0; font-size: 17px; }
.st p { font-size: 15px; line-height: 1.75; color: var(--ink-soft); }
.st ol { padding-left: 20px; font-size: 14.5px; color: var(--ink-soft); }
.st ol li { padding: 3px 0; }
.st.q {
  background: linear-gradient(135deg, #fffdf6, var(--surface-2));
  border-color: var(--line-strong);
}
.st.q h2, .st.q p { font-size: clamp(19px, 2.5vw, 25px); font-weight: 800; line-height: 1.4; letter-spacing: -.02em; color: var(--ink); }

.aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; }
.aside > section { padding: 17px 19px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; font-size: 13.5px; }
.aside h3 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .06em; color: var(--muted); font-family: var(--font-mono); }
.aside p { color: var(--ink-soft); line-height: 1.7; }
.aside details summary { cursor: pointer; font-weight: 750; color: var(--acc); list-style: none; display: flex; align-items: center; gap: 6px; }
.aside details summary::-webkit-details-marker { display: none; }
.aside details summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--acc-softer); font-family: var(--font-mono); }
.aside details[open] summary::before { content: "−"; }
.aside details p { margin-top: 10px; }
.aside ul { list-style: none; display: grid; gap: 6px; }
.aside li a { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 650; color: var(--ink); font-size: 13px; }
.aside li a:hover { border-color: var(--acc); }
.concept-chip { display: block; text-align: left; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13.5px; transition: border-color .15s, background .15s; }
.concept-chip:hover { border-color: var(--acc); background: var(--acc-softer); }
.concept-def { margin: 6px 0 0; padding: 9px 12px; border-radius: 11px; background: var(--surface-3); font-size: 12.5px; color: var(--muted); }

/* ---------- 互动实验台（绘本操作面板） ---------- */
.play {
  position: relative;
  padding: 22px 25px;
  background: var(--surface-2);
  border: 2px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.round-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.round-h h2 { margin: 0; font-size: 16.5px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); transition: transform .15s, background .15s; }
.dots i.on { background: var(--acc); transform: scale(1.1); }
.board {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 194px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, rgba(47, 125, 90, .09) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface-3);
}
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 68px;
  padding: 0 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: 0 3px 0 var(--line);
  font-weight: 800;
  font-size: 15px;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .1s;
}
.choice:hover { border-color: var(--acc); background: var(--acc-softer); transform: translateY(-1px); }
.choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.choice[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.choice.is-ok { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); box-shadow: 0 3px 0 color-mix(in srgb, var(--acc) 35%, transparent); }
.choice.is-no { opacity: .6; text-decoration: line-through; }
.feedback { min-height: 1.9em; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.feedback.ok { color: var(--acc); }
.feedback.retry { color: #9a6b2a; }
.play-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* 图形令牌：形状用 clip-path，颜色 + 形状双重编码 */
.tok { --c: #ff806b; display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; padding: 0; background: var(--c); color: #fff; font-weight: 800; font-size: 15px; transition: transform .15s, opacity .15s; }
.tok.circle { border-radius: 50%; }
.tok.triangle { clip-path: polygon(50% 4%, 98% 96%, 2% 96%); }
.tok.square { border-radius: 9px; }
.tok.c-coral { --c: #f27b65; } .tok.c-blue { --c: #5b86d2; } .tok.c-yellow { --c: #f2d55c; } .tok.c-green { --c: #4caf7d; }
.tok.t-shadow { width: 36px; height: 36px; background: var(--surface); color: var(--muted); font-size: 22px; border-radius: 10px; }
.seq { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.seq .tok { width: 54px; height: 54px; font-size: 17px; }
.seq .tok.num { width: auto; min-width: 48px; padding: 0 10px; border-radius: 12px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.seq .tok.in-unit { outline: 3px solid var(--acc); outline-offset: 3px; }
.seq .slot { display: inline-grid; place-items: center; width: 54px; height: 54px; border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 22px; font-weight: 800; }
.unit-note { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* 计数 */
.count-field { position: relative; width: 100%; max-width: 420px; height: 200px; }
.count-item { position: absolute; width: 50px; height: 50px; border: 0; border-radius: 50%; background: transparent; font-size: 36px; line-height: 1; display: grid; place-items: center; transition: opacity .15s, transform .15s; }
.count-item:hover { transform: scale(1.1); }
.count-item[aria-pressed="true"] { opacity: .4; }
.count-item .n { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11px; font-weight: 800; }

/* 分类 */
.sort-pool { display: flex; flex-wrap: wrap; gap: 10px; min-height: 56px; padding: 12px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--line); }
.sort-pool .tok { width: 44px; height: 44px; }
.sort-pool .tok[aria-pressed="true"] { outline: 3px solid var(--acc); outline-offset: 2px; transform: translateY(-3px); }
.baskets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.basket { min-height: 118px; padding: 10px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); text-align: left; transition: border-color .15s; }
.basket:hover { border-color: var(--acc); }
.basket.is-target { border-color: var(--acc); border-style: solid; }
.basket b { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.basket .sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--t); }
.basket .bin { display: flex; flex-wrap: wrap; gap: 6px; }
.basket .tok { width: 34px; height: 34px; }

/* 镜像 */
.mirror-wrap { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.grid5 { display: grid; grid-template-columns: repeat(5, 26px); grid-template-rows: repeat(5, 26px); gap: 3px; padding: 8px; border-radius: 12px; background: var(--surface-3); position: relative; }
.grid5 i { display: block; border-radius: 5px; background: var(--surface-2); }
.grid5 i.on { background: var(--acc); }
.grid5 i.bad { background: var(--danger); }
.grid5::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 50%; border-left: 2px dashed var(--muted); }
.grid5.small { grid-template-columns: repeat(5, 14px); grid-template-rows: repeat(5, 14px); gap: 2px; padding: 6px; }
.mirror-opts { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.mirror-opt { padding: 6px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); transition: border-color .15s; }
.mirror-opt:hover { border-color: var(--acc); }
.mirror-opt span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* 逻辑排队 */
.queue { display: grid; gap: 12px; }
.clues { margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--ink-soft); }
.clues li { padding: 2px 0; }
.slots, .actors { display: flex; gap: 10px; flex-wrap: wrap; }
.slot-box { display: grid; place-items: center; width: 96px; min-height: 60px; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 15px; position: relative; transition: border-color .15s; }
.slot-box small { position: absolute; top: -9px; left: 10px; padding: 0 5px; background: var(--surface); color: var(--muted); font-size: 11px; }
.slot-box.filled { border-style: solid; border-color: var(--acc); }
.slot-box.is-target { border-color: var(--acc); background: var(--acc-softer); }
.actors .choice { min-width: 92px; }

/* 多选铺砖 */
.tiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tile-pat { width: 112px; height: 74px; border-radius: 10px; background: var(--surface-3); overflow: hidden; display: block; }
.tiling { display: grid; width: 100%; height: 100%; background: var(--surface-3); }
.tiling i { display: block; background: var(--acc); }
.tiling.circle i { border-radius: 50%; transform: scale(.82); }
.tiling.triangle { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 18.5px; }
.tiling.triangle i { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tiling.triangle i:nth-child(even) { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tiling.square i { border: 1px solid var(--surface-3); }
.tiling.pentagon i { clip-path: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%); background: var(--danger); transform: scale(.8); }
.tiling.hexagon { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 24.6px; }
.tiling.hexagon i { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.tiling.hexagon i:nth-child(3n+2) { transform: translateY(12px); }
.multi-opt { display: grid; gap: 6px; justify-items: center; padding: 8px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 13px; transition: border-color .15s; }
.multi-opt:hover { border-color: var(--acc); }
.multi-opt[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-softer); }
.multi-opt.is-no { border-color: var(--danger); }

/* 摸球 */
.sim { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.bag { display: flex; flex-wrap: wrap; gap: 5px; width: 128px; padding: 14px; border-radius: 24px 24px 30px 30px; background: var(--ink); }
.bag i { width: 20px; height: 20px; border-radius: 50%; }
.bag i.y { background: #f4df76; } .bag i.b { background: #5b86d2; }
.last-draw { margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--bg); min-height: 1.4em; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.bar .tr { height: 22px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar .tr i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .25s ease; }
.bar.y .tr i { background: #d9c14a; } .bar.b .tr i { background: #5b86d2; }
.bar output { font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
.predict { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 13.5px; }

/* 比长短 */
.ruler { position: relative; display: grid; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface-3); background-image: repeating-linear-gradient(90deg, transparent 0 15px, var(--line) 15px 16px); }
.bar-line { position: relative; height: 26px; }
.bar-line i { position: absolute; top: 0; height: 26px; border-radius: 6px; transition: left .35s ease; }
.bar-line.a i { background: var(--acc); } .bar-line.b i { background: #5b86d2; }
.bar-line span { position: absolute; top: 3px; left: calc(100% + 8px); font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.lab-links { display: grid; gap: 10px; }

/* ---------- 空态 ---------- */
.m-empty { padding: 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- v1.1 & v1.2 互动组件 ---------- */
.count-grid { display: grid; gap: 6px; justify-content: center; }
.count-grid .count-item { position: relative; width: 40px; height: 40px; font-size: 26px; }
.count-grid .count-item.in-bundle { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 8px; }
.count-grid .count-item .n { top: -6px; right: -6px; }
.count-item.numbered .n { position: absolute; top: -8px; left: -8px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11px; font-weight: 800; }

.bonds { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.plate { flex: 1 1 160px; max-width: 240px; min-height: 120px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.plate b { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.plate .bin { display: flex; flex-wrap: wrap; gap: 6px; min-height: 46px; }
.plate .tok { width: 40px; height: 40px; }
.plate .tok:hover { transform: translateY(-2px); }

.pile { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 360px; font-size: 34px; line-height: 1; }
.pile span { animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.share-pool { text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.share-plates { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-plate { min-width: 92px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); text-align: center; }
.share-plate b { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.share-plate .bin { min-height: 36px; font-size: 22px; line-height: 1.1; word-break: break-all; }

.pos-board { position: relative; min-height: 240px; }
.pos-ref { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 72px; line-height: 1; pointer-events: none; }
.pos-bear { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -120%); font-size: 44px; line-height: 1; transition: left .3s ease, top .3s ease; pointer-events: none; }
.pos-bear.at-above { left: 50%; top: 14%; transform: translate(-50%, -50%); }
.pos-bear.at-below { left: 50%; top: 92%; transform: translate(-50%, -50%); }
.pos-bear.at-inside { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.8); }
.pos-bear.at-beside { left: 88%; top: 50%; transform: translate(-50%, -50%); }
.pos-zone { position: absolute; z-index: 2; width: 72px; height: 60px; border: 2px dashed var(--line-strong); border-radius: 14px; background: transparent; transform: translate(-50%, -50%); transition: border-color .15s, background .15s; }
.pos-zone:hover { border-color: var(--acc); background: var(--acc-softer); }
.z-above { left: 50%; top: 14%; } .z-below { left: 50%; top: 92%; } .z-inside { left: 50%; top: 50%; border-radius: 50%; width: 110px; height: 110px; } .z-beside { left: 88%; top: 50%; }

.city { display: grid; grid-template-columns: repeat(6, auto); gap: 10px 14px; justify-content: center; }
.city-block { position: relative; border: 0; background: transparent; padding: 2px; border-radius: 10px; transition: background .15s, transform .15s; }
.city-block:hover { transform: translateY(-2px); background: var(--acc-softer); }
.city-block[aria-pressed="true"] { background: var(--acc-soft); }
.city-block .n { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11px; font-weight: 800; }

.cups { display: flex; align-items: flex-end; gap: 40px; justify-content: center; min-height: 170px; }
.cup { position: relative; display: flex; align-items: flex-end; border: 3px solid var(--ink-soft); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; }
.cup i { display: block; width: 100%; background: #9dc3f7; transition: height .8s ease; }

.vote-wrap { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.vote-chart { position: relative; display: flex; align-items: flex-end; gap: 24px; height: 220px; padding: 0 10px; border-bottom: 2px solid var(--line-strong); }
.vote-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; flex: 1; height: 100%; }
.vote-col .cells { display: flex; flex-direction: column-reverse; gap: 2px; }
.vote-cell { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--acc-soft); font-size: 18px; animation: pop .25s ease; }
.vote-fruit { font-size: 22px; line-height: 1; margin-top: 4px; }
.vote-col small { font-size: 11px; color: var(--muted); }
.vote-side { min-width: 170px; }

.slice { fill: #f8e9d6; stroke: var(--surface-2); stroke-width: 2; }
.slice.on { fill: #ff806b; }

.fm { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.fm-io { display: grid; gap: 4px; text-align: center; font-size: 13px; color: var(--muted); }
.fm-io output { font-family: var(--font-mono); font-size: 26px; font-weight: 800; color: var(--ink); }
.fm-box { padding: 14px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); font-family: var(--font-mono); font-weight: 800; }
.fm-plot { width: 180px; height: 150px; }
.fm-plot .axis { stroke: var(--line-strong); stroke-width: 1.5; }
.fm-plot .pt { fill: var(--acc); } .fm-plot .pt.cur { fill: var(--danger); r: 6; }
.fm-plot .fm-line { stroke: var(--acc); stroke-width: 2; stroke-dasharray: 4 4; opacity: .6; }

.tok.big { width: 64px; height: 64px; }
.grid5.axis-x::after { top: 50%; bottom: auto; left: 4px; right: 4px; border-left: 0; border-top: 2px dashed var(--muted); }

.balance { position: relative; width: 300px; max-width: 100%; margin: 20px auto 0; }
.beam { position: relative; height: 10px; margin: 0 20px; border-radius: 5px; background: var(--ink); transition: transform .6s ease; transform-origin: center; }
.balance[data-tilt="left"] .beam { transform: rotate(-9deg); } .balance[data-tilt="right"] .beam { transform: rotate(9deg); }
.pan { position: absolute; top: 6px; width: 110px; min-height: 56px; padding: 8px; border-radius: 0 0 14px 14px; background: var(--surface-2); border: 2px solid var(--line-strong); display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: flex-end; }
.pan.left { left: -30px; transform: translateY(0); } .pan.right { right: -30px; }
.pillar { width: 10px; height: 70px; margin: 0 auto; background: var(--ink); }
.bw-item { display: inline-grid; place-items: center; font-size: 30px; line-height: 1; }
.bw-item small { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

.clock-wrap { display: grid; justify-items: center; gap: 6px; }
.clock { width: 170px; height: 170px; }
.clock .face { fill: var(--surface-2); stroke: var(--ink-soft); stroke-width: 2; }
.clock .ck { font-size: 9px; fill: var(--ink); text-anchor: middle; font-weight: 700; }
.clock .hand { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; } .clock .hand.min { stroke-width: 2; }
.clock .pin { fill: var(--acc); }
.clock-wrap output { font-family: var(--font-mono); font-weight: 800; font-size: 20px; }

.area-grid { display: grid; gap: 3px; justify-content: center; }
.cell { width: 34px; height: 34px; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); padding: 0; }
.cell[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); }
.cell.off { border-color: transparent; background: transparent; }

.nline { position: relative; display: flex; justify-content: space-between; width: 100%; max-width: 520px; padding-top: 34px; border-top: 2px solid var(--ink-soft); margin: 0 auto; }
.nl-tick { position: relative; top: 0; width: 24px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.nl-tick.zero { color: var(--ink); font-weight: 800; }
.nl-tick::before { content: ""; position: absolute; top: -34px; left: 11px; height: 8px; border-left: 2px solid var(--ink-soft); }
.nl-cur { position: absolute; top: -10px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--coral, #ff806b); transform: translateX(-8px); transition: left .4s ease; }

.odo { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.odo-item { display: grid; justify-items: center; gap: 6px; padding: 10px; border: 2px solid var(--line-strong); border-radius: 16px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.odo-item:hover { border-color: var(--acc); }
.odo-item.is-ok { border-color: var(--acc); background: var(--acc-softer); color: var(--ink); }
.odo-why { margin-top: 10px; font-size: 14px; color: var(--ink-soft); text-align: center; min-height: 1.6em; }

.maze-wrap { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.maze { position: relative; display: grid; gap: 2px; padding: 2px; }
.mz { width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 20px; }
.mz.wall { background: var(--ink); } .mz.goal { background: var(--acc-soft); }
.mz-p { position: absolute; top: 2px; left: 2px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 22px; transition: transform .2s ease; }
.mz-p::before { content: "🧭"; }
.maze-side { display: grid; gap: 8px; justify-items: center; }
.maze-side output { font-family: var(--font-mono); font-weight: 800; }
.mz-btns { display: grid; grid-template-columns: repeat(3, 46px); gap: 4px; justify-items: center; }
.mz-btns .choice { min-width: 46px; padding: 0; } .mz-btns [data-dy="-1"] { grid-column: 2; } .mz-btns [data-dx="-1"] { grid-column: 1; grid-row: 2; } .mz-btns [data-dy="1"] { grid-column: 2; grid-row: 2; } .mz-btns [data-dx="1"] { grid-column: 3; grid-row: 2; }

.gpath { width: 100%; max-width: 420px; height: auto; }
.gpath .ge { stroke: var(--line-strong); stroke-width: 2; } .gpath .gw { font-size: 5px; fill: var(--muted); text-anchor: middle; font-weight: 700; }
.gpath .gt { stroke: var(--acc); stroke-width: 3.5; stroke-linecap: round; }
.gpath .gn { cursor: pointer; } .gpath .gn circle { fill: var(--surface-2); stroke: var(--ink); stroke-width: 2; } .gpath .gn text { font-size: 6px; font-weight: 800; text-anchor: middle; fill: var(--muted); pointer-events: none; }
.gpath .gn:hover circle { stroke: var(--acc); } .gpath .gn.on circle { fill: var(--acc); stroke: var(--acc); } .gpath .gn.on text { fill: #fff; }

.fair { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.spinner { width: 170px; height: 170px; }
.spinner .sec { stroke: var(--surface-2); stroke-width: 2; } .spinner .sec.r { fill: #ff806b; } .spinner .sec.b { fill: #5b86d2; } .spinner .sec.y { fill: #f4df76; }
.spinner .pin { fill: var(--ink); }
.fair-side .choices { margin-top: 0; }
.fair-side output { font-size: 12.5px; color: var(--muted); }

.more-card { align-items: flex-start; justify-content: center; border-style: dashed; background: var(--surface-3); }
.more-card .ic { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 6px; border-radius: 13px; background: var(--acc-soft); color: var(--acc); font-size: 22px; line-height: 1; font-weight: 800; }

.lesson-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #141c17; border: 1px solid var(--line); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .m-hero { grid-template-columns: 1fr; padding: 24px; }
  .m-art { order: -1; max-height: 230px; }
  .topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-grid, .parents, .flow { grid-template-columns: 1fr; }
  .aside { position: static; }
  .ages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic { min-height: 150px; padding: 14px; }
  .topic.wide { grid-column: span 2; }
  .ages { grid-template-columns: 1fr; }
  .m-sec-head { flex-direction: column; align-items: flex-start; }
  .m-sec-head p { text-align: left; }
  .st, .play { padding: 17px; }
  .mirror-wrap, .sim, .vote-wrap, .fair { grid-template-columns: 1fr; }
  .fair { justify-items: center; }
  .slot-box { width: 84px; }
  .grid5 { grid-template-columns: repeat(5, 22px); grid-template-rows: repeat(5, 22px); }
  .count-field { height: 170px; }
  .city { grid-template-columns: repeat(4, auto); }
  .cups { gap: 20px; }
  .cell { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .mcard, .topic, .tok, .count-item, .bar-line i, .bar .tr i, .m-float { transition: none !important; animation: none !important; }
}
