/* ============================================================
 * 初中数学知识树 · 全局样式
 * 设计语言：浅底深字、卡片化、三主干配色（蓝/绿/橙）
 * ============================================================ */

/* ---------- 基础 ---------- */
:root {
  --bg: #F4F7FB;
  --bg-soft: #EEF2F8;
  --card: #FFFFFF;
  --ink: #16233B;
  --ink-2: #3E4C66;
  --ink-3: #7A879E;
  --line: #E4EAF2;
  --blue: #2563EB;
  --blue-soft: #EFF6FF;
  --green: #059669;
  --green-soft: #ECFDF5;
  --orange: #D97706;
  --orange-soft: #FFFBEB;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(22, 35, 59, .06);
  --shadow-lg: 0 12px 32px rgba(22, 35, 59, .12);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

sup, sub { font-size: .72em; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); line-height: 1.1; letter-spacing: 1px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 13px; border-radius: 9px; font-size: 14px; color: var(--ink-2);
  font-weight: 500; transition: all .18s;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); }

/* 移动端导航 */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px; gap: 2px;
    display: none; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 11px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: all .18s; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1D4ED8; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, .28); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(5, 150, 105, .28); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #B45309; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #FECACA; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(228, 234, 242, .7);
  padding: 22px;
}
.card-hover { transition: all .22s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.section-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.5px; }
.section-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 22px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

/* ---------- 页头 ---------- */
.page-head {
  padding: 34px 0 8px;
}
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.page-head p { color: var(--ink-3); margin-top: 6px; max-width: 760px; }

/* ---------- 主干色工具 ---------- */
.c-algebra { color: var(--blue); } .bg-algebra { background: var(--blue); }
.c-geometry { color: var(--green); } .bg-geometry { background: var(--green); }
.c-stats { color: var(--orange); } .bg-stats { background: var(--orange); }
.soft-algebra { background: var(--blue-soft); } .soft-geometry { background: var(--green-soft); } .soft-stats { background: var(--orange-soft); }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #EAF2FF 0%, #E8FBF4 52%, #FDF3E3 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { position: relative; z-index: 2; padding: 56px 0 64px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.75); border: 1px solid var(--line);
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 16px;
}
.hero h1 { font-size: 38px; line-height: 1.25; font-weight: 900; letter-spacing: -1px; margin-bottom: 14px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--blue), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--ink-2); font-size: 16px; max-width: 560px; margin-bottom: 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-stats { display: flex; gap: 26px; }
.hero-stats .num { font-size: 26px; font-weight: 900; color: var(--ink); }
.hero-stats .lbl { font-size: 12.5px; color: var(--ink-3); }

/* Hero 装饰图形 */
.hero-art { position: relative; height: 380px; }
.hero-art > img { position: relative; z-index: 1; }
.hero-art .shape {
  position: absolute; border-radius: 20px;
  background: rgba(255,255,255,.7); border: 1px solid rgba(37,99,235,.12);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800;
}
.shape.s1 { width: 130px; height: 130px; top: 8px; left: 26px; color: var(--blue); transform: rotate(-6deg); animation: float 5s ease-in-out infinite; }
.shape.s2 { width: 150px; height: 110px; top: 90px; right: 8px; color: var(--green); transform: rotate(5deg); animation: float 6s ease-in-out .6s infinite; }
.shape.s3 { width: 128px; height: 78px; bottom: 6px; left: 8px; color: var(--orange); transform: rotate(-3deg); animation: float 5.5s ease-in-out 1.1s infinite; font-size: 15px; line-height: 1.4; }
.shape .f { font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.4; padding: 0 8px; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(-4deg); } }

/* ---------- 区块 ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }

/* 三主干卡 */
.branch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.branch-card { position: relative; overflow: hidden; }
.branch-card .bar { height: 5px; border-radius: 999px; width: 52px; margin-bottom: 14px; }
.branch-card h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.branch-card .theme { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; }
.branch-card .grades { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.branch-card .sw { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--bg-soft); border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; }
.branch-card .go { margin-top: 2px; }

