/* ==========================================================================
   PRECISION EDITORIAL INDUSTRIAL — 车载自动化测试工程作品集设计系统
   灵感参考: Braun / Teenage Engineering / Porsche Engineering Spec Sheet
   基底: 暖道林纸白 #F5F4EE + 24px 精密坐标微点 | 仪器锚点: 暖炭黑 #171715
   主墨: #141413 | 信号点缀: 工业朱砂橙 #D64924 | 通过绿: #18794E
   零外部字体/CDN依赖，100% 离线原生渲染
   ========================================================================== */

:root {
  --bg: #F5F4EE;
  --bg-elevated: #FAF9F5;
  --surface: #FFFFFF;
  --surface-subtle: #EFEDE6;
  --surface-hover: #E8E5DC;

  --border: #DFDDD4;
  --border-strong: #C5C2B7;
  --border-dark: #2C2C28;

  --ink: #141413;
  --ink-secondary: #4A4943;
  --ink-muted: #85837B;

  /* 暖炭黑仪器面板色系 */
  --inst-bg: #161614;
  --inst-surface: #1F1F1C;
  --inst-border: #2E2E2A;
  --inst-ink: #F3F2EC;
  --inst-muted: #9A988E;

  /* 工业信号色（绝不使用廉价蓝紫渐变） */
  --accent: #D64924;
  --accent-hover: #B93B1A;
  --accent-bright: #F2643D;
  --accent-soft: #FDF1EC;
  --accent-border: #F2C4B3;

  --pass: #18794E;
  --pass-bright: #34D399;
  --pass-soft: #EBF8F1;
  --pass-border: #B4E2CB;

  --fail: #C4312C;
  --fail-soft: #FDF0EF;
  --fail-border: #F3C1BF;

  --warn: #A66308;
  --warn-bright: #FBBF24;
  --warn-soft: #FDF6E7;
  --warn-border: #ECD29E;

  --font-sans: "Segoe UI Variable Display", "Segoe UI Variable Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Cascadia Code", "SFMono-Regular", Consolas, Monaco, monospace;

  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 1px 2px rgba(20, 20, 19, 0.04), 0 8px 24px -12px rgba(20, 20, 19, 0.07);
  --shadow-hover: 0 4px 12px rgba(20, 20, 19, 0.06), 0 18px 36px -14px rgba(20, 20, 19, 0.12);
  --shadow-float: 0 22px 54px rgba(15, 15, 14, 0.24);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(20, 20, 19, 0.075) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 顶部 3px 工业仪器信号线 */
body::before {
  content: "";
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 32%, var(--ink) 32%, var(--ink) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

code,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

p code,
li code,
td code {
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
}

/* ==========================================================================
   顶部双层仪器铭牌导航 (Spec Ticker + Frosted Nav)
   ========================================================================== */
.spec-ticker {
  background: var(--inst-bg);
  color: var(--inst-muted);
  border-bottom: 1px solid var(--inst-border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.spec-ticker-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 6px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ticker-left,
.ticker-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pass-bright);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
  display: inline-block;
}

.ticker-sep {
  color: #45453F;
}

.ticker-hl {
  color: var(--inst-ink);
  font-weight: 600;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 244, 238, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark::before {
  content: "";
  width: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
  position: absolute;
  top: 6px;
}

.brand-mark::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  margin-top: 4px;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-muted);
  padding-left: 8px;
  border-left: 1px solid var(--border-strong);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.nav-link {
  padding: 6px 13px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.nav-link.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.08);
}

.nav-link .nav-idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  margin-right: 4px;
  font-weight: 700;
}

/* ==========================================================================
   右侧悬浮章节标尺 (Floating Chapter Index Rail)
   ========================================================================== */
.chapter-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 7px;
  box-shadow: var(--shadow-card);
}

.rail-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.18s var(--ease-out);
}

