/* ============================================================
   车载测试学堂 · 首页样式  v1
   科技写实风 · 亮/暗双主题（CSS 变量驱动）
   ============================================================ */

:root {
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --brand: #2563eb;
  --brand-2: #06b6d4;
  --accent: #f59e0b;

  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --bg-glass: rgba(255, 255, 255, .72);
  --card: #ffffff;
  --card-border: rgba(15, 42, 80, .08);
  --text: #0e1b2c;
  --text-2: #4a5a70;
  --text-3: #8593a8;
  --shadow: 0 4px 20px rgba(24, 144, 255, .06);
  --shadow-hover: 0 12px 40px rgba(24, 144, 255, .12);
  --hero-grid: rgba(37, 99, 235, .07);
  --hero-bg: linear-gradient(135deg, #eef4ff 0%, #f7fbff 45%, #ecf9fd 100%);
  --chip: rgba(37, 99, 235, .08);
  --wave-h: #2563eb;
  --wave-l: #06b6d4;
  --ring-track: rgba(15, 42, 80, .10);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  /* ===== 统一间距（Spacing Scale，4px 基准，跨页面复用，避免散值） ===== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  /* 统一补充跨页面复用 token（修复术语表/提示气泡在暗色下的白底、搜索框白边问题） */
  --surface: #ffffff;                 /* 面板/卡片表面（亮色，供 glossary.css 等复用） */
  --border: #e4ebf3;                  /* 描边（亮色） */
  --hairline: rgba(15, 42, 80, .1);  /* 极细分隔线（亮色，替代原白色兜底导致浅底不可见） */

  /* ===== 统一字阶（Type Scale）— 规范字号层级，消除散值/近重复 ===== */
  --fs-display: clamp(34px, 4.6vw, 58px); /* Hero 主标题 */
  --fs-h1: 28px;        /* 区块大标题（知识卡片 / 学习路线） */
  --fs-h2: 23px;        /* 术语表 / 卡片标题级 */
  --fs-h3: 18.5px;      /* 知识卡片标题 / 内容 h3 */
  --fs-h4: 16px;        /* 内容子标题 / banner 描述 */
  --fs-lead: 16.5px;    /* 引导副文 */
  --fs-body: 15px;      /* 正文基准 */
  --fs-md: 14px;        /* 次级正文 / UI 文本 */
  --fs-sm: 13.5px;      /* 次要文本 */
  --fs-xs: 12px;        /* 标签 / 注脚 */
  --fs-2xs: 11px;       /* 微标签 / 大写眉标 */
  --fs-3xs: 10px;       /* 极小元信息 */
  /* 装饰性等宽大字号（统计数字 / 序号） */
  --fs-mono-sm: 20px;
  --fs-mono-md: 22px;
  --fs-mono-lg: 24px;
  --fs-mono-xl: 32px;
  /* ===== 统一字重（CJK 下 900 过粗发糊，主标题统一 800） ===== */
  --fw-black: 900;
  --fw-bold: 800;
  --fw-semi: 700;
  --fw-med: 600;
  --fw-reg: 500;
  /* ===== 统一行高 ===== */
  --lh-tight: 1.25;
  --lh-base: 1.6;
}

/* 暗夜科技 Deep Dark — 分层 elevation：深底 + 提亮 surface + 可见浅描边 + 发光阴影 */
html[data-theme="dark"] {
  /* 基础背景分层（elevation） */
  --bg: #0b0f19;                 /* 略提亮，避免死黑遮挡 */
  --bg-soft: #0f1626;            /* 略亮一档，区分底层 */
  --bg-glass: rgba(15, 21, 33, .85);
  --card: #141a29;               /* surface-1，明显亮于背景，制造层次 */
  --card-border: rgba(15, 255, 255, .12);   /* 可见浅描边（原 10% 蓝几乎不可见） */
  --card-border-strong: rgba(15, 255, 255, .22);
  --text: #e2e8f0;
  --text-2: #8a99ad;
  --text-3: #6b7a90;             /* 提亮，原 #506a8a 在深底看不清 */
  --text-4: #56657f;
  /* 分层 surface（玻璃/面板/代码/高亮） */
  --surface-1: #141a29;
  --surface-2: #182338;
  --surface-3: #1e2a44;
  /* 描边 hairline */
  --hairline: rgba(15, 255, 255, .1);
  --hairline-strong: rgba(15, 255, 255, .18);
  --border-glow: rgba(15, 255, 255, .35);
  /* 阴影改为发光（黑底上纯黑阴影不可见 → 用品牌光晕 + 浅内描边建层次） */
  --shadow: 0 8px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(15, 255, 255, .04);
  --shadow-hover: 0 18px 50px rgba(15, 255, 255, .18), 0 0 0 1px rgba(15, 255, 255, .14);
  --elev-glow: 0 12px 40px rgba(15, 255, 255, .16);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .08);
  --hero-grid: rgba(15, 255, 255, .07);
  --hero-bg: linear-gradient(135deg, #070d1c 0%, #0b1426 45%, #0c1830 100%);
  --chip: rgba(15, 255, 255, .08);
  --ring-track: rgba(15, 255, 255, .16);
  /* 补充跨页面复用 token，令术语表/提示气泡在暗色下使用深色表面而非白底 */
  --surface: #182338;                  /* = surface-2 */
  --border: #1e293b;   /* = hairline */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh-base);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  transition: background .35s ease, color .35s ease;
  overflow-x: hidden;
}

::selection { background: rgba(37, 99, 235, .22); }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--card-border);
}
.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--space-7);
  height: 64px; display: flex; align-items: center; gap: var(--space-7);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: var(--fs-h3); letter-spacing: .5px;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.logo-badge {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.logo-badge svg { width: 20px; height: 20px; }
/* 统一 SVG 图标（ICON() / 内联）基准尺寸：随字号缩放，文本内联对齐 */
.ui-ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -.15em; }
#hdr-search-btn .ui-ic { width: 18px; height: 18px; vertical-align: middle; }
/* 知识库悬浮下拉 */
.nav-item-dropdown {
  position: relative;
  display: flex; align-items: center;
}
.nav .nav-item-dropdown > a {
  padding: 8px 22px 8px 14px;
  position: relative;
}
.nav-item-dropdown > a::after {
  content: ''; position: absolute; right: 7px; top: 50%;
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-50%) rotate(45deg);
  transition: transform .25s ease;
}
.nav-item-dropdown:hover > a::after {
  transform: translateY(-50%) rotate(-135deg);
}
.nav-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 999;
  min-width: 220px; max-height: 380px; overflow-y: auto;
  padding: 8px; border-radius: 14px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(37,99,235,.10);
  box-shadow: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(.96);
  transition: all .25s cubic-bezier(.16,1,.3,1);
  transition-delay: .12s; /* 关闭宽限：失去悬停后延迟收起，防误关 */
  pointer-events: none;
}
/* 隐形桥接：填补触发链接与面板间的空隙，消除“悬浮死区” */
.nav-dropdown::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
  pointer-events: auto; /* 关键：纳入悬停命中区，跨过间隙时不丢失 hover，根治切换抖动 */
}
html[data-theme="dark"] .nav-dropdown {
  background: rgba(8,18,36,.9);
  border-color: rgba(64,128,255,.12);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown.open .nav-dropdown {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s; /* 展开立即生效，不被关闭延迟拖累 */
}
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  text-decoration: none;
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 500;
  transition: all .2s ease;
}
.nav-dropdown-item:hover {
  background: var(--chip);
  color: var(--brand);
  transform: translateX(3px);
}
.nav-dropdown-item .dd-num {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-size: var(--fs-2xs); font-weight: 700;
  color: #fff;
}
.nav-dropdown-item .dd-title {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-dropdown-item .dd-star {
  flex-shrink: 0; font-size: var(--fs-2xs); color: var(--text-3);
}
.nav-dropdown-item .dd-mod {
  flex-shrink: 0; font-size: var(--fs-2xs); color: var(--text-3);
  padding: 2px 7px; border-radius: 6px; background: var(--chip);
  max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 10px; text-decoration: none;
  color: var(--text-2); font-size: var(--fs-md); font-weight: 500;
  transition: all .2s ease;
}
.nav a:hover { color: var(--brand); background: var(--chip); }
.nav a.active { color: var(--brand); background: var(--chip); }
/* 即将上线项：弱化 + soon 角标，不跳转（避免死链） */
.nav a.nav-soon {
  color: var(--text-3); opacity: .6; cursor: not-allowed; position: relative;
}
.nav a.nav-soon::after {
  content: 'soon'; margin-left: 5px; font-size: 9px; font-weight: 700;
  letter-spacing: .5px; padding: 1px 5px; border-radius: 6px;
  background: var(--chip); color: var(--brand); vertical-align: middle;
}
/* 即将上线项：禁用态不响应 hover 高亮（避免看起来可点） */
.nav a.nav-soon:hover { color: var(--text-3); background: transparent; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.theme-btn {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card);
  display: grid; place-items: center; color: var(--text-2);
  transition: all .25s ease;
}
.theme-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.theme-btn svg { width: 19px; height: 19px; }

/* ---------------- Hero Banner ---------------- */
.hero {
  position: relative;
  height: 500px;
  background: var(--hero-bg);
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
}
#hero-car { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
#hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
#hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 120px; pointer-events: none;
}
.hero-content {
  position: relative; z-index: 10;
  max-width: 1440px; margin: 0 auto; padding: 0 var(--space-7);
  height: 100%; display: flex; flex-direction: column; justify-content: center;
  pointer-events: none;
}
.hero-content > * { pointer-events: auto; }

