/* ============================================================
   TwinOps V1.0 —— 棉花打顶智能装备轻量化作业管控平台
   统一样式系统  assets/css/main.css

   设计基调：深色科技风 / 深蓝底 + 青绿主色 + 橙黄警示
   遵循 frontend-spec：
     · 第3章：语义化标签、类名短横线、禁用行内样式
     · 第4章：颜色全部走变量、z-index 统一管理、嵌套 ≤3 层
     · 第11章：动效可降级、用 transform/opacity 走合成层
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 背景层级 */
  --bg-0: #050b16;
  --bg-1: #0a1120;
  --bg-2: #0e1729;
  --panel: #0d1728;
  --panel-2: #111d33;
  --panel-3: #16243d;
  --line: #1d3050;
  --line-2: #24405f;
  /* 文字 */
  --tx-0: #eaf2ff;
  --tx-1: #b9c9e0;
  --tx-2: #7f93b0;
  --tx-3: #586b86;

  /* 主色系 */
  --cyan: #22d3ee;
  --cyan-d: #0891b2;
  --green: #34d399;
  --blue: #3b82f6;
  --purple: #a78bfa;
  --amber: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;

  /* 深色变体 */
  --cyan-ink: #04202a;
  --green-d: #0f9d6e;
  --amber-d: #b45309;
  --red-d: #b91c1c;

  /* 滚动条 */
  --scroll-thumb: #223a5c;
  --scroll-thumb-hover: #2f5079;
  --bar-track: rgba(29, 48, 80, .9);

  /* 页面局部底色（此前散落在各页 <style> 里，现统一收口） */
  --stage-bg: #06101f;          /* 卫星图/画布舞台底色 */
  --stage-bg-2: #071120;        /* 略亮一档的舞台底色 */
  --stage-bg-3: #040a14;        /* 视觉页最深的舞台底色 */
  --mask-rgb: 6, 16, 31;        /* 舞台底色的 rgb 分量，供 radial-gradient 用 */
  --ink-mask-rgb: 4, 10, 20;    /* 视觉页遮罩 rgb 分量 */

  /* 半透明叠加（统一收口） */
  --cyan-a05: rgba(34, 211, 238, .05);
  --cyan-a08: rgba(34, 211, 238, .08);
  --cyan-a13: rgba(34, 211, 238, .13);
  --cyan-a28: rgba(34, 211, 238, .28);
  --cyan-a30: rgba(34, 211, 238, .30);
  --green-a10: rgba(52, 211, 153, .10);
  --green-a13: rgba(52, 211, 153, .13);
  --green-a30: rgba(52, 211, 153, .30);
  --amber-a13: rgba(251, 191, 36, .13);
  --amber-a30: rgba(251, 191, 36, .30);
  --red-a13: rgba(248, 113, 113, .13);
  --red-a30: rgba(248, 113, 113, .30);
  --mute-a10: rgba(127, 147, 176, .10);
  --divider: rgba(29, 48, 80, .45);
  --divider-2: rgba(29, 48, 80, .60);
  --white-a05: rgba(255, 255, 255, .05);
  --panel-a70: rgba(17, 29, 51, .7);    /* 内嵌面板底 */
  --panel-a75: rgba(17, 29, 51, .75);   /* 时间轴轨道底 */

  /* 发光与投影 */
  --glow-cyan: 0 0 18px rgba(34, 211, 238, .35);
  --glow-green: 0 0 18px rgba(52, 211, 153, .32);
  --glow-red: 0 0 18px rgba(248, 113, 113, .38);
  --shadow-card: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .60);

  /* ---- 置信度分档（检测框 / 目标列表 / 图例共用同一套口径） ----
     高：可信，可直接执行；中：需复核；低：风险，触发告警。
     分档阈值定义在 JS 侧统一常量 CONF_TIERS，此处只负责配色。 */
  --conf-hi: #34d399;         /* ≥ 95% —— 高置信 */
  --conf-hi-rgb: 52, 211, 153;
  --conf-mid: #22d3ee;        /* 88% ~ 95% —— 中置信 */
  --conf-mid-rgb: 34, 211, 238;
  --conf-low: #fbbf24;        /* < 88% —— 低置信 / 遮挡 */
  --conf-low-rgb: 251, 191, 36;

  /* ---- 时间轴轨道（回放页专用，收口避免散落） ---- */
  --track-bg: rgba(4, 10, 20, .72);
  --track-grid: rgba(29, 48, 80, .85);
  --track-played: rgba(34, 211, 238, .13);
  --track-head: #22d3ee;
  --marker-warn: #fbbf24;
  --marker-error: #f87171;
  --marker-info: #38bdf8;

  /* ---- 棉田舞台（视觉页背景，替代程序化绿纹） ---- */
  --field-soil: #08131f;
  --field-soil-2: #0a1826;
  --field-furrow: rgba(46, 110, 78, .38);
  --field-leaf: rgba(52, 120, 92, .30);
  --field-leaf-hi: rgba(118, 176, 142, .34);

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* z-index 层级（统一管理，禁止散落魔数） */
  --z-base: 0;
  --z-page: 1;
  --z-stage: 1;
  --z-overlay: 3;
  --z-hud: 4;
  --z-float: 5;
  --z-popup: 20;
  --z-nav: 100;

  /* 布局 */
  --nav-h: 58px;
  --page-max: 1760px;

  --font: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, -apple-system, sans-serif;
  --sans: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", monospace;

  /* 过渡时长统一（收紧节奏，操作反馈更"跟手"） */
  --t-fast: .12s;
  --t-base: .18s;
  --t-slow: .3s;
  --ease-out: cubic-bezier(.22, .88, .32, 1);
  --ease-spring: cubic-bezier(.2, .9, .3, 1.02);
}

