/* 中小学数学知识图谱 · 元宝之书「数学小屋」视觉重映射
   套用 yuanbao.solokit.run 手绘亲子风设计语言（SITE-BRIEF-YUANBAO.md）
   功能零改动，仅视觉 token 重映射 */.math-app { 
  color-scheme: light;
  --ink: #2d2d2d;
  /* 纸张暖底 */
  --bg: #fdfbf7;            /* paper 纸白页面底（对齐 yuanbao-book tokens.background） */
  --bg-elev: #ffffff;       /* 卡片白（对齐 tokens.card） */
  --bg-muted: #e5e0d8;      /* muted 纸面（对齐 tokens.muted） */
  --text: #2d2d2d;          /* ink 深灰画笔 */
  --muted: #6b6259;         /* 次级文字暖灰棕 */
  --line: #d8cfc0;          /* 纸边线 */
  /* 主色 钢笔蓝 */
  --brand: #2d5da1;
  --brand-strong: #244c85;
  --brand-soft: #dbe7f7;
  --on-brand: #ffffff;
  --junior: #2d5da1;
  --junior-soft: #dbe7f7;
  --focus: #2d5da1;
  /* 贴纸硬阴影（不模糊） */
  --shadow: 3px 3px 0px 0px rgba(45,45,45,0.9);
  --radius: 18px;
  --radius-sm: 12px;
  /* 手写体优先 */
  --font: "Kalam", "Patrick Hand", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --fs: 17px;
  --ok: #157a3a;
  --ok-bg: #d9f2e0;
  --on-ok: #ffffff;
  --bad: #b3322b;
  --bad-bg: #fbe0dd;
  --on-bad: #ffffff;
  --warn: #a5580f;
  --warn-bg: #ffe8c9;
  --unk: #57534e;
  --unk-bg: #ede7dd;
  --accent: #2d5da1;
  --panel: #ffffff;
  /* 知识点节点色（元宝暖色系） */
  --node-primary: #2d5da1;      /* 数学-钢笔蓝 */
  --node-primary-bg: #dbe7f7;
  --node-junior: #c96f4a;       /* 英语-陶土橙 */
  --node-junior-bg: #f7e2d6;
  --node-senior: #7a5aa0;       /* 高级-暖紫 */
  --node-senior-bg: #ece2f5;
  --node-current-bg: #fff9c4;   /* cream 当前 */
  --node-current-border: #d9a441;
  --node-text: #2d2d2d;
  --edge: #8a6f5a;
  --edge-soft: #b8a594;
  --hard-bg: #ffe8c9;
  --hard-fg: #a5580f;
  --soft-bg: #ede7dd;
  --soft-fg: #57534e;
  --diagram-ok-bg: #d9f2e0;
  --diagram-ok: #157a3a;
  --diagram-bad-bg: #fbe0dd;
  --diagram-bad: #b3322b;
  --diagram-unk-bg: #ede7dd;
  --diagram-unk: #57534e;
  --diagram-shaky-bg: #ffe8c9;
  --diagram-shaky: #a5580f;
  --diagram-text: #2d2d2d;
  --diagram-edge: #8a6f5a;
 }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .math-app {
    color-scheme: dark;
    --bg: #1c1814;
    --bg-elev: #2a241f;
    --bg-muted: #3d342c;
    --text: #f6f1e8;
    --ink: #f6f1e8;
    --muted: #d2c7b8;
    --line: #5a4e43;
    --brand: #2f5fa3;
    --brand-strong: #a9c8f7;
    --brand-soft: #243044;
    --on-brand: #ffffff;
    --junior: #2f5fa3;
    --junior-soft: #243044;
    --focus: #a9c8f7;
    --shadow: 3px 3px 0 0 #cfc3b2;
    --ok: #9be0b4;
    --ok-bg: #173528;
    --ok-fill: #157a3a;
    --on-ok: #ffffff;
    --bad: #f3b2ab;
    --bad-bg: #3f221e;
    --bad-fill: #b3322b;
    --on-bad: #ffffff;
    --warn: #f0c27a;
    --warn-bg: #3a2c16;
    --unk: #d9d0c6;
    --unk-bg: #3a342e;
    --accent: #a9c8f7;
    --panel: #2a241f;
    --node-primary: #2d5da1;
    --node-primary-bg: #dbe7f7;
    --node-junior: #c96f4a;
    --node-junior-bg: #f7e2d6;
    --node-senior: #7a5aa0;
    --node-senior-bg: #ece2f5;
    --node-current-bg: #fff9c4;
    --node-current-border: #d9a441;
    --node-text: #2d2d2d;
    --edge: #e2c7aa;
    --edge-soft: #b8a594;
    --hard-bg: #3a2c16;
    --hard-fg: #f0c27a;
    --soft-bg: #3a342e;
    --soft-fg: #d9d0c6;
    --diagram-ok-bg: #173528;
    --diagram-ok: #9be0b4;
    --diagram-bad-bg: #3f221e;
    --diagram-bad: #f3b2ab;
    --diagram-unk-bg: #3a342e;
    --diagram-unk: #d9d0c6;
    --diagram-shaky-bg: #3a2c16;
    --diagram-shaky: #f0c27a;
    --diagram-text: #2d2d2d;
    --diagram-edge: #e2c7aa;
  }
}
html[data-theme="dark"] .math-app {
  color-scheme: dark;
  --bg: #1c1814;
  --bg-elev: #2a241f;
  --bg-muted: #3d342c;
  --text: #f6f1e8;
  --ink: #f6f1e8;
  --muted: #d2c7b8;
  --line: #5a4e43;
  --brand: #2f5fa3;
  --brand-strong: #a9c8f7;
  --brand-soft: #243044;
  --on-brand: #ffffff;
  --junior: #2f5fa3;
  --junior-soft: #243044;
  --focus: #a9c8f7;
  --shadow: 3px 3px 0 0 #cfc3b2;
  --ok: #9be0b4;
  --ok-bg: #173528;
  --ok-fill: #157a3a;
  --on-ok: #ffffff;
  --bad: #f3b2ab;
  --bad-bg: #3f221e;
  --bad-fill: #b3322b;
  --on-bad: #ffffff;
  --warn: #f0c27a;
  --warn-bg: #3a2c16;
  --unk: #d9d0c6;
  --unk-bg: #3a342e;
  --accent: #a9c8f7;
  --panel: #2a241f;
  --node-primary: #2d5da1;
  --node-primary-bg: #dbe7f7;
  --node-junior: #c96f4a;
  --node-junior-bg: #f7e2d6;
  --node-senior: #7a5aa0;
  --node-senior-bg: #ece2f5;
  --node-current-bg: #fff9c4;
  --node-current-border: #d9a441;
  --node-text: #2d2d2d;
  --edge: #e2c7aa;
  --edge-soft: #b8a594;
  --hard-bg: #3a2c16;
  --hard-fg: #f0c27a;
  --soft-bg: #3a342e;
  --soft-fg: #d9d0c6;
  --diagram-ok-bg: #173528;
  --diagram-ok: #9be0b4;
  --diagram-bad-bg: #3f221e;
  --diagram-bad: #f3b2ab;
  --diagram-unk-bg: #3a342e;
  --diagram-unk: #d9d0c6;
  --diagram-shaky-bg: #3a2c16;
  --diagram-shaky: #f0c27a;
  --diagram-text: #2d2d2d;
  --diagram-edge: #e2c7aa;
}
@media print{html[data-theme="dark"] .math-app,html:not([data-theme="light"]) .math-app,.math-app { 
    --bg: #fff;
    --bg-elev: #fff;
    --bg-muted: #f4f7fb;
    --text: #162033;
    --muted: #475569;
    --line: #d5dde6;
    --panel: #fff;
    --shadow: none;
   }
}.math-app *,
.math-app *::before,
.math-app *::after {  box-sizing: border-box;  }.math-app [hidden] {  display: none !important;  }.math-app {  -webkit-text-size-adjust: 100%;  }.math-app { 
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
 }.math-app img {  max-width: 100%; height: auto;  }.math-app .node-tip { 
  position: absolute;
  z-index: 6;
  max-width: min(280px, calc(100% - 16px));
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
 }.math-app code {  overflow-wrap: anywhere;  }.math-app :focus-visible {  outline: 3px solid var(--focus); outline-offset: 2px;  }@media (prefers-reduced-motion: reduce){.math-app *,
.math-app *::before,
.math-app *::after {  transition: none !important; scroll-behavior: auto !important;  }
}.math-app .top-banner { 
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 4px 12px;
  border-bottom: 2px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
 }.math-app .top-banner:hover { 
  background: var(--brand);
  color: var(--on-brand);
 }@media (max-width: 420px){.math-app .top-banner {  font-size: 13px; padding: 4px 8px;  }
}@media print{.math-app .top-banner {  display: none !important;  }
}.math-app .site-header { 
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  max-width: 100%;
 }.math-app .brand { 
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
 }.math-app .logo {  color: var(--brand); flex: none; display: block;  }.math-app .brand-name {  overflow-wrap: anywhere;  }.math-app .site-nav { 
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
 }.math-app .nav-link { 
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
 }.math-app .nav-link:hover {  background: var(--bg-muted);  }.math-app .nav-link.active,