/* Banner 文字可读性增强：半透明白/黑渐变遮罩 */
.hero-content::before {
  content: ''; position: absolute; inset: -40px;
  background: radial-gradient(ellipse 70% 110% at 28% 42%,
    rgba(255,255,255,.5) 0%, rgba(255,255,255,.08) 50%, transparent 75%);
  pointer-events: none; z-index: -1;
}
html[data-theme="dark"] .hero-content::before {
  background: radial-gradient(ellipse 70% 110% at 28% 42%,
    rgba(0,0,0,.4) 0%, rgba(0,0,0,.08) 50%, transparent 75%);
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  width: fit-content; padding: 6px 14px; border-radius: 999px;
  background: var(--bg-glass); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); font-size: var(--fs-sm); font-weight: 600;
  color: var(--brand); letter-spacing: 1px; margin-bottom: 20px;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 10px #22c55e;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.hero-title {
  font-size: var(--fs-display);
  font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: 1px;
  max-width: 720px;
  text-shadow: 0 2px 24px rgba(0,0,0,.08), 0 8px 40px rgba(255,255,255,.06);
}
html[data-theme="dark"] .hero-title {
  text-shadow: 0 2px 24px rgba(0,0,0,.35), 0 8px 40px rgba(0,0,0,.2);
}
.hero-title .grad {
  background: linear-gradient(92deg, var(--brand) 10%, var(--brand-2) 55%, #22d3ee 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin-top: 16px; font-size: var(--fs-lead); color: var(--text-2);
  max-width: 560px;
}
.hero-cta { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 14px; font-size: var(--fs-body); font-weight: 700;
  text-decoration: none; cursor: pointer; border: none;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(-1px) scale(.99); }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 30px rgba(37, 99, 235, .38);
}
.btn-primary:hover { box-shadow: 0 18px 44px rgba(37, 99, 235, .5); }
.btn-ghost {
  color: var(--text); background: var(--bg-glass);
  border: 1px solid var(--card-border); backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
/* 统计数据 → 毛玻璃仪表盘卡片 */
.hero-stats {
  display: inline-flex; gap: var(--space-7); margin-top: var(--space-7);
  padding: 16px 28px; border-radius: var(--radius-md);
  background: rgba(255,255,255,.45);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 24px rgba(37,99,235,.06);
}
html[data-theme="dark"] .hero-stats {
  background: rgba(14,23,41,.45);
  border-color: rgba(120,170,255,.1);
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 72px; }
.stat b {
  font-size: var(--fs-mono-xl); font-weight: 900; font-family: var(--font-mono); line-height: 1;
  letter-spacing: -.5px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span {
  font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .6px; margin-top: 4px;
}

/* ---------------- 学习路径条 ---------------- */
.roadmap-strip {
  max-width: 1440px; margin: -34px auto 0; padding: 0 var(--space-7);
  position: relative; z-index: 10;
}
.roadmap-card {
  background: var(--bg-glass); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 22px 28px;
}
.roadmap-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.roadmap-head h3 { font-size: clamp(20px, 2.2vw, 24px); font-weight: 900; letter-spacing: .4px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.roadmap-head h3 small { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase; }
.roadmap-head a { font-size: var(--fs-sm); color: var(--brand); text-decoration: none; font-weight: 600; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; position: relative; align-items: stretch; }
/* 阶段之间的演进连线（置于卡片之后，仅显于卡片间隙，强化“路径”语义） */
.stages::before {
  content: ''; position: absolute; top: 39px; left: 11%; right: 11%; height: 2px;
  background: linear-gradient(90deg, var(--ring-track), color-mix(in srgb, var(--brand) 40%, var(--ring-track)), var(--ring-track));
  border-radius: 2px; z-index: 0;
}
.stage {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  min-height: 132px; padding: 18px 18px 16px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--card-border);
  border-top: 3px solid var(--c, var(--brand));
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; cursor: pointer;
}
.stage:hover { transform: translateY(-4px); border-color: var(--c, var(--brand)); box-shadow: var(--shadow); }
.stage-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--brand)) 12%, var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--c, var(--brand)) 28%, transparent);
  margin-bottom: 10px;
}
.stage-icon svg { width: 22px; height: 22px; display: block; }
.stage .s-no {
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700;
  color: var(--c, var(--brand)); letter-spacing: 1px;
}
.stage .s-name { font-size: var(--fs-body); font-weight: 800; margin: 3px 0; color: var(--text); }
.stage .s-goal { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.stage .s-bar {
  margin-top: auto; padding-top: 14px; height: 4px; border-radius: 4px;
  background: var(--ring-track); overflow: hidden;
}
.stage .s-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 4px; background: var(--c, var(--brand));
  transition: width 1s cubic-bezier(.16, 1, .3, 1);
}