/* ---------- 2. 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--tx-1);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 全局网格底纹（固定在视口，不参与滚动）
   注意：用负 z-index 沉到 body 内容之下，防止 fixed 元素参与层叠上下文后
   盖住页面模块（用户反馈"顶部不全屏时模块被挡、点不动"的根因之一）。
   调参：网格间距加大到 56px、透明度降到 .022，避免透过卡片显脏。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(rgba(34, 211, 238, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 35%, transparent 100%);
}

/* 顶部光晕（弱化，避免与卡片抢视觉） */
body::after {
  content: "";
  position: fixed;
  top: -22%;
  left: 50%;
  width: 120vw;
  height: 58vh;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, .075), transparent 62%);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* 数字统一等宽 + 表格数字对齐 */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 焦点可见性（可访问性：键盘操作时才有轮廓） */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 屏幕阅读器专用文本 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. 顶部导航 ---------- */
/* 关键修复：吸附改为固定高度 + 常驻，且不遮挡内容的锚点 */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  background: rgba(10, 17, 32, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
/* 导航底部一条渐变高光，替代纯色边框，提升精致度 */
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-a30) 22%, var(--cyan-a30) 78%, transparent);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

.brand-logo {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--cyan), var(--cyan-d));
  border-radius: 8px;
  color: var(--cyan-ink);
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}
/* 品牌标记用 SVG（棉桃剖面 + 顶芽 + 打顶切口），跟随 currentColor 取深色描边 */
.brand-logo svg { width: 21px; height: 21px; display: block; }

.brand-txt b {
  display: block;
  color: var(--tx-0);
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: .3px;
  white-space: nowrap;
}
.brand-txt span {
  display: block;
  color: var(--tx-3);
  font-size: 10.5px;
  letter-spacing: .6px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  display: block;
  padding: 7px 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--tx-2);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  border: 1px solid transparent;
}
.nav-links a:hover { background: var(--cyan-a08); color: var(--tx-0); }
.nav-links a.active {
  background: var(--cyan-a13);
  color: var(--cyan);
  border-color: var(--cyan-a30);
  font-weight: 600;
}

.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  background: var(--green-a10);
  border: 1px solid var(--green-a30);
  color: var(--green);
  white-space: nowrap;
}
.pill b { font-weight: 600; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--glow-green);
  animation: pulse 1.9s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

.clock {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--tx-1);
  letter-spacing: .5px;
  text-align: right;
  line-height: 1.15;
}
.clock small {
  font-size: 10.5px;
  color: var(--tx-3);
  display: block;
  letter-spacing: .3px;
}

/* ---------- 4. 页面容器 ---------- */
.page {
  position: relative;
  z-index: var(--z-page);
  padding: 22px 24px 40px;
  max-width: var(--page-max);
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;      /* 留出空间给下方尺寸标注线 */
  flex-wrap: wrap;
  position: relative;
  padding-left: 13px;
}
/* 页头左侧竖强调条 */
.page-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 3px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-d) 60%, transparent 100%);
  box-shadow: var(--glow-cyan);
}
.page-head h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--tx-0);
  letter-spacing: .6px;
}
.page-head p { font-size: 12px; color: var(--tx-3); margin-top: 4px; }

