/* VacuumAnalyzerPro · v0.4.0
   Engineering Portal · 浅色现代工程门户风
   --------------------------------------------------------
   定位: 项目蓝图 / 子系统设计 / 路线图 / 知识库
   不再装作"运行中的车间监控"。
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #EEF2F7;
  color: #0F172A;
  font-family: "Inter", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  scroll-behavior: smooth;
}

/* 柔和色彩光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 18% -5%, rgba(8, 145, 178, 0.08), transparent 60%),
    radial-gradient(700px 500px at 85% 0%, rgba(124, 58, 237, 0.07), transparent 60%),
    radial-gradient(600px 400px at 95% 60%, rgba(37, 99, 235, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* subtle 网格背景 (印象上像工程绘图纸) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
}

#react-entry-point {
  position: relative;
  z-index: 1;
}

/* ── 滚动条 ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.28); }

/* ── 工具 class ─────────────────────────────────────── */
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

.gradient-text {
  background: linear-gradient(135deg, #0891B2 0%, #2563EB 50%, #7C3AED 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.inline-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  background: rgba(8, 145, 178, 0.10);
  color: #0891B2;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid rgba(8, 145, 178, 0.20);
}

/* ── 主壳 ──────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.main-content {
  padding: 0;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* ═════════════════════════════════════════════════════
   主侧栏
   ═════════════════════════════════════════════════════ */
.sidebar-modern {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  height: 100vh;
  padding: 22px 14px;
  position: sticky;
  top: 0;
}

.nav-link-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}
.nav-link-modern:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0F172A;
}
.nav-link-modern.active {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.14), rgba(37, 99, 235, 0.08));
  color: #0891B2;
  font-weight: 600;
}
.nav-link-modern.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #0891B2, #2563EB);
}
.nav-link-modern .nav-icon {
  width: 16px;
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
}
.nav-link-modern.active .nav-icon { opacity: 1; }
.nav-link-modern.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.nav-link-modern .nav-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.14);
  color: #64748B;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ═════════════════════════════════════════════════════
   顶部条
   ═════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-dot {
  font-size: 5px;
  color: #0891B2;
  margin-right: 12px;
}
.topbar-crumb-main {
  color: #0F172A;
  font-weight: 600;
  font-size: 14px;
}
.topbar-crumb-sep {
  margin: 0 10px;
  color: #94A3B8;
  font-weight: 300;
}
.topbar-crumb-sub {
  color: #64748B;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.10), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(8, 145, 178, 0.25);
  text-decoration: none;
  transition: all 0.15s ease;
}
.phase-pill:hover {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.16), rgba(37, 99, 235, 0.12));
  transform: translateY(-1px);
}
.phase-pill-icon { color: #0891B2; font-size: 11px; }
.phase-pill-name {
  color: #0891B2;
  font-weight: 700;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}
.phase-pill-desc {
  color: #475569;
  font-size: 11px;
}
.topbar-version {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #94A3B8;
}

/* ═════════════════════════════════════════════════════
   Hero
   ═════════════════════════════════════════════════════ */
.hero-section {
  position: relative;
  padding: 64px 40px 56px;
  overflow: hidden;
}
.hero-content { max-width: 920px; position: relative; z-index: 2; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(8, 145, 178, 0.22);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 22px;
}
.hero-eyebrow-icon {
  color: #0891B2;
  font-size: 12px;
}
.hero-eyebrow-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #0891B2;
  letter-spacing: 1.5px;
}
.hero-eyebrow-sep { color: #CBD5E1; }
.hero-eyebrow-sub {
  font-size: 11px;
  color: #475569;
  font-weight: 500;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 22px;
  letter-spacing: -1.2px;
}
.hero-title-soft {
  color: #334155;
  font-weight: 600;
}
.hero-title-strong {
  background: linear-gradient(135deg, #0891B2 0%, #2563EB 45%, #7C3AED 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title-dot {
  color: #0891B2;
}

.hero-subtitle {
  font-size: 16px;
  color: #475569;
  line-height: 1.7;
  margin: 0 0 28px;
  max-width: 760px;
}
.hero-subtitle b {
  color: #0F172A;
  font-weight: 600;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  border: none;
}
.hero-btn-primary {
  background: linear-gradient(135deg, #0891B2, #2563EB);
  color: white;
  box-shadow: 0 6px 20px -4px rgba(8, 145, 178, 0.4);
}
.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -4px rgba(8, 145, 178, 0.5);
}
.hero-btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.10);
}
.hero-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(8, 145, 178, 0.35);
  color: #0891B2;
  transform: translateY(-2px);
}

.hero-deco {
  position: absolute;
  right: -40px;
  top: 30px;
  font-size: 280px;
  color: rgba(8, 145, 178, 0.05);
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}
.hero-deco-icon { display: inline-block; }

/* ═════════════════════════════════════════════════════
   工艺事实条 (5 个静态卡)
   ═════════════════════════════════════════════════════ */
.fact-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  padding: 0 40px 56px;
}
.fact-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 3px solid;
  border-radius: 12px;
  padding: 18px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}
.fact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px -6px rgba(15, 23, 42, 0.10);
}
.fact-card > i[data-fact-icon] {
  font-size: 22px;
  padding-top: 4px;
  flex-shrink: 0;
}
.fact-text { flex: 1; min-width: 0; }
.fact-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}
.fact-value {
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.4px;
  font-feature-settings: "tnum" 1;
  margin-bottom: 4px;
}
.fact-detail {
  font-size: 11px;
  color: #64748B;
}

/* ═════════════════════════════════════════════════════
   Section 通用样式
   ═════════════════════════════════════════════════════ */
.page-section {
  padding: 64px 40px;
  position: relative;
  scroll-margin-top: 76px;
}
.section-head {
  margin-bottom: 36px;
  max-width: 760px;
}
.section-head-with-link {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 100%;
}
.section-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: #0891B2;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
  padding: 4px 10px;
  background: rgba(8, 145, 178, 0.08);
  border-radius: 6px;
}
.section-h2 {
  font-size: 32px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 10px;
  letter-spacing: -0.6px;
}
.section-lead {
  font-size: 15px;
  color: #64748B;
  margin: 0;
}
.section-link {
  font-size: 13px;
  color: #0891B2;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
}
.section-link:hover {
  color: #0E7490;
  transform: translateX(2px);
}

/* ── Section-title (用在卡片内部) ───────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, #0891B2, #2563EB);
  border-radius: 2px;
}

/* ═════════════════════════════════════════════════════
   子系统卡片
   ═════════════════════════════════════════════════════ */
.subsys-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1280px) {
  .subsys-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .subsys-grid { grid-template-columns: repeat(2, 1fr); }
}