/* ---------------- 模块筛选 ---------------- */
.section { max-width: 1440px; margin: 0 auto; padding: var(--space-12) var(--space-7) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-title { font-size: var(--fs-h1); font-weight: var(--fw-bold); letter-spacing: .5px; line-height: var(--lh-tight); }
.section-desc { font-size: var(--fs-sm); color: var(--text-3); margin-top: 4px; letter-spacing: .3px; }
.section-title small {
  display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-3);
  letter-spacing: 2px; margin-bottom: 6px; text-transform: uppercase;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600;
  transition: all .25s ease; display: inline-flex; align-items: center; gap: 7px;
}
.chip .c-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.chip:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.chip:hover .c-dot { background: var(--brand); }
.chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .3);
  cursor: default;
}
.chip.active .c-dot { background: #fff !important; }
.chip .c-count {
  font-family: var(--font-mono); font-size: var(--fs-2xs); opacity: .75;
}
/* 能力分级筛选 chip：用 --lv-color 着色 */
.chip-level .c-dot { background: var(--lv-color, var(--brand)); }
.chip-level.active {
  background: var(--lv-color, var(--brand)); border-color: var(--lv-color, var(--brand)); color: #fff;
}
.chip-level.active .c-dot { background: #fff !important; }

/* ---------------- 卡片网格 ---------------- */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6);
  margin-top: var(--space-7);
}
.chapter-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease, border-color .35s ease;
  -webkit-user-select: text; user-select: text; -webkit-user-drag: none;
  opacity: 0; transform: translateY(26px);
}
.chapter-card.in { opacity: 1; transform: translateY(0); }
.chapter-card:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow-hover); border-color: var(--mod-color, var(--brand)); }

