/* PODSAI 浅色研报风 — 工程图纸感 */
:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-surface-2: #f5f5f4;
  --color-text: #1c1917;
  --color-text-muted: #78716c;
  --color-text-faint: #a8a29e;

  --color-primary: #b91c1c;
  --color-primary-hover: #991b1b;
  --color-primary-highlight: #fef2f2;

  --color-blue: #1d4ed8;
  --color-orange: #ea580c;
  --color-success: #15803d;
  --color-warning: #a16207;

  --color-border: #d6d3d1;
  --color-divider: #e7e5e4;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --panel-w: 332px;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-divider);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: .2px;
  white-space: nowrap;
  text-decoration: none; color: inherit;
}
.home-link {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .4px;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm, .5rem);
  white-space: nowrap;
  transition: all 160ms ease;
}
.home-link:hover {
  color: var(--color-primary, #b91c1c);
  border-color: var(--color-primary, #b91c1c);
}
.brand svg { display: block; }
.brand .sub {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .8px;
  color: var(--color-text-faint);
  text-transform: uppercase;
}
.title-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.title-wrap .main { font-size: 15px; font-weight: 600; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
  font-size: 13px;
  flex-wrap: nowrap;
}
.crumb {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer; background: none;
  font-family: var(--font-body); font-size: 13px;
  transition: all .15s ease;
  white-space: nowrap;
}
.crumb .lv {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--color-text-faint);
}
.crumb:hover:not(.active):not(:disabled) {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.crumb.active {
  background: var(--color-primary-highlight);
  border-color: #fecaca;
  color: var(--color-primary);
  font-weight: 600;
}
.crumb.active .lv { color: var(--color-primary); }
.crumb:disabled { opacity: .45; cursor: default; }
.crumb-sep { color: var(--color-text-faint); font-size: 12px; }

/* ---------- Stage ---------- */
.stage {
  position: fixed;
  top: 60px; left: 0; bottom: 0;
  right: var(--panel-w);
  background: var(--color-bg);
}
.scene-canvas { display: block; width: 100%; height: 100%; }
.svg-host { position: absolute; inset: 0; display: none; }
.svg-host.active { display: block; }
/* N2 路线对比：整页滚动 */
.svg-host.scroll-mode { overflow-y: auto; overflow-x: hidden; background: var(--color-bg); }

/* loading */
.loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  background: var(--color-bg); z-index: 5;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--color-text-muted); letter-spacing: 1px;
}
.loader.hidden { display: none; }
.spin {
  width: 26px; height: 26px;
  border: 2.5px solid var(--color-divider);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tooltip / hotspot labels ---------- */
.hotspot-label {
  position: absolute;
  transform: translate(-50%, -130%);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(28, 25, 23, 0.9);
  color: #fff;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 12;
}
.hotspot-label.show { opacity: 1; }

/* ---------- Legend + controls (bottom-left) ---------- */
.controls {
  position: absolute; left: 16px; bottom: 16px; z-index: 14;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 230px;
}
.legend {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 11.5px;
}
.legend h4 {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .6px; text-transform: uppercase;
  color: var(--color-text-faint); margin-bottom: 7px;
  font-weight: 500;
}
.legend-item { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--color-text-muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.hot { background: var(--color-primary); box-shadow: 0 0 0 3px rgba(185,28,28,.18); }
.dot.drill { background: var(--color-blue); }
.btn-row { display: flex; gap: 8px; }
.ctl-btn {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-body); font-size: 12px;
  color: var(--color-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow);
  transition: all .15s ease;
}
.ctl-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ctl-btn svg { width: 14px; height: 14px; }

/* hint top-left of stage */
.stage-hint {
  position: absolute; left: 16px; top: 14px; z-index: 13;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--color-text-faint);
  background: rgba(250,250,249,.7);
  padding: 4px 9px; border-radius: 5px;
  letter-spacing: .3px;
}