/* 页头下方的工程图纸尺寸线：带两端端点的细线 + 中间短刻度，
   呼应"打顶装备是精密机械"的项目属性，也让页头不再只是文字堆叠。 */
.page-head::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 0;
  bottom: -6px;
  height: 1px;
  background:
    /* 主尺寸线：两端实、中段浅，形成端点的视觉停顿 */
    linear-gradient(90deg,
      var(--line-2) 0 14px, transparent 14px calc(100% - 14px), var(--line-2) calc(100% - 14px) 100%),
    /* 中段细分刻度：每 48px 一个短竖线 */
    repeating-linear-gradient(90deg,
      var(--line) 0 1px, transparent 1px 48px);
  background-size: 100% 1px, 100% 5px;
  background-position: 0 0, 0 0;
  background-repeat: no-repeat, repeat-x;
  opacity: .8;
  pointer-events: none;
}

/* ---------- 5. 卡片 ---------- */
.card {
  background: linear-gradient(168deg, var(--panel-2) 0%, var(--panel) 46%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 17px;
  position: relative;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  box-shadow:
    inset 0 1px 0 var(--white-a05),
    0 2px 10px rgba(0, 0, 0, .28);
}
/* 卡片左上角内发光，弱化"纯色方块"感 */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 190px;
  height: 110px;
  border-radius: var(--r-lg) 0 0 0;
  background: radial-gradient(circle at 0% 0%, var(--cyan-a08), transparent 70%);
  pointer-events: none;
}
.card:hover {
  border-color: var(--line-2);
  box-shadow:
    inset 0 1px 0 var(--white-a05),
    0 6px 22px rgba(0, 0, 0, .38);
}

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  position: relative;
}
.card-h h3 {
  font-size: 14px;
  font-weight: 620;
  color: var(--tx-0);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .2px;
}
.card-h h3::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-d));
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}
.card-h .hint { font-size: 11px; color: var(--tx-3); }

/* ---------- 6. KPI 卡片 ---------- */
/* 不规则网格：首卡（机器状态）跨 2 列作为主指标，其余 5 张平分。
   这样在 1920 宽下每张卡有约 265px 可用宽度，数值与单位不再黏连；
   视觉上也有了主次，不是六个一模一样的方块排队。 */
.kpi-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.15fr 1.15fr 0.85fr;
  gap: 12px;
  margin-bottom: 14px;
}
/* 窄屏逐级降列，避免卡片被压到放不下数字 */
@media (max-width: 1400px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

.kpi {
  background: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 55%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px 13px 17px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  box-shadow: inset 0 1px 0 var(--white-a05);
}
/* 左侧竖色条（默认青色，按变体覆盖） */
.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-d));
  box-shadow: var(--glow-cyan);
}
/* 右上角斜向光斑（克制，仅作氛围） */
.kpi::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan-a05), transparent 66%);
  pointer-events: none;
}
.kpi:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 var(--white-a05), var(--shadow-card);
}

.kpi-label {
  font-size: 11.5px;
  color: var(--tx-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.kpi-val {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--tx-0);
  line-height: 1.1;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  transition: color var(--t-base) var(--ease-out);
}
/* 单位：与数值拉开距离并降低对比，读数字时不被单位打断 */
.kpi-val u {
  font-size: 12px;
  font-weight: 400;
  color: var(--tx-2);
  text-decoration: none;
  margin-left: 6px;
  letter-spacing: 0;
}
.kpi-sub { font-size: 10.5px; color: var(--tx-3); margin-top: 6px; }

/* 主指标卡（机器状态）—— 字号更大、右侧补一个状态指示环 */
.kpi.lead .kpi-val { font-size: 30px; }
.kpi.lead { padding-right: 58px; }
.kpi.lead .kpi-ring {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ring, var(--green));
  opacity: .55;
}
.kpi.lead .kpi-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--ring, var(--green));
  opacity: .85;
}

/* KPI 强调色变体（左侧色条 + 光斑 + 数值同步换色） */
.kpi.ok::before { background: linear-gradient(180deg, var(--green), var(--green-d)); box-shadow: var(--glow-green); }
.kpi.ok::after { background: radial-gradient(circle, var(--green-a10), transparent 66%); }
.kpi.ok .kpi-val { color: var(--green); }