.math-app .nav-link[aria-current="page"] { 
  background: var(--brand-soft);
  color: var(--brand-strong);
 }.math-app .nav-link.subject-link.on { 
  background: var(--brand);
  color: var(--on-brand);
 }@media (max-width: 720px){.math-app .site-nav {  flex: 1 1 100%; margin-left: 0;  }
}.math-app .site-footer { 
  padding: 14px 16px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  max-width: 100%;
 }.math-app .site-footer p {  margin: 0; overflow-wrap: anywhere;  }.math-app .site-footer a {  color: var(--brand-strong); font-weight: 700;  }.math-app button,
.math-app .btn { 
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
 }.math-app button.primary,
.math-app .btn-primary { 
  background: var(--brand);
  border-color: transparent;
  color: var(--on-brand);
 }.math-app button.primary:hover,
.math-app .btn-primary:hover {  filter: brightness(0.96);  }.math-app /* 题目图示：只用 currentColor，浅色和深色都看得见。宽度跟着容器走，不写死像素。 */
.q-figure {  color: inherit; max-width: 100%; min-width: 0; margin: 8px 0 2px;  }.math-app .q-figure svg {  width: 100%; max-width: 440px; height: auto; display: block; overflow: visible;  }.math-app .choices.fig-icons,
.math-app .sample-choices.fig-icons { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
 }.math-app .choices.fig-icons .q-figure svg,