/* ---------- Info panel ---------- */
.panel {
  position: fixed; top: 60px; right: 0; bottom: 0;
  width: var(--panel-w);
  background: var(--color-surface);
  border-left: 1px solid var(--color-divider);
  z-index: 20;
  display: flex; flex-direction: column;
}
.panel-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--color-divider);
}
.panel-head .eyebrow {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px;
}
.panel-head .eyebrow .lvtag {
  background: var(--color-primary-highlight);
  border: 1px solid #fecaca; border-radius: 4px;
  padding: 1px 6px; color: var(--color-primary);
}
.panel-head h2 {
  font-family: var(--font-display); font-size: 25px;
  line-height: 1.15; font-weight: 400;
}
.panel-head .en {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--color-text-faint); margin-top: 4px; letter-spacing: .4px;
}
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.panel-intro {
  font-size: 13.5px; line-height: 1.7; color: var(--color-text-muted);
}

.sect-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 22px 0 11px; padding-top: 16px;
  border-top: 1px dashed var(--color-divider);
  display: flex; align-items: center; gap: 7px;
}
.sect-label:first-child { border-top: none; padding-top: 0; margin-top: 4px; }

/* part card */
.card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 16px 16px 17px;
  animation: cardIn .35s cubic-bezier(.16,1,.3,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card h3 {
  font-size: 15.5px; font-weight: 650; line-height: 1.35;
  display: flex; align-items: flex-start; gap: 8px;
}
.card h3 .marker {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary); flex: none; margin-top: 6px;
  box-shadow: 0 0 0 3px rgba(185,28,28,.16);
}
.card .role {
  font-size: 13px; line-height: 1.65; color: var(--color-text-muted);
  margin-top: 9px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: all .15s ease;
}
.chip .tk { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--color-text); }
.chip .nm { font-size: 10.5px; color: var(--color-text-faint); }
.chip:hover { border-color: var(--color-primary); background: var(--color-primary-highlight); }