.kpi.cy::before { background: linear-gradient(180deg, var(--cyan), var(--cyan-d)); }
.kpi.cy::after { background: radial-gradient(circle, var(--cyan-a05), transparent 66%); }
.kpi.cy .kpi-val { color: var(--cyan); }

.kpi.warn::before { background: linear-gradient(180deg, var(--amber), var(--amber-d)); box-shadow: 0 0 18px var(--amber-a30); }
.kpi.warn::after { background: radial-gradient(circle, var(--amber-a13), transparent 66%); }
.kpi.warn .kpi-val { color: var(--amber); }

.kpi.bad::before { background: linear-gradient(180deg, var(--red), var(--red-d)); box-shadow: var(--glow-red); }
.kpi.bad::after { background: radial-gradient(circle, var(--red-a13), transparent 66%); }
.kpi.bad .kpi-val { color: var(--red); }

/* ---------- 7. 通用栅格 ---------- */
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: 1.85fr 1fr; align-items: start; }

/* ---------- 8. 条目行 ---------- */
.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider-2);
}
.row:last-child { border-bottom: none; }
.row-k { font-size: 12.5px; color: var(--tx-2); }
.row-v { font-family: var(--mono); font-size: 15px; color: var(--tx-0); font-weight: 600; }
.row-v small { font-size: 10.5px; color: var(--tx-3); font-weight: 400; margin-left: 3px; }

/* ---------- 9. 进度条 ---------- */
.bar {
  height: 6px;
  border-radius: 4px;
  background: var(--bar-track);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  width: 0;                     /* 初始为 0，由 JS 写入具体百分比 */
  background: linear-gradient(90deg, var(--cyan-d), var(--cyan));
  box-shadow: 0 0 10px var(--cyan-a30);
  transition: width .32s var(--ease-out);
}
.bar.green > i { background: linear-gradient(90deg, var(--green-d), var(--green)); box-shadow: 0 0 10px var(--green-a30); }
.bar.amber > i { background: linear-gradient(90deg, var(--amber-d), var(--amber)); box-shadow: 0 0 10px var(--amber-a30); }
.bar.red > i { background: linear-gradient(90deg, var(--red-d), var(--red)); box-shadow: 0 0 10px var(--red-a30); }

/* ---------- 10. 状态标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.tag.ok { background: var(--green-a13); color: var(--green); border: 1px solid var(--green-a30); }
.tag.cy { background: var(--cyan-a13); color: var(--cyan); border: 1px solid var(--cyan-a30); }
.tag.warn { background: var(--amber-a13); color: var(--amber); border: 1px solid var(--amber-a30); }
.tag.bad { background: var(--red-a13); color: var(--red); border: 1px solid var(--red-a30); }
.tag.mute { background: var(--mute-a10); color: var(--tx-2); border: 1px solid var(--line); }

/* ---------- 11. 图例 ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--divider-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--tx-2); }
.legend i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- 12. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--cyan-a08);
  border: 1px solid var(--cyan-a28);
  color: var(--cyan);
  transition: background var(--t-fast), transform .1s;
}
.btn:hover { background: var(--cyan-a13); }
.btn:active { transform: scale(.97); }
.btn.solid {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: var(--cyan-ink);
  font-weight: 650;
  border-color: transparent;
}
.btn.solid:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--tx-1); }
.btn.ghost:hover { background: var(--cyan-a08); }
.btn.sm { padding: 5px 10px; font-size: 11px; }

.btn-group { display: flex; gap: 7px; flex-wrap: wrap; }

/* ---------- 12b. 轻量操作反馈（Toast） ----------
   作用：任何按钮 / 滑杆操作后立刻给出可见反馈，
   让"点了有没有生效"一目了然，无需阅读说明文字。 */
.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-popup);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: rgba(13, 23, 40, .96);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--cyan);
  color: var(--tx-1);
  font-size: 12px;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toast-in .22s cubic-bezier(.2, .9, .3, 1.1);
  max-width: 300px;
}
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--amber); }
.toast.bad { border-left-color: var(--red); }
.toast b { color: var(--tx-0); font-weight: 600; }
.toast.out { animation: toast-out .2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px) scale(.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(16px) scale(.96); }
}