.subsys-card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.22s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.subsys-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -10px rgba(15, 23, 42, 0.16);
  border-color: rgba(15, 23, 42, 0.14);
}
.subsys-top-bar {
  height: 4px;
  width: 100%;
}
.subsys-body { padding: 18px 18px 16px; }
.subsys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.subsys-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.subsys-id {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
}
.subsys-icon {
  font-size: 22px;
  opacity: 0.6;
}
.subsys-name {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.subsys-headline {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 12px;
  min-height: 38px;
}
.subsys-why {
  font-size: 11px;
  color: #64748B;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 6px;
  border-left: 2px solid rgba(15, 23, 42, 0.08);
  font-style: italic;
  margin-bottom: 12px;
  min-height: 50px;
}
.subsys-why-icon {
  font-size: 9px;
  color: #94A3B8;
  margin-right: 6px;
}
.subsys-foot {
  display: flex;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.06);
}
.subsys-phase {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
}

/* ── crosscut note ──────────────────────────────────── */
.crosscut-note {
  margin-top: 24px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.04));
  border: 1px dashed rgba(37, 99, 235, 0.30);
  border-radius: 12px;
}
.crosscut-note-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}

/* ═════════════════════════════════════════════════════
   Phase 路线图
   ═════════════════════════════════════════════════════ */
.phase-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phase-row {
  display: flex;
  align-items: center;
  gap: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  padding: 16px 22px;
  transition: all 0.2s ease;
}
.phase-row:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(15, 23, 42, 0.13);
  transform: translateX(2px);
}
.phase-row-current {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.06), rgba(37, 99, 235, 0.04));
  border-color: rgba(8, 145, 178, 0.28);
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.15);
}
.phase-row-main { flex: 1; min-width: 0; }
.phase-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.phase-row-name {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 13px;
  color: #0F172A;
  letter-spacing: 0.5px;
}
.phase-row-desc {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}
.phase-row-chip {
  margin-left: 4px;
}
.phase-row-detail {
  font-size: 11.5px;
  color: #64748B;
  margin-bottom: 10px;
}
.phase-row-bar {
  height: 5px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.phase-row-pct {
  display: flex;
  align-items: baseline;
  font-family: "JetBrains Mono", monospace;
  min-width: 70px;
  justify-content: flex-end;
}
.phase-row-pct-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.phase-row-pct-unit {
  font-size: 13px;
  color: #94A3B8;
  margin-left: 2px;
  font-weight: 600;
}

/* ═════════════════════════════════════════════════════
   知识库速览
   ═════════════════════════════════════════════════════ */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px) {
  .kb-grid { grid-template-columns: repeat(2, 1fr); }
}
.kb-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}
.kb-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -8px rgba(15, 23, 42, 0.14);
  border-color: rgba(8, 145, 178, 0.30);
}
.kb-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.kb-tile-body { flex: 1; min-width: 0; }
.kb-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.kb-tile-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.2px;
}
.kb-tile-badge {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 8px;
}
.kb-tile-desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.55;
}
.kb-tile-arrow {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 11px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}
.kb-tile:hover .kb-tile-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ═════════════════════════════════════════════════════
   差异表
   ═════════════════════════════════════════════════════ */
.diff-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.diff-table th {
  background: rgba(15, 23, 42, 0.025);
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  letter-spacing: 0.3px;
}
.diff-table th.th-highlight {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.06));
  color: #7C3AED;
}
.diff-table td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  color: #334155;
  vertical-align: top;
}
.diff-table tr:last-child td {
  border-bottom: none;
}
.diff-table td.td-dim {
  color: #64748B;
  font-weight: 600;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.02);
  width: 110px;
}
.diff-table td.td-highlight {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(37, 99, 235, 0.03));
  color: #0F172A;
  font-weight: 500;
}

/* ═════════════════════════════════════════════════════
   Footer
   ═════════════════════════════════════════════════════ */
.site-footer {
  margin-top: 24px;
  padding: 48px 40px 36px;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-col-title {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: #475569;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.footer-link {
  display: block;
  font-size: 12.5px;
  color: #64748B;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.15s ease;
}
.footer-link:hover { color: #0891B2; }
.footer-link-static {
  font-size: 12.5px;
  color: #94A3B8;
  margin-bottom: 8px;
}
.footer-brand-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0891B2, #2563EB);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  color: white;
  margin-right: 12px;
  letter-spacing: -1px;
}
.footer-brand {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
}
.footer-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
}
.footer-tagline {
  font-size: 12px;
  color: #64748B;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.4px;
}

/* ═════════════════════════════════════════════════════
   Chips
   ═════════════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.chip-success { background: rgba(5, 150, 105, 0.10); color: #059669; }
.chip-warning { background: rgba(217, 119, 6, 0.10); color: #D97706; }
.chip-danger  { background: rgba(220, 38, 38, 0.10); color: #DC2626; }
.chip-info    { background: rgba(8, 145, 178, 0.10); color: #0891B2; }
.chip-purple  { background: rgba(124, 58, 237, 0.10); color: #7C3AED; }
.chip-dim     { background: rgba(100, 116, 139, 0.10); color: #64748B; }

/* ═════════════════════════════════════════════════════
   Loading
   ═════════════════════════════════════════════════════ */
._dash-loading {
  color: #0891B2 !important;
}

/* ═══════════════════════════════════════════════════════════
   知识库 (Knowledge Base) - fixed sidebar
   ═══════════════════════════════════════════════════════════ */

.kb-layout {
  position: relative;
  min-height: calc(100vh - 56px);
}

.kb-side {
  position: fixed;
  top: 56px;
  left: 232px;
  bottom: 0;
  width: 264px;
  overflow-y: auto;
  padding: 20px 4px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  z-index: 50;
}

.kb-main {
  margin-left: 264px;
  padding: 32px 40px 56px;
  max-width: 1080px;
  min-width: 0;
}

.kb-tree {
  padding: 0 16px;
}
.kb-tree-section {
  margin-bottom: 22px;
}
.kb-tree-group {
  font-size: 11px;
  color: #475569;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 8px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 8px;
}
.kb-tree-item {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 12px;
  margin-bottom: 1px;
  transition: all 0.15s ease;
}
.kb-tree-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0F172A;
}
.kb-tree-item.active {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.15), rgba(37, 99, 235, 0.08));
  color: #0891B2;
  font-weight: 600;
  border-left: 2px solid #0891B2;
  padding-left: 8px;
}