.math-app .sample-choices.fig-icons .q-figure svg {  max-width: 100%;  }.math-app button.choice.fig-choice { 
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
 }.math-app .sample-choices {  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;  }.math-app .sample-choice { 
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  padding: 8px 10px;
  min-width: 0;
 }.math-app .btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
 }.math-app .btn-lg {  min-height: 52px; padding: 12px 20px; font-size: 1.05rem;  }.math-app .btn-block {  width: 100%;  }.math-app input[type="search"],
.math-app input[type="text"],
.math-app input[type="number"],
.math-app select,
.math-app textarea { 
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
 }.math-app input::placeholder,
.math-app textarea::placeholder {  color: var(--muted); opacity: 1;  }.math-app textarea {  min-height: 96px;  }.math-app .search-lg {  width: 100%; font-size: 1.08rem; min-height: 52px;  }.math-app .stage-tabs {  display: flex; flex-wrap: wrap; gap: 8px;  }.math-app .stage-tab {  border-radius: 999px;  }.math-app .stage-tab.on,
.math-app .stage-tab[aria-selected="true"] { 
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
 }.math-app .badge { 
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
 }.math-app .badge.hard {  background: var(--hard-bg); color: var(--hard-fg);  }.math-app .badge.soft {  background: var(--soft-bg); color: var(--soft-fg);  }.math-app /* 首页 */