/* 滑杆（统一美化，避免各页分散定义） */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--bar-track);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--cyan), var(--cyan-d));
  box-shadow: var(--glow-cyan);
  cursor: grab;
  transition: transform var(--t-fast);
}
.slider::-webkit-slider-thumb:active { transform: scale(1.18); cursor: grabbing; }
.slider::-moz-range-thumb {
  width: 15px; height: 15px; border: none; border-radius: 50%;
  background: var(--cyan); box-shadow: var(--glow-cyan); cursor: grab;
}

/* ---------- 13. 表格 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th {
  text-align: left;
  padding: 9px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--divider);
  color: var(--tx-1);
}
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--cyan-a05); }
table.data td.num { font-family: var(--mono); color: var(--tx-0); }

/* ---------- 14. 来源注脚 ---------- */
.src {
  font-size: 10.5px;
  color: var(--tx-3);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--divider-2);
  line-height: 1.6;
}
.src b { color: var(--tx-2); font-weight: 600; }

/* ---------- 15. 通用小部件 ---------- */
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider-2);
}
.kv:last-child { border-bottom: none; }
.kv-k { font-size: 11.5px; color: var(--tx-2); display: flex; align-items: center; gap: 6px; }
.kv-v { font-family: var(--mono); font-size: 13.5px; color: var(--tx-0); font-weight: 600; }

.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  background: var(--cyan-a08);
  border: 1px solid var(--cyan-a28);
  color: var(--cyan);
  margin: 0 5px 5px 0;
}

.thumb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.thumb {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  text-align: center;
}
.thumb .t-num { font-family: var(--mono); font-size: 19px; color: var(--cyan); font-weight: 600; }
.thumb .t-lbl { font-size: 10.5px; color: var(--tx-2); margin-top: 3px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 流程节点（边云协同 / 数据链路示意） */
.flow-node {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--tx-1);
  text-align: center;
  position: relative;
}
.flow-arrow { color: var(--cyan); font-size: 15px; align-self: center; opacity: .7; }

/* 七层架构条目 */
.layer-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--divider-2);
}
.layer-row:last-child { border-bottom: none; }
.layer-no {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--cyan-a13);
  color: var(--cyan);
  border: 1px solid var(--cyan-a30);
}
.layer-main { flex: 1; min-width: 0; }
.layer-name { font-size: 12.5px; color: var(--tx-0); font-weight: 600; }
.layer-role { font-size: 11px; color: var(--tx-3); margin: 2px 0 5px; }

/* 大号 KPI 数字 */
.kpi-big { font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: -1px; color: var(--tx-0); }

/* 告警条目 */
.alert-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider-2);
}
.alert-item:last-child { border-bottom: none; }
.alert-ico { flex: 0 0 3px; border-radius: 2px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 12.5px; color: var(--tx-0); font-weight: 600; margin-bottom: 2px; }
.alert-detail { font-size: 11px; color: var(--tx-2); line-height: 1.55; }
.alert-meta { font-size: 10.5px; color: var(--tx-3); margin-top: 3px; font-family: var(--mono); }

/* 图表容器（高度由 JS 传入，这里给最小高度防止布局抖动） */
.chart-mini { height: 46px; width: 100%; }
.chart-sm { height: 64px; width: 100%; }
.chart-md { height: 96px; width: 100%; }
/* grow 变体：高度由 flex 分配（吸收卡片剩余空间），但设上限，避免曲线被拉得过扁 */
.chart-md.grow { height: auto; min-height: 96px; max-height: 200px; flex: 1 1 auto; }

/* ---------- 15b. 性能指示器（导航内联芯片，让"流畅"可被看见） ---------- */
.fps-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--mute-a10);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx-2);
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  cursor: default;
}
.fps-chip i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: var(--glow-green); flex-shrink: 0;
}
.fps-chip.warn { border-color: var(--amber-a30); }
.fps-chip.warn i { background: var(--amber); box-shadow: 0 0 12px var(--amber-a30); }
.fps-chip.bad { border-color: var(--red-a30); }
.fps-chip.bad i { background: var(--red); box-shadow: var(--glow-red); }
.fps-chip b { color: var(--tx-0); font-weight: 600; }

/* 数字孪生 SVG */
.twin-svg { width: 100%; height: auto; display: block; }
.tw-part { transition: filter var(--t-fast); }