.rail-item::after {
  content: "";
  width: 8px;
  height: 2px;
  background: var(--border-strong);
  transition: all 0.18s var(--ease-out);
}

.rail-item:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.rail-item.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

.rail-item.active::after {
  width: 14px;
  background: var(--accent);
}

@media (max-width: 1380px) {
  .chapter-rail {
    display: none;
  }
}

/* ==========================================================================
   主容器与十字准星工程铭牌 (Spec Plate & Editorial Layout)
   ========================================================================== */
.page-wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 44px 28px 92px;
}

.spec-plate {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* 精密四角准星刻度装饰 */
.crosshair-box {
  position: relative;
}

.crosshair-box::before,
.crosshair-box::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--border-strong);
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.crosshair-box::before {
  top: 9px;
  left: 9px;
}

.crosshair-box::after {
  top: 9px;
  right: 9px;
}

.plate-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 26px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.plate-strip strong {
  color: var(--ink);
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==========================================================================
   Hero 编辑级非对称构图 + 暖炭黑台架数显仪
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.32fr 0.92fr;
  gap: 40px;
  align-items: stretch;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 56px;
}

.hero-title {
  font-size: clamp(32px, 4.3vw, 48px);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 18px;
}

.hero-title .hl-mark {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.hero-title .hl-mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 9px;
  background: rgba(214, 73, 36, 0.18);
  z-index: -1;
}

.hero-lead {
  font-size: 15.5px;
  color: var(--ink-secondary);
  max-width: 620px;
  margin-bottom: 22px;
  line-height: 1.72;
}

.hero-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.pillar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--ink-secondary);
}

.pillar-chip i {
  width: 5px;
  height: 5px;
  background: var(--accent);
  display: inline-block;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 暖炭黑精密仪器面板 (Dark Instrument Cluster) */
.instrument-panel {
  background: var(--inst-bg);
  color: var(--inst-ink);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 40px -16px rgba(20, 20, 19, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.instrument-panel::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 150px;
  height: 150px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 12px 12px;
  pointer-events: none;
}

.inst-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--inst-border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--inst-muted);
  letter-spacing: 0.06em;
}

.inst-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--pass-bright);
  font-size: 10.5px;
  font-weight: 600;
}

.inst-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.inst-cell {
  background: var(--inst-surface);
  border: 1px solid var(--inst-border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}

.inst-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--inst-ink);
  letter-spacing: -0.02em;
}

.inst-val.accent {
  color: var(--accent-bright);
}

.inst-val.pass {
  color: var(--pass-bright);
}

.inst-lbl {
  font-size: 11.5px;
  color: var(--inst-muted);
  margin-top: 5px;
}

.inst-foot {
  padding-top: 12px;
  border-top: 1px dashed var(--inst-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--inst-muted);
}

/* ==========================================================================
   机械触感按钮系统 (Tactile Buttons)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease-out), background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(20, 20, 19, 0.16);
}

.btn-primary:hover {
  background: #2A2A26;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(20, 20, 19, 0.2);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(214, 73, 36, 0.25);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(214, 73, 36, 0.32);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface-subtle);
  border-color: var(--ink);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ==========================================================================
   章节编辑式标题头 (Editorial Section Header)
   ========================================================================== */
.section-block {
  margin-bottom: 64px;
  scroll-margin-top: 84px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
  background: var(--ink);
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.04em;
  position: relative;
  top: -2px;
}