/* 主干徽标 */
.badge-main {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; color: #fff; font-weight: 800; font-size: 13px; margin-right: 8px;
}

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--blue), var(--green), var(--orange)); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue);
}
.tl-item:nth-child(2)::before { border-color: var(--green); }
.tl-item:nth-child(3)::before { border-color: var(--orange); }
.tl-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.tl-item .tl-meta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.tl-item p { font-size: 13.5px; color: var(--ink-2); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; color: var(--ink); font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #FAFBFE; }

/* ---------- 知识体系页 ---------- */
.know-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.know-nav { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 4px; }
.know-nav .kn-group { margin-bottom: 12px; }
.know-nav .kn-title { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .8px; padding: 6px 12px 4px; }
.know-nav a {
  display: block; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2);
  border-left: 3px solid transparent; transition: all .15s;
}
.know-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.know-nav a.active { background: #fff; color: var(--ink); font-weight: 700; border-left-color: var(--blue); box-shadow: var(--shadow); }

.know-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.know-tabs button {
  padding: 9px 18px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: all .18s;
}
.know-tabs button.active { color: #fff; border-color: transparent; }
.know-tabs button[data-b="algebra"].active { background: var(--blue); }
.know-tabs button[data-b="geometry"].active { background: var(--green); }
.know-tabs button[data-b="stats"].active { background: var(--orange); }

.level-card { margin-bottom: 16px; }
.level-card .lc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.level-card .lc-step { font-size: 11px; font-weight: 800; color: #fff; padding: 3px 9px; border-radius: 6px; }
.level-card h3 { font-size: 17px; font-weight: 800; }
.level-card .lc-grade { font-size: 12.5px; color: var(--ink-3); }
.level-card .lc-content { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.key-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-soft); border-radius: 10px; padding: 9px 13px; font-size: 13.5px; margin-bottom: 8px;
}
.key-item .key-ico { flex: none; margin-top: 2px; }
.key-item.warn { background: var(--red-soft); }
.lc-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 9px 13px; }

/* 串卡 */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.str-card { border-top: 4px solid var(--blue); }
.str-card.g2 { border-top-color: var(--green); }
.str-card.g3 { border-top-color: var(--orange); }
.str-card h4 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.str-card .sec { margin-bottom: 10px; }
.str-card .sec-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.str-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.str-card .tag {
  font-size: 12.5px; background: var(--bg-soft); border-radius: 7px; padding: 4px 10px; color: var(--ink-2);
}
.str-card .core {
  font-size: 14px; font-weight: 700; color: var(--ink);
  background: var(--blue-soft); border-radius: 9px; padding: 9px 12px;
}
.str-card.g2 .core { background: var(--green-soft); }
.str-card.g3 .core { background: var(--orange-soft); }

/* 自查清单 */
.check-item {
  display: flex; align-items: flex-start; gap: 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; margin-bottom: 9px;
  cursor: pointer; transition: all .18s;
}
.check-item:hover { border-color: var(--blue); }
.check-item input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex: none; cursor: pointer; }
.check-item .ck-text { font-size: 14px; color: var(--ink-2); }
.check-item.done { background: var(--green-soft); border-color: #A7F3D0; }
.check-item.done .ck-text { color: #065F46; text-decoration: line-through; }

.progress-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; }
.progress-bar { flex: 1; height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 999px; transition: width .4s; }
.progress-num { font-size: 14px; font-weight: 800; color: var(--blue); min-width: 46px; text-align: right; }

/* ---------- 练习页 ---------- */
.filter-panel { margin-bottom: 20px; }
.filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-row label { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.chip-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--ink-2); transition: all .15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.chip[data-branch="geometry"].active { background: var(--green); border-color: var(--green); }
.chip[data-branch="stats"].active { background: var(--orange); border-color: var(--orange); }

.quiz-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.qstat {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 13px; font-size: 13px; color: var(--ink-2);
}
.qstat b { font-size: 15px; color: var(--ink); }
.qstat.right b { color: var(--green); }
.qstat.wrong b { color: var(--red); }

.question-card { margin-bottom: 18px; }
.q-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.q-tag { font-size: 12px; padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.q-diff { font-size: 12px; color: var(--orange); font-weight: 700; letter-spacing: 1px; }
.q-text { font-size: 15.5px; font-weight: 600; margin-bottom: 14px; line-height: 1.8; }

.opt-list { display: flex; flex-direction: column; gap: 9px; }
.opt-item {
  display: flex; align-items: flex-start; gap: 11px;
  border: 1.5px solid var(--line); border-radius: 11px; padding: 11px 14px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.opt-item:hover { border-color: var(--blue); background: var(--blue-soft); }
.opt-item .opt-key {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 1px;
}
.opt-item.sel { border-color: var(--blue); background: var(--blue-soft); }
.opt-item.sel .opt-key { background: var(--blue); color: #fff; }
.opt-item.correct { border-color: var(--green); background: var(--green-soft); }
.opt-item.correct .opt-key { background: var(--green); color: #fff; }
.opt-item.wrong { border-color: var(--red); background: var(--red-soft); }
.opt-item.wrong .opt-key { background: var(--red); color: #fff; }
.opt-item.dim { opacity: .55; }
.opt-item .opt-key.plain { border-radius: 8px; }

.fill-input {
  width: 100%; max-width: 380px; padding: 11px 15px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 11px; outline: none; transition: all .15s;
}
.fill-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fill-input.correct { border-color: var(--green); background: var(--green-soft); }
.fill-input.wrong { border-color: var(--red); background: var(--red-soft); }

.q-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.analysis-box { margin-top: 14px; border-radius: 12px; padding: 13px 16px; font-size: 13.5px; }
.analysis-box.ok { background: var(--green-soft); border: 1px solid #A7F3D0; }
.analysis-box.bad { background: var(--red-soft); border: 1px solid #FECACA; }
.analysis-box .a-title { font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.analysis-box.ok .a-title { color: #065F46; }
.analysis-box.bad .a-title { color: #991B1B; }
.analysis-box p { color: var(--ink-2); }

.empty-box {
  text-align: center; padding: 48px 20px; color: var(--ink-3); font-size: 14px;
}
.empty-box .big { font-size: 42px; margin-bottom: 10px; color: #C7D2E3; }

/* 错题本 */
.wrong-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wrong-item .wq { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.wrong-item .wm { font-size: 12.5px; color: var(--ink-3); }
.wrong-item .wa { font-size: 13px; margin-top: 4px; }
.wrong-item .wa b { color: var(--red); }

/* ---------- 考试页 ---------- */
.exam-config { max-width: 640px; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.config-item label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.config-item select, .config-item input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none; background: #fff;
}
.config-item select:focus, .config-item input:focus { border-color: var(--blue); }

.exam-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 20px; margin-bottom: 18px;
}
.timer { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.warn { color: #FCA5A5; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.exam-progress { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #CBD5E1; }

.answer-sheet { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sheet-num {
  width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.sheet-num.done { background: var(--blue); border-color: var(--blue); color: #fff; }
.sheet-num.current { outline: 3px solid rgba(37,99,235,.25); }

.exam-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

.result-score {
  text-align: center; padding: 26px 10px;
}
.result-score .score-ring {
  width: 132px; height: 132px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--bg-soft) 0);
}
.result-score .score-ring::before { content: ""; position: absolute; }
.result-score .score-ring i {
  width: 106px; height: 106px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.result-score .score-num { font-size: 34px; font-weight: 900; color: var(--ink); }
.result-score .score-tip { font-size: 13px; color: var(--ink-3); }

.branch-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.branch-bar .bb-label { width: 90px; color: var(--ink-2); font-weight: 600; flex: none; }
.branch-bar .bb-track { flex: 1; height: 9px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.branch-bar .bb-fill { height: 100%; border-radius: 999px; }

/* 成绩历史 */
.history-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.history-row:last-child { border-bottom: 0; }
.history-row .h-date { color: var(--ink-3); min-width: 90px; }
.history-row .h-score { font-weight: 800; min-width: 52px; }
.history-row .h-info { color: var(--ink-2); flex: 1; }
.history-row .h-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 方法工具页 ---------- */
.transform-table td:first-child { font-weight: 700; white-space: nowrap; }
.transform-table .arrow-cell { color: var(--blue); font-weight: 800; white-space: nowrap; }
.transform-table .how { background: var(--blue-soft); border-radius: 8px; padding: 3px 10px; display: inline-block; font-weight: 600; color: var(--blue); font-size: 13px; }

.flow-box { display: flex; flex-direction: column; gap: 0; }
.flow-node {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; position: relative;
}
.flow-node .fn-if { font-weight: 700; color: var(--ink); font-size: 14px; }
.flow-node .fn-then { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.flow-node .fn-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px;
}
.flow-node.arrow::after {
  content: ""; position: absolute; left: 29px; bottom: -12px;
  width: 2px; height: 12px; background: var(--line);
}
.flow-node:last-child.arrow::after { display: none; }

/* ---------- 公式页 ---------- */
.formula-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box input {
  width: 100%; padding: 10px 38px 10px 15px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-box .s-ico { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.formula-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.f-card { display: flex; flex-direction: column; }
.f-card .f-name { font-size: 14.5px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.f-card .f-body {
  flex: 1; background: var(--bg-soft); border-radius: 10px; padding: 11px 13px;
  font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 9px; overflow-x: auto;
}
.f-card .f-note { font-size: 12.5px; color: var(--ink-3); }
.f-card .f-svg { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }

/* ---------- 计划页 ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan-day {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  transition: all .2s; position: relative;
}
.plan-day:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-day .pd-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--blue);
  color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.plan-day:nth-child(2) .pd-num { background: var(--green); }
.plan-day:nth-child(3) .pd-num { background: var(--orange); }
.plan-day h4 { font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.plan-day p { font-size: 13px; color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.footer { margin-top: 56px; border-top: 1px solid var(--line); background: #fff; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.footer .links { display: flex; gap: 16px; }
.footer .links a { color: var(--ink-3); }
.footer .links a:hover { color: var(--blue); }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 74px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--ink); color: #fff; border-radius: 11px; padding: 11px 17px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 320px;
}
.toast.ok { background: var(--green); }
.toast.bad { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .branch-grid, .formula-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .know-wrap { grid-template-columns: 1fr; }
  .know-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .know-nav .kn-group { margin-bottom: 0; margin-right: 8px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { height: 260px; }
}
@media (max-width: 640px) {
  .branch-grid, .formula-grid, .card-grid, .config-grid, .plan-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .section-title { font-size: 20px; }
  .page-head h1 { font-size: 23px; }
  .container { padding: 0 14px; }
}