/* Markdown 渲染区 */
.kb-md-content {
  color: #1E293B;
  line-height: 1.75;
  font-size: 14px;
}
.kb-md-content h1 {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #0891B2, transparent) 1;
  letter-spacing: -0.5px;
}
.kb-md-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0891B2;
  margin-top: 32px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid #0891B2;
}
.kb-md-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #2563EB;
  margin-top: 24px;
  margin-bottom: 10px;
}
.kb-md-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #7C3AED;
  margin-top: 18px;
  margin-bottom: 8px;
}
.kb-md-content p {
  margin: 10px 0;
  color: #334155;
}
.kb-md-content ul, .kb-md-content ol {
  margin: 10px 0;
  padding-left: 24px;
}
.kb-md-content li {
  margin: 4px 0;
  color: #334155;
}
.kb-md-content strong {
  color: #0F172A;
  font-weight: 700;
}
.kb-md-content em {
  color: #64748B;
  font-style: italic;
}
.kb-md-content code {
  background: rgba(8, 145, 178, 0.08);
  color: #0891B2;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  border: 1px solid rgba(8, 145, 178, 0.15);
}
.kb-md-content pre {
  background: #F8FAFC;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 14px 0;
}
.kb-md-content pre code {
  background: transparent;
  border: none;
  color: #1E293B;
  padding: 0;
}
.kb-md-content blockquote {
  border-left: 3px solid #0891B2;
  background: rgba(8, 145, 178, 0.06);
  padding: 12px 18px;
  margin: 14px 0;
  color: #334155;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}
.kb-md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12px;
}
.kb-md-content table th {
  background: linear-gradient(135deg, #0891B2, #2563EB);
  color: white;
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  border: 1px solid rgba(8, 145, 178, 0.3);
}
.kb-md-content table td {
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  vertical-align: top;
}
.kb-md-content table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}
.kb-md-content hr {
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  margin: 28px 0;
}
.kb-md-content a {
  color: #0891B2;
  text-decoration: none;
  border-bottom: 1px dashed rgba(8, 145, 178, 0.4);
}
.kb-md-content a:hover {
  border-bottom-style: solid;
}
.kb-md-content input[type="checkbox"] {
  margin-right: 6px;
  accent-color: #0891B2;
}

/* 知识库索引页内 glass-card 沿用浅色卡 */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.glass-card:hover {
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* ── 知识库索引页 micro-stat (复用) ───────────────── */
.micro-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
}
.micro-stat:last-child { border-bottom: none; }
.micro-stat .label { color: #64748B; }
.micro-stat .value {
  color: #0F172A;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}
.micro-stat .value.accent { color: #0891B2; }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-title { font-size: 40px; }
  .hero-section { padding: 48px 32px 40px; }
  .page-section { padding: 48px 32px; }
  .fact-row { grid-template-columns: repeat(2, 1fr); padding: 0 32px 40px; }
  .site-footer { padding: 36px 32px 28px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar-modern { display: none; }
  .hero-title { font-size: 32px; }
  .section-h2 { font-size: 24px; }
  .fact-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   v0.5 视觉强化 — 知识库索引 + 主页 + 卡片强对比
   解决"苍白模糊"问题: 深色锚点 + 强阴影 + 大数字 + 鲜色块
   ═══════════════════════════════════════════════════════════ */

/* ── 知识库 Hero 块 ───────────────────────────────────── */
.kb-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 60%, #2D1B69 100%);
  color: #F8FAFC;
  padding: 48px 40px 44px;
  border-radius: 20px;
  margin-bottom: 32px;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.35);
  position: relative;
  overflow: hidden;
}
.kb-hero::before {
  content: "";
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.45), transparent 70%);
  pointer-events: none;
}
.kb-hero::after {
  content: "";
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.35), transparent 70%);
  pointer-events: none;
}
.kb-hero > * { position: relative; z-index: 1; }

.kb-hero-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.kb-hero-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #67E8F9;
}
.kb-hero-version {
  font-size: 11px;
  color: #CBD5E1;
}
.kb-hero-title {
  font-size: 56px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -1px;
  line-height: 1.05;
}
.kb-hero-title > span:first-child {
  color: #F8FAFC !important;
}
.kb-hero-title .gradient-text {
  background: linear-gradient(135deg, #67E8F9 0%, #A78BFA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kb-hero-subtitle {
  font-size: 16px;
  color: #CBD5E1;
  margin: 0;
  max-width: 760px;
  line-height: 1.6;
}

/* ── 6 个入口卡 (3×2 网格, 强对比) ───────────────────── */
.kb-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.kb-entry-grid .glass-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  border-left-width: 6px !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  transition: all 0.18s ease !important;
  padding: 24px !important;
  text-decoration: none !important;
}
.kb-entry-grid .glass-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.15) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

/* ── 知识库统计卡 (大数字版) ─────────────────────────── */
.kb-stat-card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
}
.kb-section-title {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(15, 23, 42, 0.08);
  letter-spacing: 0.3px;
}
.kb-section-title i { color: #0891B2; }
.kb-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.kb-stat-item {
  text-align: center;
  padding: 8px 6px;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
}
.kb-stat-item:last-child { border-right: none; }
.kb-stat-num {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
  background: linear-gradient(180deg, currentColor 0%, currentColor 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.kb-stat-lbl {
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ── 强化主页 fact-card 和 subsystem 卡 ──────────────── */
.fact-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  border-top-width: 5px !important;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.08) !important;
  transition: all 0.18s ease;
}
.fact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.15) !important;
}
.fact-value {
  font-weight: 800 !important;
  font-size: 24px !important;
  letter-spacing: -0.5px;
  color: #0F172A !important;
}
.fact-label {
  color: #64748B !important;
  font-weight: 600 !important;
}

/* ── 主页 subsystem 卡片增强 ──────────────────────────── */
.subsystem-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  border-top-width: 4px !important;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.08) !important;
  transition: all 0.18s ease;
}
.subsystem-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.18) !important;
}