.section-sub {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ==========================================================================
   首页旗舰双展台卡片 (Flagship Bento Project Cards)
   ========================================================================== */
.project-showcase {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s var(--ease-out), border-color 0.25s;
}

.project-card:hover {
  border-color: #9E9B90;
  box-shadow: var(--shadow-hover);
}

.project-card-main {
  display: grid;
  grid-template-columns: 1.02fr 1.08fr;
}

.project-body {
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  position: relative;
}

/* 工业背景大序号水印 */
.project-watermark {
  position: absolute;
  top: 14px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: rgba(20, 20, 19, 0.04);
  pointer-events: none;
  user-select: none;
}

.project-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.project-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.project-desc {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 18px;
  line-height: 1.7;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.metric-strip>div {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
}

.metric-strip>div:last-child {
  border-right: none;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.metric-lbl {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
}

.project-visual {
  background: var(--surface-subtle);
  border-left: 1px solid var(--border);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.visual-Stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.visual-stage-frame {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: var(--inst-bg);
  box-shadow: 0 8px 24px rgba(20, 20, 19, 0.1);
}

.visual-stage-frame img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease-out);
}

.visual-stage-frame:hover img {
  transform: scale(1.012);
}

.visual-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* 首页迷你双视图胶囊切换 */
.mini-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px;
  gap: 2px;
}

.mini-switch button {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 3px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.mini-switch button.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
   四层工程架构卡片矩阵 (4-Layer Stack Matrix)
   ========================================================================== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}

.stack-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--border-strong);
  transition: background 0.2s;
}

.stack-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.stack-card:hover::before {
  background: var(--accent);
}

