/* cn-k12-dxyc2286 · 全站样式
   主色：青绿 #0f6e62；学段色：小学 #0f9d8a、初中 #2f6fd0、高中 #b5446e
   跟随系统深色模式；不加载任何外网字体或样式。 */

:root {
  --brand: #0f6e62;
  --brand-soft: #dff3ef;
  --brand-ink: #0a4c44;
  --primary: #0f9d8a;
  --junior: #2f6fd0;
  --senior: #b5446e;
  --ink: #16202a;
  --ink-2: #4a5966;
  --ink-3: #6b7a88;
  --line: #e2e8ee;
  --bg: #f7f9fb;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16, 32, 42, .06), 0 8px 24px rgba(16, 32, 42, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --logo-sheet: #dff3ef;
  --logo-fold: #ffffff;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4dc9b6;
    --brand-soft: #143028;
    --brand-ink: #b8e8df;
    --ink: #e8eef3;
    --ink-2: #b3c0cb;
    --ink-3: #8b9aa7;
    --line: #26313b;
    --bg: #0d1418;
    --card: #141d23;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --logo-sheet: #143028;
    --logo-fold: #0d1418;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; color: var(--brand); flex: none; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-kicker { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
  padding: 6px 10px; border-radius: 999px; font-size: 14px;
  color: var(--ink-2); white-space: nowrap;
}
.nav-link:hover { background: var(--brand-soft); color: var(--brand-ink); text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.subject-switch { display: flex; gap: 2px; margin-right: 6px; }

/* ---------- 主容器 ---------- */
main.home { max-width: var(--maxw); margin: 0 auto; padding: 28px 18px 64px; }

.hero { padding: 26px 0 8px; }
.eyebrow {
  margin: 0 0 10px; font-size: 13px; letter-spacing: .06em;
  color: var(--brand); font-weight: 600;
}
.hero h1 {
  margin: 0 0 12px; font-size: clamp(28px, 5vw, 42px); line-height: 1.25;
  letter-spacing: -.01em;
}
.lede { margin: 0 0 20px; max-width: 46em; color: var(--ink-2); font-size: 16.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.quiet-link { margin: 14px 0 0; font-size: 14px; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }

/* ---------- 区块标题 ---------- */
.section-title {
  margin: 44px 0 16px; font-size: 20px; letter-spacing: -.005em;
  display: flex; align-items: baseline; gap: 10px;
}
.section-title small { font-size: 13px; font-weight: 400; color: var(--ink-3); }

/* ---------- 三步 ---------- */
ol.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  counter-reset: step;
}
ol.steps li {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 18px 56px; box-shadow: var(--shadow);
}
ol.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 13px; font-weight: 700;
}
ol.steps h3 { margin: 0 0 6px; font-size: 16px; }
ol.steps p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-num {
  font-size: 28px; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--brand-ink);
}
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 学科卡 ---------- */
.subject-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.subject-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink);
}
.subject-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.subject-card .sc-name { font-weight: 650; font-size: 15px; }
.subject-card .sc-meta { font-size: 12px; color: var(--ink-3); }
/* 学科卡 = 一级学科；版本 chips = 二级分支（同一学科的不同教材版本） */
.subject-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-editions { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 2px; }
.sc-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line, #d8dee5); background: var(--bg-2, #f6f8fa);
  font-size: 12px; color: var(--ink-2, #475467); text-decoration: none; white-space: nowrap;
}
.sc-chip:hover { border-color: var(--brand); color: var(--brand); background: #fff; }

.subject-card .sc-count {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--brand-ink); font-size: 15px;
}

/* ---------- 特性 ---------- */
.feature-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------- 状态/提示 ---------- */
.notice {
  margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  font-size: 13.5px;
}
.load-error {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: #fff4f4; border: 1px solid #f3c2c2; color: #8a2b2b; font-size: 13.5px;
}
@media (prefers-color-scheme: dark) {
  .load-error { background: #2a1618; border-color: #5a2a2e; color: #f0b6b6; }
}

/* ---------- FAQ ---------- */
details.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 10px;
}
details.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
details.faq p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 18px 48px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px;
}
.site-footer a { color: var(--ink-2); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .site-nav { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .subject-switch { display: none; }
  .hero h1 { font-size: 27px; }
  main.home { padding-top: 16px; }
}

/* 规范根号：√ 后被开方数加顶部横线（讲解页与诊断页共用；learn.css 里已有一份，等价） */
.rad { white-space: nowrap; display: inline-block; line-height: 1.15; vertical-align: -0.02em; }
.rad .sq { display: inline-block; transform: scaleY(1.18) translateY(.02em); }
.rad .rd { display: inline-block; border-top: 1.5px solid currentColor; padding: .05em .16em 0 .1em; margin-left: -.04em; }

/* 规范分式：上下叠排 + 分数线 */
.frac { display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; margin: 0 .1em; font-size: .88em; line-height: 1.02;
  position: relative; top: -0.06em; }
.frac .num { display: block; border-bottom: 1.2px solid currentColor; padding: 0 .16em; }
.frac .den { display: block; padding: 0 .16em; }

/* 向量：字母正上方一条右箭头（自画线，不用字体 overline，离字母更近、长度随字母宽） */
.vec { position: relative; display: inline-block; line-height: 1; }
.vec::before {
  content: ""; position: absolute; left: 0; right: .08em; top: -.06em;
  border-top: 1px solid currentColor;
}
.vec::after {
  content: ""; position: absolute; right: -.04em; top: -.14em;
  border-left: .3em solid currentColor;
  border-top: .12em solid transparent;
  border-bottom: .12em solid transparent;
}

/* 根号内部的幂与分数（横线之内），字号缩一档避免顶穿根号横线 */
.rad .rd sup { font-size: .72em; vertical-align: .38em; line-height: 0; }
.rad .rd .frac { font-size: .78em; vertical-align: middle; margin: 0 .02em; }
.rad .rd .frac .num, .rad .rd .frac .den { font-size: inherit; }