/* ---------- 16. 响应式 ---------- */
@media (max-width: 1500px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1180px) {
  .g-main,
  .g-3,
  .g-4,
  .g-2 { grid-template-columns: 1fr; }
  .brand-txt { display: none; }
}

@media (max-width: 900px) {
  .thumb-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 14px 12px 26px; }
  .page-head h1 { font-size: 19px; }
  .nav { gap: 12px; padding: 0 12px; }
  .nav-links a { padding: 7px 11px; font-size: 12.5px; }
  .clock { display: none; }
}

/* ---------- 17b. 入场动效（让页面"活"起来，而非生硬闪现） ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 页头 / 卡片按序淡入，营造层次感 */
.page-head { animation: rise-in var(--t-slow) var(--ease-out) both; }
.kpi-row > .kpi { animation: rise-in var(--t-slow) var(--ease-out) both; }
.kpi-row > .kpi:nth-child(1) { animation-delay: .02s; }
.kpi-row > .kpi:nth-child(2) { animation-delay: .05s; }
.kpi-row > .kpi:nth-child(3) { animation-delay: .08s; }
.kpi-row > .kpi:nth-child(4) { animation-delay: .11s; }
.kpi-row > .kpi:nth-child(5) { animation-delay: .14s; }
.kpi-row > .kpi:nth-child(6) { animation-delay: .17s; }
.page > .grid,
.page > .card,
.page > section { animation: rise-in var(--t-slow) var(--ease-out) .1s both; }

/* ---------- 17c. 页面切换过渡（消除跳转白屏） ----------
   原理：跳转前先盖一层与平台底色一致的遮罩并淡入，
   新页面加载完成后遮罩淡出，视觉上两页平滑衔接而非"闪白"。 */
#page-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  display: grid;
  place-items: center;
}
#page-veil.on { opacity: 1; pointer-events: all; }
/* 遮罩中央的加载指示（跳转时才可见） */
#page-veil::after {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--cyan);
  animation: veil-spin .7s linear infinite;
  opacity: 0;
  transition: opacity .2s;
}
#page-veil.on::after { opacity: 1; }
@keyframes veil-spin { to { transform: rotate(360deg); } }

/* 首屏导航骨架：JS 注入导航前先撑住高度，
   避免"导航未渲染 → 内容整体上移 → 再回弹"的抖动。
   不设背景色（父级 .nav 已有），仅作高度占位。 */
.nav-skeleton {
  display: block;
  flex: 1;
  height: var(--nav-h);
}

/* ---------- 17. 动效降级 ---------- */
/* 尊重系统的"减弱动态效果"偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 18. 打印（答辩材料留档） ---------- */
@media print {
  body::before,
  body::after { display: none; }
  .nav { position: static; }
  .card,
  .kpi { break-inside: avoid; }
}

/* ---------- 19. 工具类（规范第 3 章：禁用行内样式） ----------
   把此前散落在六个页面 style="" 里的重复写法收敛成语义化工具类。
   命名沿用短横线；只做"原子级"职责，不承载业务含义。 */

/* 19.1 文本颜色 —— 全部映射到设计令牌，不再出现硬编码色值 */
.tx-0 { color: var(--tx-0); }
.tx-1 { color: var(--tx-1); }
.tx-2 { color: var(--tx-2); }
.tx-3 { color: var(--tx-3); }
.tx-cyan { color: var(--cyan); }
.tx-green { color: var(--green); }
.tx-blue { color: var(--blue); }
.tx-purple { color: var(--purple); }
.tx-amber { color: var(--amber); }
.tx-orange { color: var(--orange); }
.tx-red { color: var(--red); }
.tx-mono { font-family: var(--mono); }