/* 可点击 chip（链到 PODSAI 个股页）*/
a.chip-link { text-decoration: none; position: relative; padding-right: 22px; cursor: pointer; }
a.chip-link .chip-go {
  position: absolute; top: 5px; right: 7px;
  font-size: 10px; line-height: 1; color: var(--color-text-faint);
  transition: color .15s ease;
}
a.chip-link:hover { border-color: var(--color-primary); background: var(--color-primary-highlight); }
a.chip-link:hover .chip-go { color: var(--color-primary); }
a.chip-link.rt-up:hover { border-color: #15803d; background: #f0fdf4; }
a.chip-link.rt-up:hover .chip-go { color: #15803d; }
a.chip-link.rt-down:hover .chip-go { color: var(--color-primary); }

/* 环节定价逻辑（intro 面板）*/
.pricing-box {
  margin-top: 14px; padding: 11px 13px;
  background: #f8fafc;
  border: 1px solid var(--color-divider);
  border-left: 3px solid var(--color-blue, #1d4ed8);
  border-radius: var(--radius-sm);
}
.pricing-label {
  display: inline-block; margin-bottom: 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600; color: var(--color-blue, #1d4ed8);
}
.pricing-box p { font-size: 12px; line-height: 1.6; color: var(--color-text-muted); margin: 0; }

/* 价值量标签（热点卡片）*/
.value-tag {
  margin-top: 12px; padding: 8px 11px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.55; color: var(--color-text-muted);
}
.value-tag .value-k {
  display: inline-block; margin-right: 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .05em; color: var(--color-orange, #ea580c);
}

.view {
  margin-top: 15px; padding: 12px 14px;
  background: var(--color-primary-highlight);
  border: 1px solid #fecaca;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.6;
  color: #7f1d1d;
}
.drill-btn {
  margin-top: 15px; width: 100%;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 12px; font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s ease;
}
.drill-btn:hover { background: var(--color-primary-hover); }
.drill-btn svg { width: 16px; height: 16px; }

.empty-hint {
  margin-top: 20px; padding: 16px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: 12.5px; line-height: 1.6; color: var(--color-text-faint);
  text-align: center;
}

/* L4-only zoom controls (overlap with controls bottom-left handled via JS) */
.zoom-tools {
  position: absolute; right: 16px; bottom: 16px; z-index: 14;
  display: none; flex-direction: column; gap: 6px;
}
.zoom-tools.active { display: flex; }
.zoom-tools button {
  width: 38px; height: 38px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 18px;
  color: var(--color-text); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.zoom-tools button:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* mobile drawer toggle */
.drawer-toggle { display: none; }

/* ---------- 双分支面包屑 ---------- */
.branch-choices { display: inline-flex; align-items: center; gap: 6px; }
.crumb.branch-entry .lv {
  border-radius: 3px; padding: 0 3px;
}
.crumb.branch-entry.compute .lv { color: var(--color-primary); }
.crumb.branch-entry.network .lv { color: var(--color-blue); }
.crumb.branch-entry.network:hover:not(.active) { background: #eff6ff; color: var(--color-blue); }
.crumb.branch-label {
  color: var(--color-text-muted); font-weight: 600;
  background: var(--color-surface-2);
}
.crumb.branch-label:hover { color: var(--color-text); }

/* ---------- N2 路线卡片（右侧面板）---------- */
.route-card h3 { font-size: 16px; }
.rt-keyrow {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 14px;
}
.rt-key {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.rt-key span { font-size: 10px; color: var(--color-text-faint); font-family: var(--font-mono); letter-spacing: .3px; }
.rt-key b { font-size: 13px; font-family: var(--font-mono); color: var(--color-text); }
.chip.rt-up { background: #f0fdf4; border-color: #bbf7d0; }
.chip.rt-up .tk { color: #15803d; }
.chip.rt-down { background: #fef2f2; border-color: #fecaca; }
.chip.rt-down .tk { color: var(--color-primary); }

/* ---------- N2 路线对比主体 ---------- */
.rc-root {
  max-width: 1080px; margin: 0 auto;
  padding: 26px 28px 60px;
  font-family: var(--font-body); color: var(--color-text);
}
.rc-head h2 {
  font-family: var(--font-display); font-size: 27px; font-weight: 400;
  line-height: 1.2; margin-bottom: 10px;
}
.rc-head p { font-size: 13.5px; line-height: 1.7; color: var(--color-text-muted); max-width: 880px; }
.rc-flow { font-family: var(--font-mono); font-size: 12.5px; color: var(--color-primary); font-weight: 600; }

.rc-sect-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--color-text-faint);
  margin: 34px 0 14px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--color-divider);
}

/* 四列剖面图 */
.rc-cols {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 22px;
}
.rc-col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--rc-accent);
  border-radius: var(--radius-md);
  padding: 14px 13px 13px;
  cursor: pointer; transition: all .18s ease;
  display: flex; flex-direction: column;
}
.rc-col:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.rc-col.active { box-shadow: 0 0 0 2px var(--rc-accent), var(--shadow); }
.rc-col-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.rc-col-idx {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.rc-col-titles { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rc-col-name { font-size: 14px; font-weight: 650; }
.rc-col-sub { font-size: 10.5px; color: var(--color-text-faint); font-family: var(--font-mono); }
.rc-section-svg { width: 100%; height: auto; aspect-ratio: 240 / 188; display: block; margin: 4px 0 10px; border-radius: var(--radius-sm); }
/* N2 路线对比模式：隐藏 3D 专用图例与提示，避免遮挡滚动内容 */
.stage.n2-mode .controls,
.stage.n2-mode .stage-hint { display: none; }
/* L4 tab 容器占据顶部，隐藏会碍事的 stage-hint 与 3D 图例（保留重置/缩放按钮） */
.stage.l4-mode .stage-hint { display: none; }
.stage.l4-mode .legend { display: none; }
.stage.l4-mode .controls { display: none; }

.rc-chipwrap { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.rc-chip-row { display: flex; align-items: flex-start; gap: 7px; }
.rc-chip-lbl {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; flex: none; margin-top: 1px;
  letter-spacing: .3px;
}
.rc-chip-lbl.rc-up { background: #f0fdf4; color: #15803d; }
.rc-chip-lbl.rc-down { background: #fef2f2; color: var(--color-primary); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-chip {
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--color-border); background: var(--color-surface-2);
  color: var(--color-text-muted); white-space: nowrap;
}
.rc-chip.up { border-color: #bbf7d0; }
.rc-chip.down { border-color: #fecaca; }
.rc-more {
  margin-top: 11px; width: 100%;
  background: none; border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm); padding: 7px;
  font-family: var(--font-body); font-size: 11.5px; color: var(--color-text-muted);
  cursor: pointer; transition: all .15s ease;
}
.rc-more:hover { border-color: var(--rc-accent); color: var(--rc-accent); border-style: solid; }

/* 对比表 */
.rc-table-scroll { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.rc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.rc-table th, .rc-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--color-divider); }
.rc-table thead th {
  background: var(--color-surface-2); font-size: 12px; font-weight: 650;
  white-space: nowrap; position: sticky; top: 0;
}
.rc-th-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--rc-accent); margin-right: 6px; }
.rc-th-row, .rc-row-lbl {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-muted);
  white-space: nowrap; background: var(--color-surface);
}
.rc-row-lbl { font-weight: 600; }
.rc-num { font-family: var(--font-mono); font-size: 12px; color: var(--color-text); }
.rc-table tbody tr:hover td { background: #fafaf9; }
.rc-src-note { font-size: 11px; color: var(--color-text-faint); margin-top: 9px; font-style: italic; }

/* 核心分歧框 */
.rc-debate {
  margin-top: 36px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  padding: 18px 20px 20px;
}
.rc-debate-title {
  font-family: var(--font-display); font-size: 19px; color: var(--color-primary);
  margin-bottom: 14px;
}
.rc-debate-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center;
}
.rc-debate-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px 16px; }
.rc-debate-card.nv { border-top: 3px solid #15803d; }
.rc-debate-card.sa { border-top: 3px solid var(--color-primary); }
.rc-debate-h { font-size: 13.5px; font-weight: 650; margin-bottom: 9px; }
.rc-debate-card.nv .rc-debate-h { color: #15803d; }
.rc-debate-card.sa .rc-debate-h { color: var(--color-primary); }
.rc-debate-card ul { list-style: none; }
.rc-debate-card li { font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); padding-left: 14px; position: relative; margin: 5px 0; }
.rc-debate-card li::before { content: '—'; position: absolute; left: 0; color: var(--color-text-faint); }
.rc-debate-vs {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--color-text-faint);
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; background: var(--color-surface);
}
.rc-debate-impl {
  margin-top: 14px; padding: 12px 14px; background: var(--color-surface);
  border-left: 3px solid var(--color-primary); border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.65; color: #7f1d1d;
}
.rc-debate-link { display: inline-block; margin-top: 11px; font-size: 11.5px; color: var(--color-blue); text-decoration: none; }
.rc-debate-link:hover { text-decoration: underline; }

/* 时间轴 */
.rc-tl-track { position: relative; padding: 8px 12px 4px 0; overflow-x: auto; display: flex; gap: 0; }
.rc-tl-line { position: absolute; top: 22px; left: 12px; right: 12px; height: 2px; background: var(--color-divider); }
.rc-tl-item {
  position: relative; flex: 1 0 130px; min-width: 130px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 6px;
}
.rc-tl-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 16px; z-index: 2; box-shadow: 0 0 0 3px var(--color-bg); }
.rc-tl-year { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; margin-top: 8px; color: var(--color-text); }
.rc-tl-card {
  margin-top: 8px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-top: 2px solid var(--rc-accent); border-radius: var(--radius-sm);
  padding: 8px 9px; width: 100%;
  display: flex; flex-direction: column; gap: 5px; align-items: center;
}
.rc-tl-tag { font-family: var(--font-mono); font-size: 9px; color: #fff; padding: 1px 6px; border-radius: 3px; letter-spacing: .3px; }
.rc-tl-label { font-size: 11px; line-height: 1.35; color: var(--color-text-muted); }

/* 数据来源 */
.rc-sources { margin-top: 12px; }
.rc-src-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--color-divider); font-size: 12px;
}
.rc-src-fact { color: var(--color-text-muted); line-height: 1.5; }
.rc-src-item a { color: var(--color-blue); text-decoration: none; white-space: nowrap; flex: none; font-size: 11.5px; }
.rc-src-item a:hover { text-decoration: underline; }
.rc-src-internal { color: var(--color-text-faint); font-style: italic; white-space: nowrap; flex: none; font-size: 11.5px; }

/* ================= M1 L4 tab 容器 ================= */
.l4-root { position: absolute; inset: 0; display: flex; flex-direction: column; }
.l4-tabbar {
  display: flex; gap: 6px; flex: none;
  padding: 12px 16px 0; background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider); z-index: 3;
}
.l4-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 14px 9px; cursor: pointer;
  background: transparent; border: none;
  border-bottom: 2px solid transparent; color: var(--color-text-muted);
  transition: all .15s ease;
}
.l4-tab:hover { color: var(--color-text); }
.l4-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.l4-tab-label { font-size: 13px; font-weight: 600; }
.l4-tab-mono { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .5px; color: var(--color-text-faint); }
.l4-view { position: relative; flex: 1; min-height: 0; display: none; }
.l4-view.active { display: block; }
/* PCB tab 保持原可缩放行为；CCL tab 内部滚动 */
.l4-view.l4-ccl { overflow-y: auto; overflow-x: hidden; background: var(--color-bg); }

/* ================= M1 CCL 材料阶梯 ================= */
.ccl-root { max-width: 1080px; margin: 0 auto; padding: 24px 26px 60px; font-family: var(--font-body); color: var(--color-text); }
.ccl-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ccl-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1.2; margin-bottom: 8px; }
.ccl-head p { font-size: 13px; line-height: 1.65; color: var(--color-text-muted); max-width: 720px; }
.ccl-toggle { display: inline-flex; flex: none; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.ccl-tg-btn {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  padding: 7px 13px; cursor: pointer; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-muted); transition: all .15s ease; white-space: nowrap;
}
.ccl-tg-btn.active { background: var(--color-primary); color: #fff; }
.ccl-ladder-wrap { margin-top: 20px; border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); padding: 6px; }
.ccl-ladder-svg { display: block; width: 100%; height: auto; }
.ccl-sect-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--color-text-faint); margin: 30px 0 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--color-divider);
}
.ccl-con-wrap { margin-top: 8px; }
.ccl-con-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-divider); }
.ccl-con-item:last-child { border-bottom: none; }
.ccl-con-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; margin-top: 4px; }
.ccl-con-body { display: flex; flex-direction: column; gap: 3px; }
.ccl-con-label { font-size: 13px; font-weight: 650; color: var(--color-text); }
.ccl-con-note { font-size: 12.5px; line-height: 1.6; color: var(--color-text-muted); }
.ccl-muted { font-size: 11px; line-height: 1.55; color: var(--color-text-faint); font-style: italic; }
.ccl-mode-panel {
  margin-top: 18px; background: var(--color-surface-2);
  border: 1px solid var(--color-divider); border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.ccl-mode-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ccl-mode-badge { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--color-primary); }