.home {  width: min(1080px, 100%); margin: 0 auto; padding: 18px 16px 40px;  }.math-app .hero { 
  background:
    radial-gradient(820px 240px at 0% -20%, rgba(15, 118, 110, 0.16), transparent 60%),
    radial-gradient(640px 220px at 100% 0%, rgba(29, 78, 216, 0.12), transparent 55%),
    var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
 }.math-app .eyebrow {  margin: 0 0 8px; color: var(--brand-strong); font-weight: 800;  }.math-app .hero h1 {  margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 2.35rem); line-height: 1.25;  }.math-app .lede {  margin: 0 0 18px; font-size: 1.12rem; max-width: 40em;  }.math-app .hero-actions {  display: flex; flex-wrap: wrap; gap: 10px;  }.math-app .hero-actions .btn {  flex: 1 1 200px;  }.math-app .quiet-link {  margin: 12px 0 0;  }.math-app .quiet-link a {  color: var(--brand-strong); font-weight: 700;  }.math-app .section-title {  margin: 28px 0 12px; font-size: 1.3rem;  }.math-app .steps { 
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
 }.math-app .steps li { 
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
 }.math-app .step-no { 
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 800;
 }.math-app .steps h3 {  margin: 8px 0 4px; font-size: 1.12rem;  }.math-app .steps p {  margin: 0; color: var(--muted);  }.math-app .stat-grid,
.math-app .grade-grid { 
  display: grid;
  gap: 12px;
 }.math-app .stat-grid {  grid-template-columns: repeat(4, minmax(0, 1fr));  }.math-app .grade-grid {  grid-template-columns: repeat(3, minmax(0, 1fr));  }.math-app .stat-card,
.math-app a.grade-card,
.math-app a.iq-card { 
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
 }.math-app .stat-card {  padding: 14px 16px;  }.math-app .stat-num {  font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--brand-strong);  }.math-app .stat-label {  color: var(--muted); font-weight: 700;  }.math-app .stat-note {  color: var(--muted); margin: 8px 0 0;  }.math-app a.grade-card,
.math-app a.iq-card { 
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  min-height: 104px;
  text-decoration: none;
  color: inherit;
  box-shadow: inset 0 4px 0 var(--node-primary), var(--shadow);
 }.math-app a.grade-card.is-junior {  box-shadow: inset 0 4px 0 var(--node-junior), var(--shadow);  }.math-app a.grade-card.is-senior {  box-shadow: inset 0 4px 0 var(--node-senior), var(--shadow);  }.math-app a.grade-card:hover,
.math-app a.iq-card:hover {  border-color: var(--brand);  }.math-app a.grade-card strong,
.math-app a.iq-card strong {  font-size: 1.15rem;  }.math-app a.iq-card {  margin-top: 28px; gap: 4px; max-width: 100%;  }.math-app a.iq-card .iq-sub {  font-weight: 800; overflow-wrap: anywhere;  }.math-app a.iq-card .iq-note {  color: var(--muted); font-size: 0.82rem; font-weight: 700; overflow-wrap: anywhere;  }.math-app .grade-stage {  color: var(--muted); font-size: 0.88rem; font-weight: 700;  }.math-app .grade-count {  font-weight: 800;  }.math-app .load-error { 
  background: var(--bad-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
 }@media (max-width: 800px){.math-app .steps {  grid-template-columns: 1fr;  }.math-app .stat-grid,
.math-app .grade-grid {  grid-template-columns: 1fr 1fr;  }
}