.card-cover {
  position: relative; height: 168px; overflow: hidden;
  background: linear-gradient(135deg, var(--mod-color, var(--brand)), color-mix(in srgb, var(--mod-color, var(--brand)) 55%, #000));
}
.card-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; z-index: 1;
}
.card-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.chapter-card:hover .card-cover svg { transform: scale(1.08); }
.card-level {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-size: var(--fs-2xs); font-weight: 700; color: #fff;
  padding: 3px 9px; border-radius: 999px;
  background: var(--lv-color, #2563eb);
  border: 1px solid rgba(255, 255, 255, .3);
}
.card-star {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  font-size: var(--fs-xs); font-weight: 700; color: #fff;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, .3); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .25);
}
.card-star.core { background: linear-gradient(135deg, #f59e0b, #ef4444); border: none; }

.card-body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.card-title {
  font-size: var(--fs-h3); font-weight: var(--fw-bold); letter-spacing: .3px; line-height: var(--lh-tight);
  color: var(--text); margin: 0 0 8px;
}
.card-oneliner {
  margin-top: 0; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 44px;
}
.card-tags { display: flex; gap: 7px; margin-top: 13px; flex-wrap: wrap; }
.tag {
  font-size: var(--fs-2xs); font-weight: 600; padding: 3px 9px; border-radius: 7px;
  background: var(--chip, rgba(120, 140, 180, .14)); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  white-space: nowrap;
}
.tag-more {
  background: transparent; color: var(--text-3, #8a94a6);
  border: 1px dashed var(--card-border, #e4ebf3);
}
.card-lastviewed {
  margin-left: auto; font-size: var(--fs-2xs); color: var(--text-3, #8a94a6);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.card-meta {
  padding-top: 16px;
  display: flex; align-items: center; gap: 16px;
  border-top: 1px dashed var(--card-border); margin-top: 16px;
  font-size: var(--fs-xs); color: var(--text-3);
}

/* 卡片预览展开面板（hover 时渐入） */
.card-preview {
  max-height: 0; overflow: hidden;
  transition: max-height .45s cubic-bezier(.16, 1, .3, 1), opacity .35s ease, margin .35s ease;
  opacity: 0; margin-top: 0;
}
.chapter-card:hover .card-preview {
  max-height: 200px; opacity: 1; margin-top: 14px;
}
.preview-list { list-style: none; padding: 0; }
.preview-list li {
  font-size: var(--fs-xs); color: var(--text-3); padding: 4px 0;
  display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid var(--card-border);
}
.preview-list li:last-child { border-bottom: none; }
.preview-list li::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--mod-color, var(--brand)); flex-shrink: 0;
}
.preview-toggle {
  font-size: var(--fs-2xs); color: var(--brand); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; margin-top: 10px;
  opacity: 0; transition: opacity .35s ease;
}
.chapter-card:hover .preview-toggle { opacity: 1; }
.preview-toggle svg { width: 14px; height: 14px; transition: transform .3s ease; }
.chapter-card:hover .preview-toggle svg { transform: translateX(3px); }
/* 「查看更多」入口卡片 */
.more-link { transition: all .3s cubic-bezier(.16, 1, .3, 1); cursor: pointer; }
.more-link:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.more-link svg { transition: transform .3s ease; }
.more-link:hover svg { transform: translateX(4px); }
.card-meta b { font-family: var(--font-mono); color: var(--text-2); font-weight: 700; }
.progress-ring { margin-left: auto; position: relative; width: 42px; height: 42px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .track { stroke: var(--ring-track); }
.progress-ring .val { stroke: var(--mod-color, var(--brand)); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.progress-ring span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: var(--fs-3xs); font-weight: 800; font-family: var(--font-mono); color: var(--text-2);
}


/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 64px; border-top: 1px solid var(--card-border);
  padding: var(--space-10) var(--space-7) var(--space-12); text-align: center;
  color: var(--text-3); font-size: var(--fs-sm);
}

/* 锚点偏移：避免 sticky 头部(64px)遮挡 #chapters 等跳转目标 */
.section, .hero, .roadmap-strip { scroll-margin-top: 84px; }
.site-footer b { color: var(--text-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stages { grid-template-columns: repeat(3, 1fr); }
  .hero { height: 480px; }
}
@media (max-width: 680px) {
  .nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: 0; }
  .nav > a { padding: 8px 10px; font-size: var(--fs-sm); }
  .nav-item-dropdown > a { padding: 8px 20px 8px 10px; font-size: var(--fs-sm); }
  .header-inner { gap: 12px; padding: 0 16px; flex-wrap: wrap; }
  .logo { font-size: var(--fs-h4); }
  .nav-dropdown { left: 0; right: auto; min-width: 200px; max-width: 88vw; }
  .header-right { flex: 1 1 100%; order: 5; }
  .hdr-search { flex: 1 1 100%; }
  .hdr-search input { width: 100%; flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .hero { height: 460px; }
  .hero-stats { gap: 22px; }
  .section { padding-top: 40px; }
}

/* ---------------- 实车 Hero 图片（替换SVG线框） ---------------- */
.hero-car-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: flex-end;
  overflow: hidden;
  padding-right: 4%;
}
.car-real-img {
  height: 76%; max-height: 420px; width: auto; max-width: 72%;
  object-fit: contain; opacity: .62;
  filter: drop-shadow(0 0 60px rgba(37, 99, 235, .1)) saturate(1.02);
  transition: all .5s cubic-bezier(.16, 1, .3, 1);
  mask-image: radial-gradient(ellipse 75% 100% at 60% 50%, #000 60%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 75% 100% at 60% 50%, #000 60%, transparent 95%);
}
html[data-theme="dark"] .car-real-img {
  filter: drop-shadow(0 0 80px rgba(96, 165, 250, .08)) saturate(1.04);
}
.car-overlay-left {
  position: absolute; top: 0; left: 0; width: 55%; height: 100%;
  background: linear-gradient(90deg, var(--hero-bg) 30%, transparent 85%);
  pointer-events: none; z-index: 1;
}
.car-overlay-right {
  position: absolute; top: 0; right: 0; width: 25%; height: 100%;
  background: linear-gradient(-90deg, var(--hero-bg) 35%, transparent 80%);
  pointer-events: none; z-index: 1;
}

/* ---------------- 车企分享卡片 ---------------- */
.oem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6);
  margin-top: 34px;
}
.oem-card {
  --oem-color: #2563eb;
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--oem-color) 12%, var(--card)) 0%, var(--card) 55%, var(--card) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); padding-bottom: 22px;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease, border-color .35s ease;
  opacity: 0; transform: translateY(26px);
}
[data-theme="dark"] .oem-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--oem-color) 16%, var(--surface-2)) 0%, var(--surface-2) 55%, var(--surface-2) 100%);
}
.oem-card.in { opacity: 1; transform: translateY(0); }
.oem-card:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow-hover); border-color: var(--oem-color); }