.ccl-mode-mat { font-size: 12px; color: var(--color-text-muted); }
.ccl-mode-mat b { font-family: var(--font-mono); color: var(--color-primary); }
.ccl-mode-list { margin: 10px 0 8px; padding-left: 18px; }
.ccl-mode-list li { font-size: 12.5px; line-height: 1.7; color: var(--color-text-muted); }
.ccl-tgt-grp { margin-bottom: 14px; }
.ccl-tgt-seg { display: block; font-size: 11.5px; font-weight: 650; color: var(--color-text); margin-bottom: 7px; }
.ccl-tgt-note { margin-top: 6px; }
.ccl-view-wrap { margin-top: 4px; }
.ccl-view {
  background: var(--color-primary-highlight); border: 1px solid #fecaca; border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm); padding: 13px 15px;
}
.ccl-view-logic { font-size: 12.5px; line-height: 1.65; color: #7f1d1d; }
.ccl-view-kpi { font-size: 12px; line-height: 1.6; color: var(--color-text-muted); margin-top: 9px; }
.ccl-evidence { margin-top: 9px; }

/* ================= M2 800VDC 电源链 ================= */
.pw-root { max-width: 1080px; margin: 0 auto; padding: 26px 28px 60px; font-family: var(--font-body); color: var(--color-text); }
.pw-head h2 { font-family: var(--font-display); font-size: 27px; font-weight: 400; line-height: 1.2; margin-bottom: 10px; }
.pw-head p { font-size: 13.5px; line-height: 1.7; color: var(--color-text-muted); max-width: 880px; }
.pw-em { font-family: var(--font-mono); font-weight: 600; color: var(--color-primary); }
.pw-sect-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--color-text-faint); margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--color-divider);
  display: flex; align-items: center; gap: 9px;
}
.pw-sds-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; color: var(--color-blue); background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 4px; padding: 2px 6px; letter-spacing: .3px; }
.pw-trees { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.pw-tree-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; transition: all .15s ease;
}
.pw-tree-card.legacy { border-left: 3px solid var(--color-text-faint); }
.pw-tree-card.hvdc { border-left: 3px solid var(--color-primary); }
.pw-tree-card:hover { box-shadow: var(--shadow); }
.pw-tree-card.active { box-shadow: 0 0 0 2px var(--color-primary), var(--shadow); }
.pw-tree-card.legacy.active { box-shadow: 0 0 0 2px var(--color-text-muted), var(--shadow); }
.pw-tree-svg { display: block; width: 100%; height: auto; }
.pw-notes { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.pw-note {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--color-divider); background: var(--color-surface-2);
}
.pw-note-b { border-left: 3px solid var(--color-blue); }
.pw-note-a { border-left: 3px solid var(--color-primary); }
.pw-note-plain { border-left: 3px solid var(--color-border); }
.pw-note-txt { font-size: 12.5px; line-height: 1.6; color: var(--color-text-muted); }
.pw-note-src { font-size: 11px; color: var(--color-blue); text-decoration: none; white-space: nowrap; flex: none; }
.pw-note-src.muted { color: var(--color-text-faint); font-style: italic; }
.pw-data-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.pw-data-cell { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; }
.pw-data-h { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.pw-chart-svg, .pw-bar-svg { display: block; width: 100%; height: auto; }
.pw-data-src { font-size: 10.5px; color: var(--color-text-faint); font-style: italic; }
.pw-tco { margin-top: 18px; padding: 13px 16px; background: var(--color-surface-2); border: 1px solid var(--color-divider); border-left: 3px solid var(--color-primary); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 5px; }
.pw-tco-val { font-size: 13px; line-height: 1.6; color: var(--color-text); }
.pw-noderow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-divider); }
.pw-noderow:last-child { border-bottom: none; }
.pw-noden { font-size: 12.5px; color: var(--color-text); }
.pw-nodev { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-muted); }
.pw-nodelist { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-sm); padding: 4px 12px; }
.tgt-group { margin-bottom: 13px; }
.tgt-group:last-of-type { margin-bottom: 0; }
.tgt-seg { font-size: 11.5px; font-weight: 650; color: var(--color-text); margin-bottom: 7px; }
.tgt-note { margin-top: 8px; }
.mono { font-family: var(--font-mono); }