.stack-layer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stack-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stack-card p {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   专题页页眉、KPI 仪表条与通用徽章
   ========================================================================== */
.subpage-hero {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.subpage-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 44px;
  box-shadow: var(--shadow-card);
}

.kpi-cell {
  padding: 20px 24px;
  border-right: 1px solid var(--border);
  position: relative;
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-cell .kpi-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.kpi-cell .val {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-cell .lbl {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-pass {
  background: var(--pass-soft);
  color: var(--pass);
  border-color: var(--pass-border);
}

.badge-fail {
  background: var(--fail-soft);
  color: var(--fail);
  border-color: var(--fail-border);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.badge-neutral {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border-color: var(--border);
}

/* ==========================================================================
   动态工程架构蓝图容器 (Animated Blueprint SVG)
   ========================================================================== */
.arch-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.arch-svg-wrap {
  padding: 26px 24px 20px;
  background-image: linear-gradient(to right, rgba(20, 20, 19, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 20, 19, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

@keyframes busPulse {
  to {
    stroke-dashoffset: -28;
  }
}

.svg-flow-line {
  stroke-dasharray: 5 5;
  animation: busPulse 1.4s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .svg-flow-line {
    animation: none;
  }
}

/* ==========================================================================
   视觉专题页：7 用例交互式检视器 + 动态 ROI 瞄准镜 + 拖动对比滑块
   ========================================================================== */
.inspector-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.case-nav-list {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.case-nav-head {
  padding: 11px 16px;
  background: var(--inst-bg);
  color: var(--inst-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.case-nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s;
  font-family: inherit;
}

.case-nav-item:last-child {
  border-bottom: none;
}

.case-nav-item:hover {
  background: var(--bg);
}

.case-nav-item.active {
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

.case-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.case-nav-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.case-nav-meta {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.inspector-detail {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--shadow-card);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.detail-media-grid {
  display: grid;
  grid-template-columns: 1.48fr 0.92fr;
  gap: 18px;
  align-items: stretch;
}

/* 实拍整图 + SVG 矢量 ROI 瞄准镜叠加 */
.full-frame-box {
  position: relative;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #10100F;
  cursor: zoom-in;
}

.full-frame-box img {
  width: 100%;
  display: block;
}

.roi-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes roiBreath {

  0%,
  100% {
    stroke-opacity: 1;
  }

  50% {
    stroke-opacity: 0.45;
  }
}

.roi-pulse-rect {
  animation: roiBreath 1.8s ease-in-out infinite;
}

.zoom-tip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(20, 20, 19, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #F3F2EC;
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* 可把玩的 Before / After 滑动分割对比器 */
.compare-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.compare-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.compare-slider {
  position: relative;
  width: 100%;
  height: 168px;
  background: #121210;
  border-radius: 5px;
  border: 1px solid var(--border-dark);
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  touch-action: none;
}

.compare-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.compare-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.compare-after {
  clip-path: inset(0 0 0 50%);
}

.compare-tag {
  position: absolute;
  top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(20, 20, 19, 0.78);
  color: #E8E7E0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
  z-index: 3;
}

.compare-tag.left {
  left: 8px;
}

.compare-tag.right {
  right: 8px;
  color: #FDB39C;
  border-color: rgba(214, 73, 36, 0.45);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent-bright);
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(242, 100, 61, 0.7);
}

.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.triple-mini-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.thumb-mini-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px;
  text-align: center;
  cursor: zoom-in;
  transition: border-color 0.15s;
}

.thumb-mini-box:hover {
  border-color: var(--accent);
}

.thumb-mini-box img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  background: #141413;
  border-radius: 3px;
  display: block;
  margin-bottom: 3px;
}

.thumb-mini-box span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
}

/* 参数规格表与 5 帧柱状图 */
.assertion-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr;
  gap: 18px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spec-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table td:first-child {
  color: var(--ink-muted);
  width: 112px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.chart-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

/* 暖炭黑仪器终端日志 (Dark Instrument Log Terminal) */
.log-terminal-dark {
  background: var(--inst-bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: #D6D5CE;
  max-height: 210px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.log-terminal-dark .log-ts {
  color: #7C7A70;
}

.log-terminal-dark .log-pass {
  color: var(--pass-bright);
  font-weight: 700;
}

.log-terminal-dark .log-warn {
  color: var(--warn-bright);
  font-weight: 600;
}

.log-terminal-dark .log-err {
  color: #F87171;
  font-weight: 700;
}

.log-terminal-dark .log-can {
  color: var(--accent-bright);
}

/* 保留浅色日志兼容 */
.log-terminal-light {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-height: 210px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ==========================================================================
   UDS 专题页：ISO-TP 多帧总线时序仪 + 20-Byte VIN 实时内存拼装槽
   ========================================================================== */
.isotp-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.isotp-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.isotp-step-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s var(--ease-out);
  font-family: inherit;
  position: relative;
}

.isotp-step-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.isotp-step-btn.active {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent), var(--shadow-card);
}

.isotp-step-btn.passed:not(.active) {
  border-color: var(--pass-border);
  background: #F7FBF9;
}

.dir-tx,
.dir-rx,
.dir-nrc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-align: center;
}

.dir-tx {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.dir-rx {
  color: var(--pass);
  background: var(--pass-soft);
  border: 1px solid var(--pass-border);
}

.dir-nrc {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
}

.byte-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

/* 机械键帽式 CAN 字节格 */
.byte-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 5px;
  border: 1px solid var(--border);
  min-width: 48px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(20, 20, 19, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.byte-cell small {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.75;
}

.byte-pci {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.byte-data {
  background: var(--pass-soft);
  color: var(--pass);
  border-color: var(--pass-border);
}

.byte-pad {
  background: var(--surface-subtle);
  color: var(--ink-muted);
  border-style: dashed;
  box-shadow: none;
}

/* 20-Byte VIN 重组内存缓冲区可视化 */
.vin-buffer-panel {
  margin-top: 16px;
  background: var(--inst-bg);
  color: var(--inst-ink);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.vin-buffer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--inst-muted);
}

.vin-slots {
  display: grid;
  grid-template-columns: repeat(20, minmax(34px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.vin-slot {
  border-radius: 4px;
  border: 1px dashed #383833;
  background: #1D1D1A;
  padding: 6px 2px;
  text-align: center;
  font-family: var(--font-mono);
  transition: all 0.22s var(--ease-out);
}

.vin-slot .s-idx {
  font-size: 8.5px;
  color: #6E6D65;
  display: block;
}

.vin-slot .s-hex {
  font-size: 11px;
  font-weight: 700;
  color: #57564F;
  display: block;
  margin: 2px 0;
}

.vin-slot .s-chr {
  font-size: 10px;
  color: #57564F;
  display: block;
}

.vin-slot.filled {
  border-style: solid;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(24, 121, 78, 0.22);
}

.vin-slot.filled .s-hex {
  color: var(--pass-bright);
}

.vin-slot.filled .s-chr {
  color: #E4FBF0;
  font-weight: 600;
}

.vin-slot.just-arrived {
  border-style: solid;
  border-color: var(--accent-bright);
  background: rgba(214, 73, 36, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 73, 36, 0.35);
}

.vin-slot.just-arrived .s-hex {
  color: #FFD0C2;
}

.vin-slot.just-arrived .s-chr {
  color: #FFFFFF;
  font-weight: 700;
}

.vin-slot.is-header.filled .s-chr,
.vin-slot.is-header.just-arrived .s-chr {
  color: var(--warn-bright);
}

/* ==========================================================================
   交互式十字准星趋势图容器 (Interactive Crosshair Trend Chart)
   ========================================================================== */
.trend-wrap {
  position: relative;
}

.trend-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--inst-bg);
  color: var(--inst-ink);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  padding: 8px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 10;
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==========================================================================
   筛选条、数据表格与排障诊断卡
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.pill-btn {
  background: transparent;
  border: none;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.pill-btn:hover {
  color: var(--ink);
}

.pill-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.08);
}

.search-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 13px;
  color: var(--ink);
  min-width: 250px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 73, 36, 0.12);
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clean-table th {
  text-align: left;
  padding: 12px 15px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-strong);
}

.clean-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.clean-table tbody tr:last-child td {
  border-bottom: none;
}

.clean-table tbody tr:hover {
  background: #FAF9F4;
}

/* 排障复盘双联诊断卡 */
.case-study-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.study-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.study-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
  margin: 4px 0;
}

.study-step {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.65;
  position: relative;
}

.study-step::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}

.study-step.resolved::before {
  border-color: var(--pass);
}

.study-step strong {
  color: var(--ink);
}

/* ==========================================================================
   控制台实景展示画框 (Studio Workbench Frame)
   ========================================================================== */
.studio-frame {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.studio-frame-bar {
  height: 40px;
  padding: 0 16px;
  background: var(--inst-bg);
  color: var(--inst-muted);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.studio-dots {
  display: inline-flex;
  gap: 6px;
}

.studio-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3A3A35;
  display: block;
}

.studio-dots i:first-child {
  background: var(--accent);
}

.studio-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #C7C5BC;
}

.studio-shot {
  width: 100%;
  display: block;
  cursor: zoom-in;
  background: var(--bg);
}

.studio-caption-bar {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* ==========================================================================
   页脚与全局大图灯箱
   ========================================================================== */
.site-footer {
  margin-top: 72px;
  padding-top: 26px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16, 16, 15, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 200;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 94vw;
  max-height: 92vh;
  background: var(--inst-bg);
  color: var(--inst-ink);
  border: 1px solid var(--inst-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-float);
}

.lightbox-inner img {
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 5px;
  background: #0D0D0C;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--inst-ink);
}

/* ==========================================================================
   响应式适配与打印模式
   ========================================================================== */
@media (max-width: 1024px) {

  .hero-grid,
  .project-card-main,
  .inspector-layout,
  .detail-media-grid,
  .assertion-grid,
  .case-study-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid,
  .kpi-bar {
    grid-template-columns: 1fr 1fr;
  }

  .isotp-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-visual {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .kpi-cell {
    border-bottom: 1px solid var(--border);
  }

  .vin-slots {
    grid-template-columns: repeat(10, minmax(36px, 1fr));
  }
}

@media (max-width: 680px) {
  .nav-inner {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
  }

  .page-wrap {
    padding: 28px 16px 64px;
  }

  .stack-grid,
  .kpi-bar,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip>div {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media print {
  body {
    background: #fff !important;
    background-image: none !important;
  }

  body::before,
  .spec-ticker,
  .site-nav,
  .chapter-rail,
  .no-print,
  .zoom-tip {
    display: none !important;
  }

  .page-wrap {
    max-width: 100%;
    padding: 0;
  }

  .card,
  .table-card,
  .kpi-bar,
  .study-card {
    break-inside: avoid;
    box-shadow: none !important;
  }
}


/* ==========================================================================
   PROJECT 03 (CANoe / CAPL) — 车身域仿真实验台、64-Bit DBC 位域图与时序逻辑仪
   ========================================================================== */

/* 交互式车身域 Restbus 仿真实验台 */
.sim-workbench {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.sim-preset-bar {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.sim-controls-col {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--border);
}

.sim-monitor-col {
  background: var(--inst-bg);
  color: var(--inst-ink);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.sim-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-speed-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.sim-speed-readout {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.sim-range {
  width: 100%;
  accent-color: var(--accent);
  margin: 10px 0 6px;
  cursor: pointer;
}

.sim-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sim-ctrl-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.fault-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.fault-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.fault-chk:hover { border-color: var(--border-strong); }
.fault-chk input { accent-color: var(--fail); cursor: pointer; }
.fault-chk.is-active {
  background: var(--fail-soft);
  border-color: var(--fail-border);
  color: var(--fail);
  font-weight: 700;
}

/* 右侧暖炭黑 ECU 状态与车门动画监视面板 */
.ecu-led-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ecu-led-box {
  background: var(--inst-surface);
  border: 1px solid var(--inst-border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.ecu-led-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--inst-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ecu-led-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--inst-ink);
}

.debounce-bar-track {
  height: 6px;
  background: #2A2A26;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.debounce-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-bright);
  transition: width 0.06s linear;
}

.latch-alert {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: rgba(242, 100, 61, 0.14);
  border: 1px solid rgba(242, 100, 61, 0.45);
  color: #FFD2C4;
  font-size: 12px;
  line-height: 1.55;
  display: none;
}
.latch-alert.show { display: block; }

/* 64-Bit DBC 报文位域矩阵 */
.dbc-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.bit-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10.5px;
  user-select: none;
}

.bit-grid-table th {
  padding: 6px 4px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-weight: 600;
}

.bit-grid-table td {
  height: 32px;
  border: 1px solid var(--border);
  text-align: center;
  padding: 2px 3px;
  font-size: 10px;
  color: var(--ink-muted);
  background: var(--bg);
}

.bit-grid-table td.byte-idx {
  width: 56px;
  background: var(--bg-elevated);
  font-weight: 700;
  color: var(--ink-secondary);
}

.bit-sig-cell {
  cursor: pointer;
  font-weight: 700;
  transition: filter 0.15s, box-shadow 0.15s;
}
.bit-sig-cell:hover { filter: brightness(0.95); }
.bit-sig-cell.selected {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  z-index: 2;
  position: relative;
}

.sig-c0 { background: #FDF1EC !important; color: #B93B1A !important; }
.sig-c1 { background: #EBF8F1 !important; color: #156842 !important; }
.sig-c2 { background: #FDF6E7 !important; color: #8F5305 !important; }
.sig-c3 { background: #EEF2FA !important; color: #264A8A !important; }
.sig-c4 { background: #F4EFFA !important; color: #5C328A !important; }
.sig-c5 { background: #E9F6F7 !important; color: #166069 !important; }

/* CAPL 代码抽屉 */
.code-viewer-dark {
  background: var(--inst-bg);
  color: #E3E2DA;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.code-viewer-bar {
  padding: 10px 16px;
  background: var(--inst-surface);
  border-bottom: 1px solid var(--inst-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--inst-muted);
}

.code-pre {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  max-height: 360px;
  overflow: auto;
  white-space: pre;
}

@media (max-width: 1024px) {
  .sim-grid,
  .dbc-layout {
    grid-template-columns: 1fr;
  }
  .sim-controls-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