/* 19.2 字号 —— 仅收录语义明确的档位，避免"随手写一个 12.5px" */
.fs-10 { font-size: 10.5px; }
.fs-11 { font-size: 11px; }
.fs-tiny { font-size: 11.5px; }
.fs-12 { font-size: 12px; }
.fs-sm { font-size: 12.5px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fw-6 { font-weight: 600; }

/* 19.3 间距 —— mt 系列为主题库中最常用的上边距 */
.mt-5 { margin-top: 5px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-11 { margin-top: 11px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mb-5 { margin-bottom: 5px; }
.mb-6 { margin-bottom: 6px; }
.mb-7 { margin-bottom: 7px; }
.mb-11 { margin-bottom: 11px; }
.mb-14 { margin-bottom: 14px; }
.m-0 { margin: 0; }
.ml-8 { margin-left: 8px; }
.mt-auto { margin-top: auto; }

/* 19.4 布局原子 */
.fl { display: flex; }
.f-col { display: flex; flex-direction: column; }
.f-center { display: flex; align-items: center; }
.f-between { display: flex; align-items: center; justify-content: space-between; }
.f-wrap { flex-wrap: wrap; align-items: stretch; }
.gap-5 { gap: 5px; }
.gap-8 { gap: 8px; }
.gap-14 { gap: 14px; }
.flex-1 { flex: 1; }
.block { display: block; }
.rel { position: relative; }
.w-full { width: 100%; }
.center { justify-content: center; }
.of-auto { overflow: auto; }

/* 19.5 指标组：源码里出现 4 次以上的"尺寸 + 字色 + 字重"组合，直接给语义名 */
.metric-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx-0);
  margin: 6px 0 4px;
}
.metric-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx-0);
}
.metric-note {
  font-size: 11px;
  color: var(--tx-3);
  line-height: 1.6;
}

/* 19.6 图例色点（11×2 圆角条，用于折线图图例） */
.legend-mark {
  width: 11px;
  height: 2px;
  border-radius: 1px;
  display: inline-block;
}
.legend-mark--cyan { background: var(--cyan); }
.legend-mark--amber { background: var(--amber); }

/* 19.7 行内色块（状态分布/占比条，颜色由 JS 决定时配合自定义属性） */
.color-chip {
  background: var(--chip, var(--cyan));
  border-radius: 2px;
}

/* 19.8 微型徽标（紧凑标签，如"实测"） */
.badge-mini {
  font-size: 9.5px;
  padding: 1px 7px;
}

/* 19.9 内嵌面板（用于右侧栏里再包一层的浅底块） */
.inset-panel {
  background: rgba(17, 29, 51, .7);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}

/* 19.10 若干一次性但仍有语义的原子类 */
.metric-lg {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
}
.metric-md {
  font-size: 14px;
  color: var(--tx-0);
}
.metric-md--cyan {
  font-size: 14px;
  color: var(--cyan);
}
.metric-unit {
  color: var(--cyan);
  font-size: 13px;
  width: 72px;
}
.text-soft {
  color: var(--tx-3);
  font-weight: 400;
  margin-left: 6px;
}
.text-center-note {
  text-align: center;
  padding: 26px 0 8px;
  color: var(--tx-3);
  font-size: 11px;
  line-height: 1.8;
}
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.row-tight { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 3px 0 7px;
}
.row-legend {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}
.row-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--tx-3);
}
.row-inline { display: flex; gap: 14px; font-size: 10.5px; color: var(--tx-2); }
.bar-14 { width: 14px; }
.no-border-top { border-top: none; padding-top: 0; }

/* ============================================================
   20. 回放时间轴（replay.html 专用）
   结构：.tl-wrap > .tl-scale（刻度） + .tl-track（轨道） + .tl-foot
   轨道内三类子元素：
     .tl-seg     —— 作业分段底色（区分播种/作业/停机）
     .tl-mark    —— 事件标记（分级配色，hover 出提示）
     .tl-cursor  —— 播放头（可拖）
     .tl-played  —— 已播放进度覆盖层
   ============================================================ */
.tl-wrap {
  position: relative;
  background: var(--track-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 26px 14px 12px;
  user-select: none;
}

/* 刻度：等距排布在轨道正上方，留出 22px 净空，不再被卡片标题压住 */
.tl-scale {
  position: relative;
  height: 16px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--tx-3);
}
.tl-scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.tl-scale span:first-child { transform: none; }
.tl-scale span:last-child { transform: translateX(-100%); }

/* 轨道本体 */
.tl-track {
  position: relative;
  height: 46px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: crosshair;
}

/* 竖向网格线：与刻度一一对应，刻度线穿过轨道 */
.tl-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--track-grid) 1px, transparent 1px);
}

/* 作业分段底色 */
.tl-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--seg-fill, var(--mute-a10));
  border-right: 1px solid var(--divider);
}
.tl-seg-label {
  position: absolute;
  left: 7px;
  top: 5px;
  font-size: 9.5px;
  color: var(--tx-3);
  pointer-events: none;
  letter-spacing: .3px;
}