/* ================= M3 液冷回路 ================= */
.cl-root { max-width: 1080px; margin: 0 auto; padding: 26px 28px 60px; font-family: var(--font-body); color: var(--color-text); }
.cl-head h2 { font-family: var(--font-display); font-size: 27px; font-weight: 400; line-height: 1.2; margin-bottom: 10px; }
.cl-head p { font-size: 13.5px; line-height: 1.7; color: var(--color-text-muted); max-width: 880px; }
.cl-em { font-family: var(--font-mono); font-weight: 600; color: var(--color-primary); }
.cl-svg-wrap { margin-top: 20px; border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); padding: 6px; }
.cl-loop-svg { display: block; width: 100%; height: auto; }
.cl-node-rect { transition: all .15s ease; }
.cl-node:hover .cl-node-rect { filter: drop-shadow(0 2px 5px rgba(0,0,0,.12)); }
.cl-aside {
  margin-top: 16px; background: #fffbeb; border: 1px solid #fde68a; border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm); padding: 13px 15px; cursor: pointer; transition: all .15s ease;
}
.cl-aside:hover { box-shadow: var(--shadow); }
.cl-aside-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.cl-aside-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--color-warning); letter-spacing: .4px; }
.cl-aside-name { font-size: 13.5px; font-weight: 650; color: var(--color-text); }
.cl-aside-detail { font-size: 12.5px; line-height: 1.65; color: var(--color-text-muted); }
.cl-aside-tier { display: inline-block; margin-top: 7px; font-family: var(--font-mono); font-size: 10.5px; color: var(--color-warning); }
.cl-anchor-box { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.cl-anchor-item {
  display: flex; flex-direction: column; gap: 5px; padding: 13px 15px;
  background: var(--color-surface-2); border: 1px solid var(--color-divider); border-radius: var(--radius-sm);
}
.cl-anchor-item.hot { border-left: 3px solid var(--color-primary); background: var(--color-primary-highlight); }
.cl-anchor-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: var(--color-warning); }
.cl-anchor-label.hot { color: var(--color-primary); }
.cl-anchor-txt { font-size: 12.5px; line-height: 1.6; color: var(--color-text-muted); }
.cl-anchor-src { font-size: 10.5px; color: var(--color-text-faint); font-style: italic; }
.cl-step-badge { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--color-primary); background: var(--color-primary-highlight); border: 1px solid #fecaca; border-radius: 4px; padding: 2px 7px; margin-right: 7px; }
.cl-tier-badge { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-faint); }
.cl-sds { margin-top: 4px; padding: 11px 13px; background: #eff6ff; border: 1px solid #bfdbfe; border-left: 3px solid var(--color-blue); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.6; color: #1e3a8a; }

/* 配电链分支 chip（蓝色） */
.crumb.branch-entry.power .lv { color: var(--color-blue); }
.crumb.branch-entry.power:hover:not(.active) { background: #eff6ff; color: var(--color-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --panel-w: 0px; }
  .stage { right: 0; bottom: 42vh; }
  .breadcrumb { font-size: 12px; }
  .crumb { padding: 4px 7px; font-size: 12px; }
  .crumb .nm-txt { display: none; }
  .crumb .lv { font-size: 11px; }
  .crumb.active .nm-txt { display: inline; }
  /* 分支标签/入口只有文字，移动端保留可见 */
  .crumb.branch-label .nm-txt,
  .crumb.branch-entry .nm-txt { display: inline; }
  .title-wrap { display: none; }
  .home-link { display: none; }

  /* N2 路线对比：四列→纵向堆叠 */
  .rc-root { padding: 18px 16px 48px; }
  .rc-head h2 { font-size: 22px; }
  .rc-cols { grid-template-columns: 1fr; gap: 12px; }
  .rc-debate-grid { grid-template-columns: 1fr; }
  .rc-debate-vs { margin: 0 auto; }
  .rc-src-item { flex-direction: column; gap: 4px; }
  .rc-src-item a, .rc-src-internal { white-space: normal; }

  /* M1/M2/M3 移动端 */
  .ccl-root, .pw-root, .cl-root { padding: 18px 16px 48px; }
  .ccl-head h2, .pw-head h2, .cl-head h2 { font-size: 22px; }
  .ccl-head-row { flex-direction: column; gap: 12px; }
  .pw-data-panel { grid-template-columns: 1fr; }
  .cl-anchor-box { grid-template-columns: 1fr; }
  .pw-note { flex-direction: column; gap: 5px; }
  .pw-note-src { white-space: normal; }
  .l4-tabbar { padding: 10px 12px 0; }
  .l4-tab { padding: 7px 10px 8px; }
  .l4-tab-label { font-size: 12px; }

  .panel {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: 42vh;
    border-left: none; border-top: 1px solid var(--color-border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 20px rgba(0,0,0,.1);
  }
  .panel-head { padding: 14px 18px 12px; }
  .panel-head h2 { font-size: 21px; }
  .panel-body { padding: 14px 18px 24px; }
  /* 舆 stage 本身已止于 42vh 抽屉顶部，其内控件直接贴底即可 */
  .controls { max-width: 180px; bottom: 12px; }
  .zoom-tools.active { bottom: 12px; }
  .legend { font-size: 11px; padding: 9px 11px; }
  /* mobile: hide drag/scroll hint to avoid colliding with reset button */
  .stage-hint { display: none; }
  /* L4 tab 栏占顶部；desktop 已隐 stage-hint/legend，移动端重置按钮不会与顶部 tab 重叠 */
}
@media (max-width: 480px) {
  .brand .sub { display: none; }
  .controls .legend { display: none; }
}