/* ── 章节标题强化 (主页/各页) ─────────────────────────── */
.section-h2 {
  font-weight: 800 !important;
  color: #0F172A !important;
  letter-spacing: -0.8px;
}
.section-h2-num {
  background: linear-gradient(135deg, #0891B2, #7C3AED) !important;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900 !important;
}

/* ── 响应式 ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .kb-entry-grid { grid-template-columns: 1fr; }
  .kb-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .kb-hero-title { font-size: 36px; }
}

/* ── 知识库 TREE 分组视觉强化 ───────────────────────── */
.kb-tree-group {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  padding: 14px 8px 8px !important;
  margin-top: 6px !important;
  border-bottom: 2px solid !important;
  border-image: linear-gradient(90deg, #0891B2 0%, transparent 60%) 1 !important;
}
.kb-tree-section:first-child .kb-tree-group {
  margin-top: 0 !important;
}
.kb-tree-item {
  padding: 5px 10px !important;
  font-size: 12px !important;
}
.kb-tree-item.active {
  background: linear-gradient(135deg, #0891B2 0%, #2563EB 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  border-left: 3px solid #0F172A !important;
  padding-left: 8px !important;
}

/* ═══════════════════════════════════════════════════════════
   v0.5.1 修复 (2026-05-13)
   1. 主侧栏 sticky → fixed (防止跟内容滚动)
   2. 配合 assets/scroll_preserve.js 修复 kb-side 点击重置
   ═══════════════════════════════════════════════════════════ */
.app-shell {
  display: block !important;          /* 取消 grid */
  grid-template-columns: none !important;
  padding-left: 232px;                /* 给 fixed sidebar 让位 */
  min-height: 100vh;
}
.sidebar-modern {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 232px;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 90;
}
.kb-side {
  left: 232px !important;
}
@media (max-width: 900px) {
  .app-shell { padding-left: 0; }
  .sidebar-modern { display: none; }
  .kb-side { left: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   v0.6 精修 (2026-05-14)
   ① 玻璃质感 + 阴影品牌化   ② S3 突出 + Phase 脉冲
   ④ 事实卡精修              ⑤ 字体排版微调
   ⑦ 知识库响应式 (手机/平板自适应)
   ═══════════════════════════════════════════════════════════ */

/* ── ⑤ 字体 / 排版微调 ───────────────────────────────── */

/* 数字位宽对齐 (BOM/价格/百分比等表格场景立刻显出来) */
.kpi-value, .fact-value, .phase-row-pct-num, .kb-stat-num,
.subsys-id, .micro-stat .value, .footer-meta, .topbar-version,
.kb-md-content td, .kb-md-content th, .phase-pill-name {
  font-variant-numeric: tabular-nums lining-nums;
}

/* 大标题多行均衡换行 (浏览器原生, 不支持的优雅降级) */
.hero-title, .section-h2, .kb-hero-title, .kb-md-content h1, .kb-md-content h2 {
  text-wrap: balance;
}

/* 中文字体 fallback 顺序优化: macOS → Linux → Windows → 系统默认 */
html, body, .kb-md-content {
  font-family: "Inter", "PingFang SC", "Source Han Sans SC",
               "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

/* ── ① 玻璃质感: inset 高光 + cyan-tinted shadow ──────── */

.glass-card,
.fact-card,
.subsys-card,
.kpi-card,
.phase-row,
.kb-tile,
.diff-card,
.kb-stat-card,
.kb-entry-grid .glass-card {
  /* 顶部 1px 白色 hairline, 模仿 macOS Big Sur 玻璃感 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 4px 14px -3px rgba(8, 145, 178, 0.06) !important;
}

.glass-card:hover,
.fact-card:hover,
.subsys-card:hover,
.kpi-card:hover,
.kb-tile:hover,
.kb-entry-grid .glass-card:hover {
  /* hover 阴影带 cyan 微染, 整体氛围品牌化 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 28px -8px rgba(8, 145, 178, 0.16),
    0 4px 12px -2px rgba(15, 23, 42, 0.06) !important;
  /* hover 抬升克制为 2px (旧版 3-4px) */
  transform: translateY(-2px) !important;
}

/* ── ② S3 真空冶金引擎 — 核心壁垒发光环 ─────────────── */

.subsys-grid > .subsys-card:nth-child(3) {
  /* S3 是网格第 3 个 */
  position: relative;
}
.subsys-grid > .subsys-card:nth-child(3)::after {
  content: "⭐ 护城河";
  position: absolute;
  top: 12px;
  right: -2px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #7C3AED, #DB2777);
  padding: 3px 10px 3px 12px;
  border-radius: 4px 0 0 4px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  z-index: 2;
}
.subsys-grid > .subsys-card:nth-child(3) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(124, 58, 237, 0.25),
    0 4px 16px -4px rgba(124, 58, 237, 0.20) !important;
}
.subsys-grid > .subsys-card:nth-child(3):hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(124, 58, 237, 0.45),
    0 16px 36px -8px rgba(124, 58, 237, 0.32) !important;
}

/* ── ② Phase 行 — 进行中脉冲点 + 进度条渐变 ───────────── */

.phase-row-current {
  position: relative;
  /* 进行中: 左侧加 cyan 高光条 */
  border-left: 3px solid #0891B2 !important;
  padding-left: 22px !important;
}
.phase-row-current::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0891B2;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.5);
  animation: phase-pulse 1.8s ease-out infinite;
}
@keyframes phase-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(8, 145, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0); }
}

/* Phase 进度条渐变填充 (取代单色) */
.phase-row-bar > div {
  background: linear-gradient(90deg,
              currentColor 0%,
              color-mix(in srgb, currentColor 70%, white) 100%) !important;
  /* color-mix 不支持时, 优雅降级到 currentColor 单色 */
}

/* ── ④ 工艺事实卡精修 — 顶部色渐变 + breathing icon ──── */

.fact-card {
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--fact-tint, transparent) 5%, #FFFFFF) 0%,
              #FFFFFF 60%) !important;
  position: relative;
  overflow: visible;
}
.fact-card > i[data-fact-icon] {
  animation: fact-icon-breath 5s ease-in-out infinite;
}
@keyframes fact-icon-breath {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}
/* 不同卡片用不同延迟, 避免同步像广告灯 */
.fact-card:nth-child(1) > i[data-fact-icon] { animation-delay: 0s; }
.fact-card:nth-child(2) > i[data-fact-icon] { animation-delay: 1s; }
.fact-card:nth-child(3) > i[data-fact-icon] { animation-delay: 2s; }
.fact-card:nth-child(4) > i[data-fact-icon] { animation-delay: 3s; }
.fact-card:nth-child(5) > i[data-fact-icon] { animation-delay: 4s; }

/* ── ② hero-btn-primary 加 hover 右箭头滑入 ─────────── */