/* 事件标记：细竖条，颜色透传分级色 */
.tl-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--mark-bg, var(--cyan));
  cursor: pointer;
  transition: width var(--t-fast) var(--ease-out);
}
.tl-mark::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mark-bg, var(--cyan));
  box-shadow: 0 0 6px var(--mark-bg, var(--cyan));
}
.tl-mark:hover { width: 3px; }
.tl-mark.on { width: 3px; }

/* 已播放进度覆盖层 */
.tl-played {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--track-played);
  border-right: 1px solid var(--track-head);
  pointer-events: none;
}

/* 播放头 */
.tl-cursor {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--track-head);
  box-shadow: 0 0 10px var(--cyan-a30);
  pointer-events: none;
}
.tl-cursor::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--track-head);
}

/* 轨道下方说明行 */
.tl-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--tx-3);
}

/* 事件分级图例点 */
.tl-legend { display: flex; gap: 13px; align-items: center; }
.tl-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* 悬浮提示（跟随鼠标） */
.tl-tip {
  position: fixed;
  z-index: var(--z-popup);
  pointer-events: none;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--tx-1);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  max-width: 230px;
}
.tl-tip.on { opacity: 1; transform: translateY(0); }
.tl-tip b { color: var(--tx-0); display: block; margin-bottom: 2px; }
.tl-tip .tl-tip-meta { color: var(--tx-3); font-family: var(--mono); font-size: 10.5px; }

/* ---- 置信度图例（vision 页检测框口径说明） ---- */
.conf-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11px;
  color: var(--tx-2);
}
.conf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.conf-swatch {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  border: 1.5px solid var(--sw, var(--cyan));
  background: color-mix(in srgb, var(--sw, var(--cyan)) 22%, transparent);
}
.conf-swatch--hi { --sw: var(--conf-hi); }
.conf-swatch--mid { --sw: var(--conf-mid); }
.conf-swatch--low { --sw: var(--conf-low); }

/* 目标列表里的置信度色条（替代纯文字着色，层级更清楚） */
.conf-cell { display: inline-flex; align-items: center; gap: 7px; }
.conf-cell .conf-bar {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--bar-track);
  overflow: hidden;
  flex: 0 0 auto;
}
.conf-cell .conf-bar > i {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: var(--sw, var(--cyan));
  border-radius: 2px;
}
.conf-cell .conf-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tx-0);
  min-width: 40px;
}

/* ============================================================
   21. 版面自适应（消除孪生图两侧高度差造成的死空白）
   ============================================================ */
/* 主区左栏卡片撑满，右栏内容顶部对齐；卡片内部用 flex 分配剩余高度 */
.card.fill { display: flex; flex-direction: column; }
.card.fill > .grow { flex: 1 1 auto; min-height: 0; }

/* 孪生画布：按容器高度自适应，不再写死 min-height 造成下方留白 */
.twin-wrap.auto { min-height: 300px; }
.twin-panel .twin-wrap.auto { aspect-ratio: auto; }

/* twin-wrap 内部放的是 <svg class="twin-svg">；
   grow 场景下让 svg 撑满容器高度，用 meet 保持比例（两侧留边由渐变底吸收，
   视觉上不可见），既不拉伸变形，也不留下大片空白。 */
.twin-wrap.auto > .twin-svg,
.card.fill > .grow.twin-wrap > .twin-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 孪生页两栏等高：右栏三张卡片决定行高，左栏孪生图吸收剩余空间 */
.g-main.stretch { align-items: stretch; }
.g-main.stretch > .card.fill > .grow.twin-wrap {
  min-height: 300px;      /* 兜底：右栏内容极短时也不塌成一条 */
}

/* 卡片内部直接承载孪生图时的内边距与圆角衔接 */
.card.fill > .grow.twin-wrap {
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 2px;
}

/* ============================================================
   22. 误差链 · 切口直径尺（平台专属图形）
   四段误差首尾相接摊在一条量程尺上，红色虚线是 10 mm 刀盘半径边界。
   ============================================================ */
.ruler-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--tx-2);
}
.ruler-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ruler-legend b { font-family: var(--mono); font-weight: 600; }

.spin-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  will-change: transform;
}
.scroll-230 { max-height: 230px; overflow: auto; }
.pad-12 { padding: 12px; }
.self-start { align-self: flex-start; }