.oem-img-wrap {
  position: relative;
  width: 100%; height: 128px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* 车企品牌图标：拟真 Logo SVG，居中放大 */
.oem-brand-icon {
  width: 64px; height: 64px;
  border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--oem-color) 10%, var(--bg-soft));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--oem-color) 22%, transparent);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease;
}
.oem-card:hover .oem-brand-icon { transform: scale(1.1) translateY(-2px); box-shadow: 0 14px 34px color-mix(in srgb, var(--oem-color) 30%, transparent); }
.oem-brand-icon svg { width: 100%; height: 100%; display: block; }

.oem-name {
  font-size: var(--fs-body); font-weight: 700; margin: 14px 16px 2px;
  letter-spacing: .5px;
}
.oem-desc {
  font-size: var(--fs-xs); color: var(--text-3); line-height: 1.7;
  padding: 0 18px; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* 车企标签 → 无框点分隔 */
.oem-tags {
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center;
  margin-top: 10px; padding: 0 14px;
}
.oem-tags .tag {
  font-size: var(--fs-2xs); font-weight: 500; color: var(--text-3);
  padding: 0; border-radius: 0; background: none;
  display: inline-flex; align-items: center;
}
.oem-tags .tag + .tag::before {
  content: '·'; margin-right: 4px; color: var(--text-3);
  opacity: .35;
}

@media (max-width: 1080px) {
  .oem-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .oem-grid { grid-template-columns: repeat(2, 1fr); }
  .car-real-img { max-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 章节详情：内容筹备中占位 */
.kp-dt-coming {
  margin-top: 14px; padding: 22px 20px; border-radius: 14px;
  background: var(--chip); color: var(--text-2);
  font-size: var(--fs-md); line-height: 1.8; text-align: center;
}
html[data-theme="dark"] .kp-dt-coming { background: rgba(64,128,255,.08); }

/* ===== P0：头部全局搜索 ===== */
.hdr-search {
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--hairline, rgba(255,255,255,.16));
  border-radius: 999px; padding: 3px 4px 3px 12px;
}
.hdr-search input {
  border: none; outline: none; background: transparent; color: var(--text);
  font-size: var(--fs-sm); width: 168px; font-family: var(--font-sans);
}
.hdr-search input::placeholder { color: var(--text-3); }
.hdr-search button {
  border: none; cursor: pointer; border-radius: 999px; width: 30px; height: 30px;
  background: var(--brand); color: #fff; font-size: var(--fs-md); display: grid; place-items: center;
  transition: .2s;
}
.hdr-search button:hover { filter: brightness(1.08); }
@media (max-width: 680px) {
  .hdr-search input { width: 96px; }
}

/* ===== 术语表：正文高亮 + 悬浮释义 ===== */
.term {
  border-bottom: 1px dashed var(--brand, #2563eb);
  cursor: help; color: var(--brand, #2563eb); font-weight: 600;
}
.term:hover { background: color-mix(in srgb, var(--brand, #2563eb) 12%, transparent); }
.glossary-tip {
  position: fixed; z-index: 9999; max-width: 320px;
  background: var(--surface, #fff); color: var(--text, #1b2330);
  border: 1px solid var(--border, #e4ebf3); border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 12px 30px rgba(20, 40, 80, .18);
  font-size: var(--fs-sm); line-height: 1.6; opacity: 0; pointer-events: none;
  transform: translateY(4px); transition: opacity .14s, transform .14s;
}
.glossary-tip.show { opacity: 1; transform: translateY(0); }
.glossary-tip .gt-term {
  font-weight: 800; color: var(--brand, #2563eb); font-size: var(--fs-md);
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.glossary-tip .gt-full { font-weight: 500; color: var(--text-3, #8a94a6); font-size: var(--fs-xs); }
.glossary-tip .gt-def { margin-top: 6px; }

/* ============================================================
   “钛金霓虹”暗黑模式 (严格基于现有类名覆盖，无新增/变动类名)
   站点适配说明：原样基于本站真实 DOM 做了两处对接修正——
   (1) 选择器前缀 [data-theme='dark'] 补全为 html[data-theme='dark']，
       以匹配 main.css 既有 html[data-theme="dark"] 规则的特异性，否则
       header / hero 的部分属性会被旧规则盖掉，霓虹只生效一半；
   (2) 卡片容器 .card-grid / .oem-grid 在本站不存在，改为直接命中真实卡片类
       .chapter-card / .oem-card，使首页卡片真正套上霓虹皮。
   （注：.s-no/.s-name/.s-goal、.stage-icon、.section-title、.section-desc
    本站对应子元素用了别的类名，这几条规则当前为 no-op，不影响其它组件。）
   ============================================================ */

/* 1. 根节点与全局文本颜色继承防护 */
html[data-theme='dark'],
html[data-theme='dark'] body {
  color: #e2e8f0 !important;
  background-color: #0b0f19 !important;
  background-image:
    radial-gradient(at 10% 15%, rgba(15, 255, 255, 0.035) 0px, transparent 40%),
    radial-gradient(at 90% 85%, rgba(246, 224, 179, 0.025) 0px, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* 2. 全局通用标签字色强制修正 */
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] h5,
html[data-theme='dark'] h6 {
  color: #f6e0b3; /* 标题统一香槟金 */
}

html[data-theme='dark'] p,
html[data-theme='dark'] span,
html[data-theme='dark'] li,
html[data-theme='dark'] label,
html[data-theme='dark'] div {
  color: inherit;
}

html[data-theme='dark'] a {
  color: inherit;
  text-decoration: none;
}

/* 表单控件（输入框、按钮）字体颜色与主题防护 */
html[data-theme='dark'] input,
html[data-theme='dark'] button,
html[data-theme='dark'] textarea,
html[data-theme='dark'] select {
  color: #e2e8f0;
  color-scheme: dark; /* 告知浏览器使用暗色系原生控件 */
}

/* ====== 顶部导航 (.site-header) ====== */
html[data-theme='dark'] .site-header {
  background: rgba(15, 21, 33, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}

html[data-theme='dark'] .logo {
  color: #f6e0b3 !important;
  text-shadow: 0 0 10px rgba(246, 224, 179, 0.25);
}

html[data-theme='dark'] .logo-badge {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

html[data-theme='dark'] .nav a {
  color: #8a99ad;
}

html[data-theme='dark'] .nav a:hover,
html[data-theme='dark'] .nav a.active {
  color: #e2e8f0 !important;
}

html[data-theme='dark'] .nav .active::after {
  background-color: #0fffff;
  box-shadow: 0 0 8px #0fffff;
}

html[data-theme='dark'] .nav-dropdown {
  background: #141a29;
  border: 1px solid rgba(15, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .nav-dropdown a {
  color: #e2e8f0;
}

html[data-theme='dark'] .nav-dropdown a:hover {
  background: rgba(15, 255, 255, 0.05);
  color: #0fffff !important;
}

html[data-theme='dark'] .hdr-search input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #1e293b;
  color: #e2e8f0;
}

html[data-theme='dark'] .hdr-search input::placeholder {
  color: #8a99ad;
}

html[data-theme='dark'] .hdr-search input:focus {
  border-color: #0fffff;
  box-shadow: 0 0 8px rgba(15, 255, 255, 0.2);
}

html[data-theme='dark'] .theme-btn {
  color: #f6e0b3;
}

/* ====== Hero 区域 (.hero) ====== */
html[data-theme='dark'] .hero-eyebrow {
  background: #1a2336;
  color: #8a99ad;
  border: 1px solid #1e293b;
}

html[data-theme='dark'] .hero-eyebrow .dot {
  background: #f6e0b3;
  box-shadow: 0 0 10px rgba(246, 224, 179, 0.25);
}

html[data-theme='dark'] .hero-title {
  color: #f6e0b3;
  text-shadow: 0 0 10px rgba(246, 224, 179, 0.25);
}

html[data-theme='dark'] .hero-title .grad {
  background: linear-gradient(92deg, #0fffff 10%, #22d3ee 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 10px rgba(15, 255, 255, 0.2);
}

html[data-theme='dark'] .hero-sub {
  color: #8a99ad;
}

html[data-theme='dark'] .btn-primary {
  background: linear-gradient(135deg, #f6e0b3 0%, #d4b47c 100%);
  color: #1a160d !important;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(246, 224, 179, 0.2);
}

html[data-theme='dark'] .btn-ghost {
  color: #e2e8f0 !important;
  border-color: #2a364f;
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme='dark'] .btn-ghost:hover {
  border-color: #8a99ad;
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme='dark'] .hero-stats .stat b {
  color: #f6e0b3;
  text-shadow: 0 0 10px rgba(246, 224, 179, 0.25);
}

html[data-theme='dark'] .hero-stats .stat span {
  color: #8a99ad;
}

/* ====== 学习路线 (.roadmap-strip) ====== */
html[data-theme='dark'] .roadmap-card {
  background-color: #141a29;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.012),
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 8px
  );
  border: 1px solid rgba(15, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .roadmap-head h3 small {
  color: #f6e0b3;
}

html[data-theme='dark'] .roadmap-head a {
  color: #38bdf8;
}

html[data-theme='dark'] .stages {
  border-top: 1px solid #1e293b;
}

html[data-theme='dark'] .stage {
  border-right: 1px solid #1e293b;
}

html[data-theme='dark'] .stage:hover {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme='dark'] .stage-icon {
  background: rgba(0, 0, 0, 0.3);
  border-color: #1e293b;
}

html[data-theme='dark'] .s-no { color: #8a99ad; }
html[data-theme='dark'] .s-name { color: #e2e8f0; font-weight: 600; }
html[data-theme='dark'] .s-goal { color: #8a99ad; }

/* ====== 章节与车企卡片区 (.section / .chip) ====== */
html[data-theme='dark'] .section-title small {
  color: #f6e0b3;
}

html[data-theme='dark'] .section-desc {
  color: #8a99ad;
}

html[data-theme='dark'] .chip {
  color: #8a99ad;
  background: #1a2336;
  border: 1px solid #1e293b;
}

/* JS 动态渲染的卡片直接命中本站真实卡片类 */
html[data-theme='dark'] .chapter-card,
html[data-theme='dark'] .oem-card {
  background-color: #141a29 !important;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.012),
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 8px
  );
  border: 1px solid rgba(15, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

/* ====== 页脚 (.site-footer) ====== */
html[data-theme='dark'] .site-footer {
  color: #8a99ad;
  background: #080b12;
  border-top: 1px solid #1e293b;
}

html[data-theme='dark'] .site-footer b {
  color: #e2e8f0;
}