.hero-btn-primary {
  position: relative;
  padding-right: 36px !important;
}
.hero-btn-primary::after {
  content: "→";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  opacity: 0;
  transition: all 0.22s ease;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.hero-btn-primary:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ═══════════════════════════════════════════════════════════
   ⑦ 知识库响应式 — 桌面 / 平板 / 手机自适应
   桌面 (>=1024px): 现状 (左 232 主侧栏 + 左 264 文档树 + 右内容)
   平板 (768-1024px): 主侧栏 -> 抽屉, 文档树仍 fixed
   手机 (<768px):    主侧栏 + 文档树都隐藏, 文档树改顶部折叠
   ═══════════════════════════════════════════════════════════ */

/* 默认 (>=900px) 现状保持 */

@media (max-width: 900px) {
  /* 主侧栏已 display:none (上方已定义) */
  /* 文档树仍 fixed 占左侧, 但要变窄, 给内容更多空间 */
  .kb-side {
    width: 220px !important;
    left: 0 !important;
  }
  .kb-main {
    margin-left: 220px !important;
    padding: 24px 24px 40px !important;
  }
}

@media (max-width: 768px) {
  /* 手机: 取消主壳 padding, 文档树改为顶部静态折叠区 */
  .app-shell { padding-left: 0 !important; }
  .topbar { padding: 0 16px !important; height: 52px !important; }
  .topbar-crumb-sub { display: none !important; }
  .topbar-version { display: none !important; }

  /* 知识库布局: 文档树从 fixed 改 static, 置于顶部, 可折叠 */
  .kb-layout {
    display: flex;
    flex-direction: column;
  }
  .kb-side {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: 240px;
    border-right: none !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    z-index: 10 !important;
    /* 默认显示, 用户可手动滚 (无 callback / JS) */
  }
  .kb-tree { padding: 0 !important; }
  .kb-tree-section { margin-bottom: 12px !important; }
  .kb-tree-group {
    font-size: 10px !important;
    padding: 6px 8px !important;
    margin-top: 4px !important;
  }
  .kb-tree-item {
    padding: 7px 10px !important;
    font-size: 12px !important;
    /* 触摸目标 >= 32px */
  }
  .kb-main {
    margin-left: 0 !important;
    padding: 20px 16px 40px !important;
    max-width: 100% !important;
  }

  /* Markdown 渲染区: 字号小一点 + 缩 padding */
  .kb-md-content { font-size: 14px; line-height: 1.7; }
  .kb-md-content h1 {
    font-size: 22px !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }
  .kb-md-content h2 {
    font-size: 17px !important;
    margin-top: 22px !important;
    padding-left: 10px !important;
  }
  .kb-md-content h3 { font-size: 15px !important; margin-top: 18px !important; }
  .kb-md-content h4 { font-size: 13.5px !important; }
  .kb-md-content p, .kb-md-content li { font-size: 13.5px; }
  .kb-md-content pre { padding: 10px 12px !important; font-size: 11.5px; }
  .kb-md-content code { font-size: 11.5px; }

  /* 表格在手机上横向滚动而非挤碎 */
  .kb-md-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 12px !important;
  }
  .kb-md-content table td, .kb-md-content table th {
    padding: 6px 10px !important;
    white-space: normal;
    min-width: 90px;
  }

  /* 内容卡片 padding 缩小 */
  .glass-card { padding: 16px !important; }
  .kb-main > div > .glass-card { padding: 18px 16px !important; }

  /* Hero/section 字号缩 */
  .hero-section { padding: 32px 20px 28px !important; }
  .hero-title { font-size: 28px !important; letter-spacing: -0.6px !important; }
  .hero-subtitle { font-size: 14px !important; }
  .hero-eyebrow { padding: 4px 10px !important; }
  .hero-eyebrow-text { font-size: 10px !important; letter-spacing: 1px !important; }
  .hero-eyebrow-sub { font-size: 10px !important; }
  .hero-eyebrow-sep { display: none; }
  .hero-deco { font-size: 160px !important; right: -30px !important; top: 10px !important; }
  .hero-cta-row { gap: 8px; }
  .hero-btn { padding: 9px 14px !important; font-size: 12px !important; }
  .hero-btn-primary { padding-right: 32px !important; }

  .page-section { padding: 32px 20px !important; scroll-margin-top: 64px; }
  .section-h2 { font-size: 22px !important; letter-spacing: -0.3px !important; }
  .section-lead { font-size: 13px !important; }
  .section-eyebrow { font-size: 10px !important; padding: 3px 8px !important; }

  .fact-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding: 0 20px 32px !important; }
  .fact-card { padding: 14px !important; }
  .fact-value { font-size: 17px !important; }
  .fact-label { font-size: 9px !important; }
  .fact-detail { font-size: 10px !important; }

  .subsys-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .subsys-body { padding: 14px !important; }
  .subsys-name { font-size: 14px !important; }
  .subsys-headline { font-size: 11.5px !important; min-height: 0 !important; }
  .subsys-why { font-size: 10.5px !important; min-height: 0 !important; padding: 6px 8px !important; }
  .subsys-grid > .subsys-card:nth-child(3)::after {
    font-size: 8px !important;
    padding: 2px 6px 2px 8px !important;
  }

  .phase-row { padding: 14px 16px !important; gap: 14px !important; }
  .phase-row-current { padding-left: 18px !important; }
  .phase-row-current::before { left: 5px !important; width: 7px; height: 7px; }
  .phase-row-name { font-size: 12px !important; }
  .phase-row-desc { font-size: 12px !important; }
  .phase-row-detail { font-size: 11px !important; }
  .phase-row-pct-num { font-size: 22px !important; }
  .phase-row-pct { min-width: 50px !important; }

  .kb-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .kb-tile { padding: 14px 16px !important; }
  .kb-tile-icon { width: 38px !important; height: 38px !important; font-size: 16px !important; }
  .kb-tile-title { font-size: 13.5px !important; }
  .kb-tile-desc { font-size: 11.5px !important; }

  .diff-table { font-size: 11px !important; }
  .diff-table td, .diff-table th { padding: 8px 10px !important; }
  .diff-table td.td-dim { width: auto !important; min-width: 70px; }

  .site-footer { padding: 28px 20px 20px !important; }
  .footer-grid { gap: 24px !important; }

  /* 知识库 hero (在 index 页) 缩小 */
  .kb-hero { padding: 28px 20px !important; border-radius: 14px !important; }
  .kb-hero-title { font-size: 28px !important; }
  .kb-hero-subtitle { font-size: 13px !important; }
  .kb-entry-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .kb-entry-grid .glass-card { padding: 16px !important; }
  .kb-stat-card { padding: 18px 16px !important; }
  .kb-stat-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
  .kb-stat-num { font-size: 28px !important; }
  .kb-stat-lbl { font-size: 10px !important; }
  .kb-stat-item { border-right: none !important; padding: 4px 0 !important; }
}

/* 超小屏 (<420px, 老手机) — 文档树更窄一点 */
@media (max-width: 420px) {
  .kb-side { max-height: 200px !important; padding: 10px 12px !important; }
  .kb-md-content h1 { font-size: 20px !important; }
  .hero-title { font-size: 24px !important; }
  .section-h2 { font-size: 20px !important; }
}

/* ── 触摸友好: 减小 hover transform 影响 (移动端无 hover) ── */
@media (hover: none) {
  .glass-card:hover, .fact-card:hover, .subsys-card:hover,
  .kpi-card:hover, .kb-tile:hover {
    transform: none !important;
  }
  .phase-row:hover { transform: none !important; }
  .hero-btn:hover { transform: none !important; }
}

/* ── 可见焦点环 (键盘可访问性) ────────────────────────── */
a:focus-visible, button:focus-visible,
.kb-tree-item:focus-visible, .nav-link-modern:focus-visible,
.hero-btn:focus-visible {
  outline: 2px solid #0891B2;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── 降低运动偏好 (用户设系统级 prefers-reduced-motion) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05s !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   C1 知识库站内搜索 (2026-05-14)
   ═══════════════════════════════════════════════════════════ */

.kb-search-form {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  padding: 4px 6px 4px 16px;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08);
  gap: 8px;
  max-width: 640px;
  transition: all 0.2s ease;
}
.kb-search-form:focus-within {
  border-color: rgba(8, 145, 178, 0.40);
  box-shadow: 0 6px 22px -4px rgba(8, 145, 178, 0.18);
}
.kb-search-icon {
  color: #94A3B8;
  font-size: 14px;
  flex-shrink: 0;
}
.kb-search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 14px;
  font-family: inherit;
  color: #0F172A;
  padding: 10px 4px !important;
  min-width: 0;
}
.kb-search-input::placeholder {
  color: #94A3B8;
}
.kb-search-btn {
  background: linear-gradient(135deg, #0891B2, #2563EB);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.kb-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(8, 145, 178, 0.4);
}

/* hero 内的搜索框 (深色背景, 玻璃感) */
.kb-hero .kb-search-hero {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.95);
  max-width: 600px;
  position: relative;
  z-index: 2;
}

/* 搜索结果列表 */
.kb-search-result {
  display: block;
  text-decoration: none;
  padding: 16px 20px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.kb-search-result:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.30);
  box-shadow: 0 8px 20px -6px rgba(8, 145, 178, 0.14);
}
.kb-search-group {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.5px;
}
.kb-search-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0F172A;
  margin: 2px 0 8px;
  letter-spacing: -0.2px;
}
.kb-search-snippet {
  font-size: 12px;
  color: #64748B;
  line-height: 1.55;
  font-family: "JetBrains Mono", monospace;
  background: rgba(15, 23, 42, 0.03);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid rgba(8, 145, 178, 0.30);
}

@media (max-width: 768px) {
  .kb-search-input { font-size: 13px !important; padding: 8px 4px !important; }
  .kb-search-btn { padding: 7px 14px !important; font-size: 12px !important; }
  .kb-search-form { padding: 3px 4px 3px 12px !important; }
  .kb-search-snippet { font-size: 11px !important; }
}

/* ═══════════════════════════════════════════════════════════
   C 类前端深化 (2026-05-14, v0.7)
   C2 浮动 TOC · C3 打印 · C5 暗色 · C6 代码高亮 · C7 最近阅读
   ═══════════════════════════════════════════════════════════ */

/* ── C7 最近阅读 (KB 首页 hero 内) ──────────────────────── */
.recent-reads {
  margin-top: 18px;
  position: relative;
  z-index: 2;
  min-height: 28px;
}
.recent-reads .recent-title {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
}
.recent-reads .recent-title i {
  margin-right: 6px;
  font-size: 11px;
}
.recent-reads .recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.recent-reads .recent-chip {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #F8FAFC;
  text-decoration: none;
  font-size: 11.5px;
  transition: all 0.15s ease;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-reads .recent-chip:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.40);
  transform: translateY(-1px);
}
.recent-reads .recent-empty {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

/* ── C2 浮动 TOC (右侧, 仅文档页 >= 1280px 显示) ─────── */
.kb-toc {
  position: fixed;
  right: 24px;
  top: 88px;
  width: 220px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 18px -6px rgba(15, 23, 42, 0.10);
  z-index: 80;
  font-size: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.kb-toc-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #64748B;
  text-transform: uppercase;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kb-toc-title i { color: #0891B2; }
.kb-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.kb-toc-list li {
  margin: 0;
  padding: 0;
}
.kb-toc-list a {
  display: block;
  padding: 4px 8px;
  color: #475569;
  text-decoration: none;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.45;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.kb-toc-list a:hover {
  background: rgba(8, 145, 178, 0.06);
  color: #0F172A;
}
.kb-toc-list a.active {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.10), transparent);
  color: #0891B2;
  border-left-color: #0891B2;
  font-weight: 600;
}
.kb-toc-l3 a {
  padding-left: 18px;
  font-size: 11.5px;
  color: #64748B;
}

/* 视口窄时隐藏 (避免和内容打架) */
@media (max-width: 1280px) {
  .kb-toc { display: none; }
}

/* ── 主题切换按钮 (C5) ────────────────────────────────── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.7);
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
}
.theme-toggle:hover {
  border-color: rgba(8, 145, 178, 0.35);
  color: #0891B2;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}
.theme-toggle[data-mode="dark"]  { color: #7C3AED; }
.theme-toggle[data-mode="light"] { color: #D97706; }
.theme-toggle[data-mode="auto"]  { color: #475569; }

/* ═══════════════════════════════════════════════════════════
   C5 · 暗色主题 [data-theme="dark"] 覆盖层
   ═══════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background: #0B1220;
  color: #E2E8F0;
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 600px at 18% -5%, rgba(8, 145, 178, 0.14), transparent 60%),
    radial-gradient(700px 500px at 85% 0%, rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(600px 400px at 95% 60%, rgba(37, 99, 235, 0.08), transparent 60%);
}
html[data-theme="dark"] body::after {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
}

/* 卡片 / 容器 */
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .fact-card,
html[data-theme="dark"] .subsys-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .phase-row,
html[data-theme="dark"] .kb-tile,
html[data-theme="dark"] .diff-card,
html[data-theme="dark"] .kb-stat-card,
html[data-theme="dark"] .kb-search-result {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 14px -3px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .glass-card:hover,
html[data-theme="dark"] .fact-card:hover,
html[data-theme="dark"] .subsys-card:hover,
html[data-theme="dark"] .kb-tile:hover,
html[data-theme="dark"] .kb-entry-grid .glass-card:hover {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(8, 145, 178, 0.40) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px -8px rgba(8, 145, 178, 0.28) !important;
}

/* 主侧栏 */
html[data-theme="dark"] .sidebar-modern {
  background: rgba(15, 23, 42, 0.92) !important;
  border-right-color: rgba(148, 163, 184, 0.12) !important;
}
html[data-theme="dark"] .nav-link-modern { color: #94A3B8; }
html[data-theme="dark"] .nav-link-modern:hover { background: rgba(148, 163, 184, 0.08); color: #E2E8F0; }
html[data-theme="dark"] .nav-link-modern.active {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.22), rgba(37, 99, 235, 0.14)) !important;
  color: #67E8F9 !important;
}
html[data-theme="dark"] .nav-link-modern .nav-badge {
  background: rgba(148, 163, 184, 0.10);
  color: #94A3B8;
}

/* 顶部条 */
html[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.78) !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}
html[data-theme="dark"] .topbar-crumb-main { color: #E2E8F0; }
html[data-theme="dark"] .topbar-crumb-sub { color: #94A3B8; }
html[data-theme="dark"] .phase-pill {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.16), rgba(37, 99, 235, 0.12)) !important;
  border-color: rgba(8, 145, 178, 0.40) !important;
}
html[data-theme="dark"] .phase-pill-name { color: #67E8F9; }
html[data-theme="dark"] .phase-pill-desc { color: #CBD5E1; }
html[data-theme="dark"] .theme-toggle {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.18);
  color: #CBD5E1;
}
html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(148, 163, 184, 0.20);
  color: #67E8F9;
}

/* Hero / sections 文字 */
html[data-theme="dark"] .hero-title-soft,
html[data-theme="dark"] .hero-subtitle,
html[data-theme="dark"] .hero-subtitle b { color: #E2E8F0; }
html[data-theme="dark"] .hero-eyebrow {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(8, 145, 178, 0.35);
}
html[data-theme="dark"] .hero-eyebrow-sub { color: #CBD5E1; }
html[data-theme="dark"] .section-h2 { color: #F1F5F9 !important; }
html[data-theme="dark"] .section-lead { color: #94A3B8 !important; }
html[data-theme="dark"] .section-eyebrow { background: rgba(8, 145, 178, 0.16); }
html[data-theme="dark"] .hero-btn-ghost {
  background: rgba(30, 41, 59, 0.7);
  color: #CBD5E1;
  border-color: rgba(148, 163, 184, 0.20);
}
html[data-theme="dark"] .hero-btn-ghost:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #67E8F9;
  border-color: rgba(8, 145, 178, 0.45);
}

/* 子系统卡内文字 */
html[data-theme="dark"] .subsys-name,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .fact-value,
html[data-theme="dark"] .kb-tile-title,
html[data-theme="dark"] .kb-stat-num { color: #F1F5F9 !important; }
html[data-theme="dark"] .subsys-headline,
html[data-theme="dark"] .subsys-why,
html[data-theme="dark"] .kb-tile-desc,
html[data-theme="dark"] .fact-detail,
html[data-theme="dark"] .kb-stat-lbl { color: #94A3B8; }
html[data-theme="dark"] .subsys-why { background: rgba(148, 163, 184, 0.06); border-left-color: rgba(148, 163, 184, 0.16); }
html[data-theme="dark"] .subsys-foot { border-top-color: rgba(148, 163, 184, 0.10); }
html[data-theme="dark"] .kb-tile-badge { background: rgba(148, 163, 184, 0.10); color: #94A3B8; }

/* 表格 */
html[data-theme="dark"] .kb-md-content,
html[data-theme="dark"] .kb-md-content p,
html[data-theme="dark"] .kb-md-content li { color: #CBD5E1; }
html[data-theme="dark"] .kb-md-content h1 { color: #F1F5F9; }
html[data-theme="dark"] .kb-md-content h2 { color: #67E8F9; border-left-color: #67E8F9; }
html[data-theme="dark"] .kb-md-content h3 { color: #93C5FD; }
html[data-theme="dark"] .kb-md-content h4 { color: #A78BFA; }
html[data-theme="dark"] .kb-md-content strong { color: #F1F5F9; }
html[data-theme="dark"] .kb-md-content em { color: #94A3B8; }
html[data-theme="dark"] .kb-md-content code {
  background: rgba(8, 145, 178, 0.20);
  color: #67E8F9;
  border-color: rgba(8, 145, 178, 0.30);
}
html[data-theme="dark"] .kb-md-content pre {
  background: #0F172A;
  border-color: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .kb-md-content pre code { color: #E2E8F0; }
html[data-theme="dark"] .kb-md-content blockquote {
  background: rgba(8, 145, 178, 0.10);
  color: #CBD5E1;
}
html[data-theme="dark"] .kb-md-content table th {
  background: linear-gradient(135deg, #0891B2, #2563EB);
}
html[data-theme="dark"] .kb-md-content table td { color: #CBD5E1; border-color: rgba(148, 163, 184, 0.12); }
html[data-theme="dark"] .kb-md-content table tr:nth-child(even) td { background: rgba(148, 163, 184, 0.04); }
html[data-theme="dark"] .kb-md-content hr { border-top-color: rgba(148, 163, 184, 0.16); }
html[data-theme="dark"] .kb-md-content a { color: #67E8F9; }

/* KB 左侧文档树 */
html[data-theme="dark"] .kb-side {
  background: rgba(15, 23, 42, 0.78) !important;
  border-right-color: rgba(148, 163, 184, 0.12) !important;
}
html[data-theme="dark"] .kb-tree-group { color: #E2E8F0 !important; border-bottom-color: rgba(148, 163, 184, 0.12) !important; }
html[data-theme="dark"] .kb-tree-item { color: #94A3B8 !important; }
html[data-theme="dark"] .kb-tree-item:hover { background: rgba(148, 163, 184, 0.08) !important; color: #E2E8F0 !important; }
html[data-theme="dark"] .kb-tree-item.active {
  background: linear-gradient(135deg, #0891B2 0%, #2563EB 100%) !important;
  color: #FFFFFF !important;
  border-left-color: #67E8F9 !important;
}

/* 搜索 */
html[data-theme="dark"] .kb-search-form {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}
html[data-theme="dark"] .kb-search-input { color: #F1F5F9 !important; }
html[data-theme="dark"] .kb-search-input::placeholder { color: #64748B; }
html[data-theme="dark"] .kb-search-snippet {
  background: rgba(8, 145, 178, 0.08);
  color: #94A3B8;
}

/* TOC */
html[data-theme="dark"] .kb-toc {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .kb-toc-title { color: #94A3B8; border-bottom-color: rgba(148, 163, 184, 0.12); }
html[data-theme="dark"] .kb-toc-list a { color: #94A3B8; }
html[data-theme="dark"] .kb-toc-list a:hover { background: rgba(148, 163, 184, 0.08); color: #E2E8F0; }
html[data-theme="dark"] .kb-toc-list a.active {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.18), transparent);
  color: #67E8F9;
  border-left-color: #67E8F9;
}

/* Phase rows */
html[data-theme="dark"] .phase-row { background: rgba(30, 41, 59, 0.7) !important; border-color: rgba(148, 163, 184, 0.12) !important; }
html[data-theme="dark"] .phase-row-name,
html[data-theme="dark"] .phase-row-desc { color: #F1F5F9; }
html[data-theme="dark"] .phase-row-detail { color: #94A3B8; }
html[data-theme="dark"] .phase-row-bar { background: rgba(148, 163, 184, 0.10); }
html[data-theme="dark"] .phase-row-current {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.18), rgba(37, 99, 235, 0.10)) !important;
  border-color: rgba(8, 145, 178, 0.45) !important;
}

/* Footer */
html[data-theme="dark"] .site-footer { background: rgba(15, 23, 42, 0.5); border-top-color: rgba(148, 163, 184, 0.12); }
html[data-theme="dark"] .footer-col-title { color: #CBD5E1; }
html[data-theme="dark"] .footer-link { color: #94A3B8; }
html[data-theme="dark"] .footer-link:hover { color: #67E8F9; }
html[data-theme="dark"] .footer-link-static { color: #64748B; }
html[data-theme="dark"] .footer-brand { color: #F1F5F9; }
html[data-theme="dark"] .footer-tagline { color: #94A3B8; }

/* Diff table */
html[data-theme="dark"] .diff-table th { background: rgba(148, 163, 184, 0.06); color: #94A3B8; border-bottom-color: rgba(148, 163, 184, 0.14); }
html[data-theme="dark"] .diff-table td { color: #CBD5E1; border-bottom-color: rgba(148, 163, 184, 0.10); }
html[data-theme="dark"] .diff-table td.td-dim { background: rgba(148, 163, 184, 0.04); color: #94A3B8; }
html[data-theme="dark"] .diff-table td.td-highlight { background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(37, 99, 235, 0.06)); color: #F1F5F9; }

/* Chips */
html[data-theme="dark"] .chip-dim { background: rgba(148, 163, 184, 0.14); color: #CBD5E1; }
html[data-theme="dark"] .chip-success { background: rgba(5, 150, 105, 0.20); color: #6EE7B7; }
html[data-theme="dark"] .chip-warning { background: rgba(217, 119, 6, 0.20); color: #FCD34D; }
html[data-theme="dark"] .chip-danger { background: rgba(220, 38, 38, 0.20); color: #FCA5A5; }
html[data-theme="dark"] .chip-info { background: rgba(8, 145, 178, 0.20); color: #67E8F9; }
html[data-theme="dark"] .chip-purple { background: rgba(124, 58, 237, 0.20); color: #C4B5FD; }

/* 滚动条 */
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.42); }

/* 最近阅读 chip 在暗色下用更白的字 */
html[data-theme="dark"] .recent-reads .recent-chip { color: #F1F5F9; }

/* ═══════════════════════════════════════════════════════════
   C6 · 代码高亮 (highlight.js GitHub 主题 -> 项目化定制)
   暗色用 GitHub Dark, 浅色用默认 GitHub
   ═══════════════════════════════════════════════════════════ */

.kb-md-content pre code.hljs {
  display: block;
  padding: 0;
  background: transparent !important;
  border: 0;
  font-size: 12.5px;
  line-height: 1.55;
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
}
/* 暗色主题下用 hljs 暗色调色板 */
html[data-theme="dark"] .hljs              { color: #E2E8F0; background: transparent; }
html[data-theme="dark"] .hljs-comment,
html[data-theme="dark"] .hljs-quote        { color: #64748B; font-style: italic; }
html[data-theme="dark"] .hljs-keyword,
html[data-theme="dark"] .hljs-selector-tag,
html[data-theme="dark"] .hljs-subst        { color: #F472B6; }
html[data-theme="dark"] .hljs-number,
html[data-theme="dark"] .hljs-literal      { color: #FCD34D; }
html[data-theme="dark"] .hljs-string,
html[data-theme="dark"] .hljs-doctag       { color: #6EE7B7; }
html[data-theme="dark"] .hljs-title,
html[data-theme="dark"] .hljs-section,
html[data-theme="dark"] .hljs-selector-id  { color: #67E8F9; font-weight: 700; }
html[data-theme="dark"] .hljs-type,
html[data-theme="dark"] .hljs-class .hljs-title  { color: #93C5FD; }
html[data-theme="dark"] .hljs-tag,
html[data-theme="dark"] .hljs-name,
html[data-theme="dark"] .hljs-attribute    { color: #A78BFA; }
html[data-theme="dark"] .hljs-built_in,
html[data-theme="dark"] .hljs-builtin-name { color: #FBB6CE; }

/* ═══════════════════════════════════════════════════════════
   C3 · 打印样式 (@media print)
   把 SOP / 考核点速查 / PFMEA 等内容打印到 A4 纸贴车间
   ═══════════════════════════════════════════════════════════ */

@media print {
  /* 颜色还原: 强制白底黑字 (节省墨, 提高可读性) */
  :root, html[data-theme="dark"], html, body {
    background: #FFFFFF !important;
    color: #000000 !important;
    color-scheme: light !important;
  }
  body::before, body::after { display: none !important; }

  /* 隐藏: 导航 / 顶部条 / 侧栏 / 搜索 / 主题切换 / TOC / footer 等 */
  .sidebar-modern,
  .topbar,
  .kb-side,
  .kb-search-form,
  .kb-search-hero,
  .theme-toggle,
  .kb-toc,
  .site-footer,
  .hero-cta-row,
  .hero-deco,
  .recent-reads,
  .crosscut-note,
  ._dash-loading,
  .nav-link-modern,
  .phase-pill,
  .topbar-version,
  .kb-tile-arrow {
    display: none !important;
  }

  /* 主容器全宽 */
  .app-shell { padding-left: 0 !important; }
  .kb-main, .main-content {
    margin: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .glass-card, .kb-stat-card, .diff-card {
    background: transparent !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    padding: 10px 12px !important;
    page-break-inside: avoid;
  }

  /* 字号 / 行高 (A4 友好) */
  body, p, li, td, th { font-size: 11pt !important; line-height: 1.5 !important; }
  .kb-md-content h1 { font-size: 18pt !important; }
  .kb-md-content h2 { font-size: 14pt !important; }
  .kb-md-content h3 { font-size: 12pt !important; }
  .kb-md-content h4 { font-size: 11pt !important; }
  .kb-md-content { color: #000 !important; }
  .kb-md-content h1, .kb-md-content h2, .kb-md-content h3 { color: #000 !important; }
  .kb-md-content code, .kb-md-content pre { background: #F1F5F9 !important; color: #000 !important; }
  .kb-md-content blockquote { background: #F8FAFC !important; color: #000 !important; border-left: 3px solid #475569 !important; }

  /* 表格 */
  .kb-md-content table, .diff-table {
    border-collapse: collapse !important;
    width: 100% !important;
    page-break-inside: auto;
  }
  .kb-md-content table th, .diff-table th {
    background: #E2E8F0 !important;
    color: #000 !important;
    border: 1px solid #94A3B8 !important;
  }
  .kb-md-content table td, .diff-table td {
    border: 1px solid #CBD5E1 !important;
    color: #000 !important;
    background: #FFFFFF !important;
  }
  .kb-md-content table tr, .diff-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  thead { display: table-header-group; } /* 表头每页重复 */

  /* 链接显 URL (打印纸上仍能查) */
  .kb-md-content a[href^="/knowledge"]:after {
    content: " (" attr(href) ")";
    color: #64748B;
    font-size: 9pt;
    font-family: "JetBrains Mono", monospace;
  }
  .kb-md-content a[href^="http"]:after {
    content: " (" attr(href) ")";
    color: #64748B;
    font-size: 9pt;
    font-family: "JetBrains Mono", monospace;
  }
  /* 内部锚点不显 */
  .kb-md-content a[href^="#"]:after { content: none; }

  /* 图片不分页 */
  img, svg, figure { page-break-inside: avoid; max-width: 100% !important; }

  /* Hero / sections (主页) 简化 */
  .hero-section { padding: 12pt 0 !important; }
  .hero-title { font-size: 24pt !important; color: #000 !important; }
  .hero-subtitle { font-size: 11pt !important; color: #000 !important; }
  .section-h2 { color: #000 !important; }

  /* 页眉页脚 (浏览器原生) */
  @page {
    margin: 18mm 14mm 18mm 14mm;
  }
  @page :first {
    margin-top: 24mm;
  }
}

/* ═══════════════════════════════════════════════════════════
   响应式适配 (C2 TOC 在窄屏隐藏已上面定义)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* 文档页面右侧空间不够, TOC 不显 (已 1280px 隐藏); 主题切换缩小 */
  .theme-toggle { width: 28px; height: 28px; font-size: 12px; }
  .recent-reads { margin-top: 14px; }
  .recent-reads .recent-chip { max-width: 180px; font-size: 11px; padding: 4px 10px; }
}
