/* ============================================================
   News Filter · LPG — operations console
   v18 · single-layer rewrite (2026-06)
   ------------------------------------------------------------
   设计原则(沿用过去边界,不另起体系):
   · 浅色运维台:1 accent(蓝) + 灰阶 + 3 semantic(green/red/amber)
   · 4/8 间距网格 · radius 6/8/10 · 单一 1px hairline 做层次
   · 字号阶 11 / 12 / 13 / 14 / 16 / 18 / 22 / 28(不用碎 .5)
   · 阴影仅功能性 1px 浅影 + focus 环;无暗色装饰阴影
   · CSS-only:HTML 结构、JS hook、SSE、表格、路由全部不动
   本文件整层重写,删除 v1–v17 累积级联,所有现役类在此单层定义。
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* canvas — 深色四级梯度(专业终端 · Datadog/Grafana 调性)*/
  --bg-0: #0c1016;     /* app 背景(近黑蓝)*/
  --bg-1: #141a24;     /* 卡片 / 面板 */
  --bg-2: #1b2330;     /* well / 表头 / 次级块 */
  --bg-3: #232d3d;     /* 更深 well / hover */

  /* hairline — 暗面分层线 */
  --line:        #283143;
  --line-strong: #384357;

  /* text — 4 档(暗底高对比)*/
  --t-1: #e9eef7;
  --t-2: #aab6c9;
  --t-3: #7b8799;
  --t-4: #586577;

  /* accent — 暗底提亮的墨蓝 */
  --accent:      #5b8cff;
  --accent-2:    #3f73f0;
  --accent-bg:   rgba(91, 140, 255, 0.12);
  --accent-bg-2: rgba(91, 140, 255, 0.20);
  --accent-line: rgba(91, 140, 255, 0.40);

  /* semantic — 暗底数据色 */
  --green: #4ed08a;  --green-bg: rgba(78, 208, 138, 0.13);  --green-line: rgba(78, 208, 138, 0.34);
  --red:   #f26d6d;  --red-bg:   rgba(242, 109, 109, 0.13); --red-line:   rgba(242, 109, 109, 0.34);
  --amber: #e3b35a;  --amber-bg: rgba(227, 179, 90, 0.14);  --amber-line: rgba(227, 179, 90, 0.36);

  /* 暗底 surface 复用色(取代旧 #fff / #f7f9fc 硬码)*/
  --surface-input: #0f141d;   /* 输入框 / 终端 feed 底,比卡片更深做"凹陷" */
  --surface-hover: #1f2836;

  /* 4 / 8 网格 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;

  /* radius */
  --r-1: 6px; --r-2: 8px; --r-3: 10px; --r-md: 8px; --r-pill: 999px;

  /* elevation — 暗底用黑影 + 顶部高光描边感 */
  --el-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --el-2: 0 4px 14px rgba(0, 0, 0, 0.45);
  --el-focus: 0 0 0 3px rgba(91, 140, 255, 0.30);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --sidebar-w: 236px;
  --topbar-h:  64px;

  /* legacy alias(JS inline style 仍引用)*/
  --line-2: var(--line);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg-0);
  color: var(--t-1);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
::selection { background: rgba(91, 140, 255, 0.30); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* scrollbar — 细、不抢视觉 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--t-4); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   layout shell
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: var(--s-4) var(--s-3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--s-2) var(--s-4);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-2);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.brand-text .bn { color: var(--t-1); font-size: 14px; font-weight: 700; }
.brand-text .bs { color: var(--t-3); font-size: 10px; letter-spacing: 0.06em; margin-top: 1px; }

.nav-group {
  padding: var(--s-4) var(--s-2) var(--s-1);
  color: var(--t-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: block;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: var(--r-1);
  color: var(--t-2);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--bg-2); color: var(--t-1); text-decoration: none; }
.nav-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -13px; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sidebar-foot {
  margin-top: auto;
  padding: var(--s-3) var(--s-2) 0;
  border-top: 1px solid var(--line);
}
.sf-line { display: flex; justify-content: space-between; font-size: 11px; color: var(--t-3); }
.sf-line .sf-k { color: var(--t-4); }
.sf-line .sf-v { font-family: var(--mono); color: var(--t-2); }

/* ---------- main / topbar ---------- */
.main { background: var(--bg-0); min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  min-width: 0;
  background: rgba(247, 244, 236, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--el-1);
}
.tb-title { flex: 1 1 360px; min-width: 0; max-width: clamp(280px, 27vw, 390px); overflow: hidden; }
.tb-crumbs { display: flex; align-items: center; gap: 6px; color: var(--t-3); font-size: 11px; letter-spacing: 0.02em; }
.tb-crumbs .sep { color: var(--t-4); }
.tb-crumbs .group { color: var(--accent); font-weight: 650; }
.tb-h1 { margin: 2px 0 0; min-width: 0; overflow: hidden; display: flex; align-items: baseline; gap: 10px; }
.tb-h1 #vh-title { flex: 0 0 auto; color: var(--t-1); font-size: 18px; font-weight: 700; }
.tb-h1 .tb-meta {
  display: block; min-width: 0; flex: 1 1 auto;
  color: var(--t-3); font-size: 12px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-spacer { flex: 1 1 auto; }
.tb-pills { display: flex; align-items: center; gap: var(--s-2); flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.tb-clock { color: var(--t-3); font-size: 12px; font-family: var(--mono); flex: 0 0 auto; }

/* status pills */
.ss-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  max-width: 190px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--t-2);
  white-space: nowrap;
}
.ss-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--t-4); flex: 0 0 auto; }
.ss-pill .ss-k { font-size: 11px; color: var(--t-3); letter-spacing: 0.02em; }
.ss-pill .ss-v { font-size: 11px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ss-pill.ok    { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.ss-pill.ok::before { background: var(--green); }
.ss-pill.err   { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.ss-pill.err::before { background: var(--red); }
.ss-pill.warn,
.ss-pill.degraded { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); }
.ss-pill.warn::before, .ss-pill.degraded::before { background: var(--amber); }
.ss-pill.off,
.ss-pill.idle  { background: var(--bg-2); color: var(--t-3); }
.ss-pill.connecting { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent); }
.ss-pill.connecting::before { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- content ---------- */
.content { max-width: 1480px; padding: var(--s-5) var(--s-6) 84px; width: 100%; }

.section { margin-bottom: var(--s-5); }
/* 路由:一次只显示一个 section(hash router 切换 data-route-active) */
.main .section { display: none; }
.main .section[data-route-active="1"] { display: block; }
.section > h2 {
  margin: 0 0 var(--s-3);
  font-size: 11px;
  font-weight: 700;
  color: var(--t-3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.section > h2 .h2-sub { color: var(--t-4); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; }
/* 路由激活的 section 隐藏自身 h2(顶栏已显示标题) */
.main .section[data-route-active="1"] > h2 { display: none; }
.section h3 { margin: var(--s-4) 0 var(--s-2); font-size: 12px; font-weight: 700; color: var(--t-2); letter-spacing: 0.02em; }

/* page-head 引导条 */
.page-head { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-2); box-shadow: var(--el-1); }
.ph-purpose { color: var(--t-1); font-size: 13px; line-height: 1.6; }
.ph-purpose b { color: var(--accent); font-weight: 650; }
.ph-how { color: var(--t-3); font-size: 12px; line-height: 1.6; margin-top: 4px; }
.ph-how b { color: var(--t-2); }
.ph-how code { font-family: var(--mono); font-size: 11px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--t-2); }

/* ============================================================
   primitives: card / note / details / toolbar / form
   ============================================================ */
.card, .panel, .table-wrap, .cfg-rows {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--el-1);
}
/* card 内容容器 + 状态色左条(debug 运行输出、翻译块等用)*/
.card { padding: var(--s-4); }
.card > h3 { margin: 0 0 var(--s-3); font-size: 13px; font-weight: 700; color: var(--t-1); letter-spacing: 0; }
.card.pass { border-left: 3px solid var(--green); }
.card.fail { border-left: 3px solid var(--red); }
.card.warn { border-left: 3px solid var(--amber); }
.card.pass > h3 { color: var(--green); }
.card.fail > h3 { color: var(--red); }
.card.warn > h3 { color: var(--amber); }

.kb-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-width: 0;
  padding: var(--s-4);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--el-1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.kb-card:hover { border-color: var(--line-strong); box-shadow: var(--el-2); }
.kb-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); min-width: 0; flex-wrap: wrap; row-gap: 4px; }
.kb-head > div { min-width: 0; }
.kb-title { color: var(--t-1); font-size: 14px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.kb-sub { color: var(--t-3); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.kb-body { min-width: 0; }

/* note */
.note { color: var(--t-2); font-size: 12px; line-height: 1.65; }
details.note, details {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--el-1);
}
details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  color: var(--t-2);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '';
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--t-4);
  transition: transform 0.12s ease;
  flex: 0 0 auto;
}
details[open] > summary::before { transform: rotate(90deg); }
details[open] { padding-bottom: var(--s-3); }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
details .note, details > div { padding: 0 14px; color: var(--t-2); font-size: 12px; line-height: 1.65; }

/* toolbar + form fields */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: end;
  margin-bottom: var(--s-3);
  padding: var(--s-3);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--el-1);
  min-width: 0;
}
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field-flex { flex: 1 1 200px; }
.field label, .toolbar label { color: var(--t-3); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }

input, select, textarea {
  min-height: 34px;
  padding: 6px 10px;
  background: var(--surface-input);
  color: var(--t-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font-family: var(--sans);
  font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea { line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: var(--t-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--el-focus); }
input::placeholder, textarea::placeholder { color: var(--t-4); }

/* buttons */
button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--r-1);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.04s ease;
}
button:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
button:active:not(:disabled) { transform: translateY(0.5px); }
button:focus-visible { outline: none; box-shadow: var(--el-focus); }
button:disabled { background: var(--bg-2); border-color: var(--line); color: var(--t-4); cursor: not-allowed; }
button.ghost { background: var(--bg-2); color: var(--t-2); border: 1px solid var(--line-strong); font-weight: 550; }
button.ghost:hover:not(:disabled) { background: var(--bg-3); border-color: var(--t-4); color: var(--t-1); }
button.ghost:disabled { background: var(--bg-2); color: var(--t-4); border-color: var(--line); }

/* kbd / inline code */
.kbd, code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--t-2);
}
pre { background: var(--surface-input); border: 1px solid var(--line); border-radius: var(--r-1); color: var(--t-2); padding: 10px 12px; overflow: auto; }

/* loading + spinner + muted + empty */
.loading { position: relative; color: var(--t-3); font-size: 12px; }
.loading::after {
  content: '';
  display: inline-block;
  width: 13px; height: 13px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--t-3); font-size: 12px; }
.lock { color: var(--t-4); }

/* ============================================================
   semantic text + chips + pills
   ============================================================ */
.pass { color: var(--green); font-weight: 600; }
.fail { color: var(--red); font-weight: 600; }
.amber { color: var(--amber); font-weight: 600; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.ts { color: var(--t-3); font-size: 11px; font-family: var(--mono); white-space: nowrap; }

.chip, .chip-group .chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin: 1px 2px 1px 0;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--t-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip.kw, .chip.src { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.chip-group { display: inline-flex; flex-wrap: wrap; gap: 2px; align-items: center; }

/* direction colored chips */
.dir-利多 { background: var(--green-bg); border: 1px solid var(--green-line); color: var(--green); border-radius: var(--r-pill); padding: 0 8px; height: 20px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; }
.dir-利空 { background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red); border-radius: var(--r-pill); padding: 0 8px; height: 20px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; }
.dir-中性 { background: var(--bg-2); border: 1px solid var(--line); color: var(--t-2); border-radius: var(--r-pill); padding: 0 8px; height: 20px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; }
.dir-不确定 { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber); border-radius: var(--r-pill); padding: 0 8px; height: 20px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; }

/* run-state pill (历史/finflow 行 + handoff) */
.hn-pill, .s-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--t-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hn-pill.idle { color: var(--t-4); }
.hn-pill.queued, .s-chip.s-queued { background: var(--bg-2); color: var(--t-3); }
.hn-pill.running, .s-chip.s-running { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.hn-pill.passed, .s-chip.s-succeeded { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.hn-pill.processed, .hn-pill.skipped { background: var(--bg-3); color: var(--t-3); }
.hn-pill.rejected, .s-chip.s-partial { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.hn-pill.error, .s-chip.s-failed, .s-chip.s-canceled { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }

/* ============================================================
   tables
   ============================================================ */
table.t, .src-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.t thead { position: static; }
table.t th, .src-table th {
  background: var(--bg-2);
  color: var(--t-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.t td, .src-table td {
  color: var(--t-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tbody tr, .src-table tbody tr { transition: background 0.1s ease; }
table.t tbody tr:hover, .src-table tbody tr:hover { background: var(--accent-bg); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t .title, .src-table .src-name { color: var(--t-1); }
.src-table .src-name { font-family: var(--mono); }
.src-table .src-rate { display: inline-block; min-width: 38px; text-align: right; font-family: var(--mono); }

/* bars */
.score-bar, .src-rate-bar { display: inline-block; width: 90px; height: 4px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; margin-right: 8px; vertical-align: middle; }
.score-bar > span, .src-rate-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.src-rate-bar.high > span { background: var(--green); }
.src-rate-bar.low  > span { background: var(--red); }
.src-rate-bar.mid  > span { background: var(--amber); }

.progress-bar { display: block; width: 100%; height: 6px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; position: relative; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 0.25s ease; }
.progress-bar.has-err > span { background: var(--green); }
.progress-bar .err-track { position: absolute; top: 0; right: 0; height: 100%; background: var(--red); }

/* kv list */
.kv { font-size: 12px; }
.kv > div { display: grid; grid-template-columns: 120px 1fr; gap: var(--s-3); padding: 6px 0; align-items: start; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv .k { color: var(--t-3); }
.kv .v { color: var(--t-1); min-width: 0; overflow-wrap: anywhere; }
/* kv 内的表单控件铺满列宽(否则 input 维持默认窄宽,视觉很挤) */
.kv .v input, .kv .v textarea, .kv .v select { width: 100%; }

/* ============================================================
   KPI tiles
   ============================================================ */
.grid-tiles { display: grid; grid-template-columns: repeat(5, minmax(132px, 1fr)); gap: var(--s-3); }
/* 驾驶舱 KPI 共 12 个 → 6 列 × 2 行整齐排,不再 5/5/2 留尾 */
#overview_kpi .grid-tiles { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
#overview_kpi .tile { min-height: 78px; padding: var(--s-3) var(--s-4); }
#overview_kpi .tile .tl-value { font-size: 24px; }
/* tile 数值不换行截断 → 长金额/百分比挤成 ¥0. 这种;允许收缩字体并防溢出 */
.tile .tl-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile {
  position: relative;
  display: block;
  min-height: 90px;
  padding: var(--s-4);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: var(--el-1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.06s ease;
}
.tile:hover { box-shadow: var(--el-2); transform: translateY(-1px); }
.tile.accent { border-left-color: var(--accent); }
.tile.green  { border-left-color: var(--green); }
.tile.red    { border-left-color: var(--red); }
.tile.amber  { border-left-color: var(--amber); }
.tile.muted  { border-left-color: var(--line-strong); }
.tile .tl-label { color: var(--t-3); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.tile .tl-value { color: var(--t-1); font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.tile.accent .tl-value { color: var(--accent); }
.tile.green .tl-value  { color: var(--green); }
.tile.red .tl-value    { color: var(--red); }
.tile.amber .tl-value  { color: var(--amber); }
.tile.muted .tl-value  { color: var(--t-2); font-size: 16px; line-height: 1.25; font-family: var(--mono); word-break: break-word; }
.tile .tl-spark { display: block; width: 100%; height: 18px; margin-top: 4px; opacity: 0.75; pointer-events: none; }
.tile .tl-delta { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 11px; font-family: var(--mono); vertical-align: middle; }
.tile .tl-delta.up   { color: var(--green); }
.tile .tl-delta.down { color: var(--red); }
.tile .tl-delta.flat { color: var(--t-3); }
.tile .tl-delta.up::before   { content: '▲'; font-size: 8px; }
.tile .tl-delta.down::before { content: '▼'; font-size: 8px; }
.tile .tl-delta.flat::before { content: '·'; }

/* ============================================================
   cockpit (overview 首屏) — hero(整宽) + ops(2 列自适应高)
   ============================================================ */
/* Hero:标题/目标在上,四段流水线卡在下,整宽不再左右撞高度 */
.cockpit-hero {
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--el-1);
  margin: 0 0 var(--s-3);
}
.cockpit-hero-head {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.cockpit-eyebrow { font-size: 10px; color: var(--t-4); font-weight: 700; letter-spacing: 0.08em; font-family: var(--mono); }
.cockpit-title { font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--t-1); margin-top: 4px; }
.cockpit-goal { color: var(--t-2); font-size: 13px; line-height: 1.7; }
.cockpit-goal-text { }
.cockpit-goal-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: 10px; }
.cockpit-goal-meta span { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg-2); color: var(--t-3); font-size: 11px; }
.cockpit-goal-meta b { color: var(--t-1); font-family: var(--mono); font-weight: 600; }

.cockpit-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.cockpit-stage { min-height: 104px; display: grid; grid-template-rows: 24px auto; gap: var(--s-2); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-2); transition: border-color 0.12s ease; position: relative; }
.cockpit-stage:not(:last-child)::after { content: '→'; position: absolute; right: calc(var(--s-3) / -2 - 4px); top: 50%; transform: translateY(-50%); color: var(--t-4); font-size: 13px; z-index: 1; }
.cockpit-stage:hover { border-color: var(--accent-line); }
.cockpit-stage .cs-num { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 50%; color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.cockpit-stage .cs-name { color: var(--t-1); font-weight: 600; font-size: 13px; }
.cockpit-stage .cs-out { color: var(--t-3); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }

/* ops 行:待办(宽)+ 边界(窄),align-items:start 不强制等高 → 消灭空洞 */
.cockpit-ops {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: var(--s-3);
  align-items: start;
  margin: 0 0 var(--s-4);
}
.cockpit-panel {
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-2);
  padding: var(--s-4);
  box-shadow: var(--el-1);
  min-width: 0;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.cockpit-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); color: var(--t-1); font-size: 12px; font-weight: 700; }
.cockpit-panel-head a, .cockpit-panel-head span + span { color: var(--t-3); font-size: 11px; font-weight: 500; }

.cockpit-boundaries { display: grid; gap: var(--s-1); }
.cockpit-boundary { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 2px 8px; align-items: baseline; padding: 7px 9px; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-1); background: var(--bg-2); }
.cockpit-boundary.ok   { border-left-color: var(--green); }
.cockpit-boundary.warn { border-left-color: var(--amber); }
.cockpit-boundary.off  { border-left-color: var(--t-4); }
.cb-state { color: var(--t-3); font-size: 10px; font-family: var(--mono); font-weight: 600; }
.cb-label { color: var(--t-1); font-weight: 600; font-size: 12px; }
.cb-evidence { grid-column: 2; color: var(--t-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cockpit-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.cockpit-count { min-height: 58px; display: flex; flex-direction: column; justify-content: space-between; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-2); }
.cockpit-count span { color: var(--t-3); font-size: 10px; font-family: var(--mono); letter-spacing: 0.04em; }
.cockpit-count b { color: var(--t-1); font-size: 18px; line-height: 1; }

.cockpit-actions { display: grid; gap: var(--s-2); }
.cockpit-action { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 8px; padding: var(--s-2); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-1); background: var(--bg-2); transition: border-color 0.12s ease, background 0.12s ease; }
.cockpit-action:hover { background: var(--bg-1); border-color: var(--line-strong); text-decoration: none; }
.cockpit-action.ok   { border-left-color: var(--green); }
.cockpit-action.warn { border-left-color: var(--amber); }
.cockpit-action.off  { border-left-color: var(--t-4); }
.ca-state { color: var(--t-3); font-size: 10px; font-family: var(--mono); font-weight: 600; }
.ca-main { color: var(--t-1); font-size: 12px; font-weight: 600; }
.ca-meta { grid-column: 2; color: var(--t-3); font-size: 11px; font-family: var(--mono); overflow-wrap: anywhere; }

/* ============================================================
   overview kanban rows + funnel + venn + dir + hist + strat + conf
   ============================================================ */
.kb-row { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.kb-row-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kb-row-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kb-row-3 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.kb-row-4 { grid-template-columns: 1fr; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }

/* funnel */
.fn-strip { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr 18px 1fr 18px 1fr; align-items: stretch; gap: 0; }
.fn-stage { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-2); min-height: 96px; }
.fn-stage.accent { border-color: var(--accent-line); background: var(--accent-bg); }
.fn-stage .fs-name { font-size: 10px; color: var(--t-3); letter-spacing: 0.05em; text-transform: uppercase; }
.fn-stage .fs-value { font-size: 22px; font-weight: 700; color: var(--t-1); }
.fn-stage.accent .fs-value { color: var(--accent); }
.fn-stage .fs-meta { font-size: 10px; color: var(--t-3); }
.fn-arrow { align-self: center; justify-self: center; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-line) 50%, transparent); position: relative; }
.fn-arrow::after { content: ''; position: absolute; top: 50%; right: 0; transform: translateY(-50%); border-left: 5px solid var(--accent-line); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.fn-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: var(--s-2); padding-top: var(--s-2); }
.fn-ch { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-2); }
.fn-ch-k { font-size: 10px; color: var(--t-3); letter-spacing: 0.04em; text-transform: uppercase; }
.fn-ch-v { font-size: 14px; font-weight: 700; color: var(--t-1); margin: 2px 0; }
.fn-ch-bar { height: 4px; border-radius: var(--r-pill); background: var(--bg-3); overflow: hidden; }
.fn-ch-bar > span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.fn-ch-note { font-size: 10px; color: var(--t-4); padding-top: var(--s-2); }

/* venn overlap rows (ov-grid) */
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-1); }
.ov-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 11px; border-radius: var(--r-1); background: var(--bg-2); font-size: 12px; }
.ov-row.bold { background: var(--accent-bg); border: 1px solid var(--accent-line); }
.ov-row.bold .ov-v { color: var(--accent); }
.ov-row .ov-k { font-size: 11px; color: var(--t-2); font-family: var(--mono); }
.ov-row .ov-v { color: var(--t-1); font-weight: 600; font-family: var(--mono); }

/* direction bars */
.dir-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.dir-row { display: grid; grid-template-columns: 52px 1fr 60px; gap: var(--s-3); align-items: center; }
.dir-name { font-size: 12px; color: var(--t-2); font-weight: 500; }
.dir-bar { height: 16px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; }
.dir-bar > span { display: block; height: 100%; border-radius: var(--r-pill); }
.dir-bar.bull > span { background: var(--green); }
.dir-bar.bear > span { background: var(--red); }
.dir-bar.neutral > span { background: var(--t-3); }
.dir-bar.unsure > span { background: var(--amber); }
.dir-pct { text-align: right; font-size: 11px; font-family: var(--mono); color: var(--t-2); }

/* histogram */
.hist-frame { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-3); align-items: end; min-height: 124px; padding: 18px 0 4px; }
.hist-frame::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background-image: linear-gradient(90deg, var(--line-strong) 50%, transparent 50%); background-size: 6px 1px; pointer-events: none; }
.hist-col { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hist-bar { width: 100%; background: linear-gradient(180deg, var(--accent) 0%, rgba(91,140,255,0.3) 100%); border-radius: var(--r-1) var(--r-1) 0 0; min-height: 4px; position: relative; transition: filter 0.15s ease; }
.hist-bar:hover { filter: brightness(1.18); }
.hist-bar .hb-cap { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--t-2); }
.hist-label { font-size: 10px; color: var(--t-3); font-family: var(--mono); }

/* strategy + confidence */
.strat-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.strat-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; border-radius: var(--r-1); background: var(--bg-2); }
.strat-name { color: var(--t-2); font-size: 12px; }
.strat-n { font-family: var(--mono); font-size: 11px; color: var(--t-2); }
.strat-n b { color: var(--accent); }
.conf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-1); }
.conf-cell { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-2); }
.conf-cell .cc-k { font-size: 10px; color: var(--t-3); letter-spacing: 0.04em; text-transform: uppercase; }
.conf-cell .cc-v { color: var(--accent); font-size: 18px; font-weight: 700; }

/* trend (sparkline rows) */
.trend-frame { display: flex; flex-direction: column; gap: var(--s-3); }
.trend-row { display: grid; grid-template-columns: 84px 1fr 44px; gap: var(--s-3); align-items: center; }
.trend-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--t-2); font-weight: 500; }
.trend-total { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--t-1); font-weight: 600; }
.trend-svg { width: 100%; height: 32px; display: block; }

/* contract grid + sql block */
.contract-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.contract-cell { display: flex; flex-direction: column; gap: var(--s-1); padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--r-1); background: var(--bg-2); }
.contract-cell.ok { border-left-color: var(--green); }
.contract-cell.warn { border-left-color: var(--amber); }
.contract-cell.off { border-left-color: var(--t-4); }
.contract-cell .ck { font-size: 10px; color: var(--t-3); letter-spacing: 0.04em; text-transform: uppercase; }
.contract-cell .cv { color: var(--t-1); font-size: 12px; font-family: var(--mono); overflow-wrap: anywhere; }
.contract-sql { margin-top: var(--s-3); padding: var(--s-3); background: var(--surface-input); border: 1px solid var(--line); border-radius: var(--r-1); font-family: var(--mono); font-size: 11px; line-height: 1.7; color: var(--t-2); overflow-x: auto; }
.contract-sql .sql-kw { color: #c08cff; }
.contract-sql .sql-tbl { color: var(--accent); }
.contract-sql .sql-col { color: var(--t-1); }
.contract-sql .sql-meta { color: var(--t-4); }

.checkline { display: inline-flex; align-items: center; gap: 6px; height: 32px; color: var(--t-2); font-size: 12px; }

/* ============================================================
   stage strip (debug) + funnel mini
   ============================================================ */
.stage-strip { display: flex; align-items: center; gap: 0; margin-bottom: var(--s-3); padding: 8px 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--el-1); font-size: 11px; overflow-x: auto; }
.ss-step { display: flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; }
.ss-step:not(:last-child)::after { content: '→'; color: var(--t-4); margin-left: 12px; }
.ss-step-name { color: var(--t-1); font-weight: 600; }
.ss-step-meta { color: var(--t-3); }

/* ============================================================
   runbar (历史/finflow/handoff 选择条)
   ============================================================ */
.runbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3); background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: var(--r-2); min-width: 0; }
.rb-select { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.rb-count { color: var(--t-2); font-size: 12px; }
.rb-count b { color: var(--accent); font-family: var(--mono); }
.rb-action { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

/* mini job panel (hn/ff 专属) */
.hn-job-card { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-1); box-shadow: var(--el-1); margin-top: var(--s-3); }
.hn-job-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); flex-wrap: wrap; }
.hn-job-meta { font-size: 12px; color: var(--t-3); margin-top: var(--s-2); }
.hn-job-meta b { color: var(--t-1); }

/* live job feed */
.job-live-feed { margin-top: var(--s-2); max-height: 220px; overflow-y: auto; font-size: 11px; font-family: var(--mono); background: #080b10; border: 1px solid var(--line); border-radius: var(--r-1); padding: 8px 10px; line-height: 1.6; color: var(--t-2); }
.job-live-feed .ev-ok { color: var(--green); }
.job-live-feed .ev-fail { color: var(--red); }
.job-live-feed .ev-meta { color: var(--t-3); }

/* ============================================================
   trace drilldown (events)
   ============================================================ */
.trace-btn { min-height: 26px; padding: 0 10px; font-size: 11px; }
.trace-expand-row > td { padding: 0 !important; background: var(--bg-2); }
.trace-panel { padding: var(--s-3) var(--s-4); }
.trace-list { display: grid; gap: var(--s-2); }
.trace-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-1); }
.trace-row.live-row { border-left: 3px solid var(--accent); }
.trace-meta { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; color: var(--t-3); font-size: 11px; font-family: var(--mono); }
.trace-title { margin-top: 5px; color: var(--t-1); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.trace-sub { margin-top: 3px; color: var(--t-3); font-size: 11px; font-family: var(--mono); overflow-wrap: anywhere; }
.trace-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.trace-head .trace-title { margin-top: 0; }
.trace-stages { display: grid; gap: var(--s-2); }
.trace-stage { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-1); }
.trace-stage .ts-head { font-size: 10px; color: var(--t-3); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.trace-stage .kv .k { font-size: 10px; }

/* trace timeline */
.trace-timeline { margin: 0 0 var(--s-3); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-1); padding: 12px 14px 8px; }
.trace-timeline .tl-track { position: relative; height: 16px; margin: 4px 4px 12px; background: linear-gradient(90deg, var(--line-strong), var(--line)); background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 50%; }
.trace-timeline .tl-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-1); cursor: help; box-shadow: 0 0 0 2px rgba(91,140,255,0.20); }
.trace-timeline .tl-dot.skipped { background: var(--t-4); opacity: 0.5; box-shadow: none; }
.trace-timeline .tl-footer { font-size: 11px; color: var(--t-3); }
.trace-timeline .tl-footer b { font-size: 11px; color: var(--t-1); }
.trace-timeline .tl-legend { display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: 11px; }
.trace-timeline .tl-leg { display: inline-flex; align-items: center; gap: 5px; color: var(--t-3); }
.trace-timeline .tl-leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.trace-timeline .tl-leg-ms { font-size: 11px; font-family: var(--mono); }

/* ============================================================
   config
   ============================================================ */
.cfg-subtabs { display: flex; flex-wrap: wrap; gap: var(--s-1); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 4px; margin-bottom: var(--s-3); }
.cfg-tab { min-height: 30px; padding: 4px 12px; background: transparent; color: var(--t-2); border: 1px solid transparent; border-radius: var(--r-1); font-size: 12px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.cfg-tab:hover:not(.active) { background: var(--bg-1); color: var(--t-1); }
.cfg-tab.active { background: var(--bg-1); border-color: var(--accent-line); color: var(--accent); box-shadow: var(--el-1); }
.cfg-tab-count, .cfg-tab-ovr { font-size: 10px; color: var(--t-4); }
.cfg-rows { overflow: hidden; }
.cfg-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(160px, 320px) auto; gap: var(--s-4); align-items: center; padding: 12px var(--s-4); border-bottom: 1px solid var(--line); background: var(--bg-1); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row.is-ovr { background: var(--amber-bg); }
.cfg-key { font-family: var(--mono); font-size: 12px; color: var(--t-1); font-weight: 600; }
.cfg-meta { font-size: 11px; color: var(--t-3); margin-top: 2px; }
.cfg-meta .cfg-default { color: var(--t-3); }
.cfg-meta .cfg-default code { font-size: 10px; }
.cfg-input { display: flex; min-width: 0; }
.cfg-input input, .cfg-input select { width: 100%; background: var(--surface-input); }
.cfg-actions { display: flex; gap: var(--s-1); justify-content: flex-end; }
.cfg-actions button { min-height: 30px; padding: 0 10px; font-size: 12px; }
.cfg-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-pill); margin-left: 4px; vertical-align: middle; letter-spacing: 0.06em; text-transform: uppercase; }
.cfg-badge.ovr { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber); }

/* ============================================================
   external integrations
   ============================================================ */
.ext-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.ext-card { padding: var(--s-3) var(--s-4); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--el-1); }
.ext-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.ext-title { color: var(--t-1); font-size: 14px; font-weight: 700; }
.ext-sub { color: var(--t-3); font-size: 11px; }
.ext-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--bg-2); color: var(--t-3); }
.ext-pill.ok { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.ext-pill.off { background: var(--bg-2); color: var(--t-3); }
.ext-pill.err { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.ext-body .k { color: var(--t-3); }
.ext-body .row { display: grid; grid-template-columns: 76px 1fr; gap: var(--s-2); padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.ext-body .row:last-child { border-bottom: 0; }
.ext-hint { color: var(--t-3); font-size: 11px; margin-top: var(--s-2); }
.ext-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px dashed var(--line); }
.ext-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; font-size: 11px; font-family: var(--sans); color: var(--t-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-1); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.1s, color 0.1s, border-color 0.1s; }
.ext-btn:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); text-decoration: none; }
.ext-btn[disabled], .ext-btn.probing { opacity: 0.6; cursor: progress; pointer-events: none; }
.ext-btn.copied { color: var(--green); border-color: var(--green-line); background: var(--green-bg); }
.ext-error-fold { margin-top: 6px; }
.ext-error-fold > summary { font-size: 10px; color: var(--red); cursor: pointer; list-style: none; padding: 4px 8px; background: var(--red-bg); border: 1px solid var(--red-line); border-radius: var(--r-1); font-family: var(--mono); }
.ext-error-fold > summary::-webkit-details-marker { display: none; }
.ext-error { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 11px; color: var(--red); }
.maxkb-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-1); }

/* ============================================================
   misc (placeholder / audit / test-report adv)
   ============================================================ */
.audit-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
#sec-audit > .kb-row { grid-template-columns: 1fr !important; }
#sec-audit table { width: 100%; table-layout: fixed; }
#sec-audit th, #sec-audit td { overflow-wrap: anywhere; word-break: break-word; }

details.tr-adv { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-1); box-shadow: var(--el-1); }
details.tr-adv > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--t-2); display: flex; align-items: center; gap: var(--s-2); }
details.tr-adv > summary::-webkit-details-marker { display: none; }
details.tr-adv > summary::before { content: '▸'; color: var(--t-3); font-size: 11px; border: 0; width: auto; height: auto; }
details.tr-adv[open] > summary::before { content: '▾'; transform: none; }
details.tr-adv[open] > summary { border-bottom: 1px solid var(--line); }

/* keywords / prompts editor textareas */
#sec-keywords .kb-card, #sec-prompts .kb-card { margin-bottom: var(--s-3); }
#sec-keywords textarea, #sec-prompts textarea { min-height: 220px; max-height: min(420px, 42vh); font-size: 12px; line-height: 1.55; font-family: var(--mono); width: 100%; }
#sec-keywords .chip-group, #sec-prompts .chip-group { justify-content: flex-end; }

/* alert banner (顶栏下全局红条) */
#alert-banner { position: sticky; top: var(--topbar-h); z-index: 25; }

/* ============================================================
   debug 单条流水线页 — stage 分段 + idle 占位更立体
   ============================================================ */
#sec-debug h3 {
  margin: var(--s-5) 0 var(--s-2);
  padding-left: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--t-1);
  letter-spacing: 0;
  border-left: 3px solid var(--accent);
}
/* details.note 在 debug 里做成可展开的方法说明卡 */
#sec-debug details.note { background: var(--bg-1); }
#sec-debug details.note > summary { font-size: 12px; color: var(--t-2); }
/* 各 stage 的 idle / 结果容器:用 well 卡片而非裸文字 */
#sec-debug #recall,
#sec-debug #coarse,
#sec-debug #fine {
  margin-top: var(--s-3);
  padding: var(--s-4);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--el-1);
  color: var(--t-3);
  font-size: 12px;
}
/* idle 占位的提示色 + 小圆点 */
#sec-debug #recall:not(:has(.card)),
#sec-debug #coarse:not(:has(.card)),
#sec-debug #fine:not(:has(.card)) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: var(--bg-2);
  border-style: dashed;
  box-shadow: none;
}
#sec-debug #recall:not(:has(.card))::before,
#sec-debug #coarse:not(:has(.card))::before,
#sec-debug #fine:not(:has(.card))::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--t-4);
  flex: 0 0 auto;
}
/* debug 输入卡:把 stage0 的 kv + 运行按钮包成一张卡观感 */
#sec-debug .kv { padding: var(--s-3) var(--s-4); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--el-1); }
#sec-debug .kv > div { grid-template-columns: 64px 1fr; }
/* debug 内 card grid 间距 */
#sec-debug .grid3 { gap: var(--s-3); margin-top: var(--s-3); }
#sec-debug .grid3 .card { padding: var(--s-3) var(--s-4); }
#sec-debug .grid3 .card > h3 { margin: 0 0 var(--s-2); padding-left: 0; border-left: 0; font-size: 12px; }

/* ============================================================
   cost workspace
   ============================================================ */
.cost-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: var(--s-3);
  align-items: stretch;
  margin: var(--s-3) 0;
}
.cost-hero-main,
.cost-budget-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-1);
  box-shadow: var(--el-1);
  padding: var(--s-4);
}
.cost-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.cost-hero-title {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
  color: var(--t-1);
}
.cost-hero-sub {
  max-width: 760px;
  margin-top: var(--s-2);
  color: var(--t-3);
  font-size: 12px;
}
.cost-model-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.cost-model-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-2);
  color: var(--t-3);
  font-size: 11px;
}
.cost-model-pill b {
  color: var(--t-1);
  font-family: var(--mono);
  font-weight: 650;
}
.cost-budget-panel { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-3); }
.cost-budget-top {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  align-items: flex-start;
}
.cost-small-label {
  color: var(--t-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.cost-budget-value {
  margin-top: 2px;
  color: var(--t-1);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 760;
  line-height: 1.15;
}
.cost-budget-edit { display: flex; gap: 6px; align-items: center; }
.cost-budget-edit input { width: 96px; }
.cost-meter {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-input);
  border: 1px solid var(--line);
}
.cost-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  max-width: 100%;
}
.cost-meter i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  transform: translateX(-1px);
  background: var(--amber);
  opacity: 0.9;
}
.cost-budget-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--t-3);
  font-size: 11px;
}
.cost-budget-status { min-height: 16px; color: var(--t-3); font-size: 11px; }
.cost-tile {
  min-height: 86px;
  padding: var(--s-3) var(--s-4);
}
.cost-tile .tl-value { font-size: 22px; line-height: 1.15; }
.cost-tile-sub {
  margin-top: 4px;
  color: var(--t-3);
  font-size: 11px;
  line-height: 1.35;
}
.cost-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.cost-table { min-width: 760px; }
.cost-table thead th {
  background: var(--bg-2);
  color: var(--t-3);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.cost-table tbody tr.is-active { background: var(--accent-bg); }
.cost-table tbody tr.is-active td { border-color: var(--accent-line); }
.cost-row-sub {
  margin-top: 3px;
  color: var(--t-4);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 500;
  max-width: 460px;
}
.cost-active-dot {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--green-bg);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.cost-alert {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  padding: 9px 11px;
  border: 1px solid var(--amber-line);
  border-radius: var(--r-2);
  background: var(--amber-bg);
  color: var(--t-2);
  font-size: 12px;
}
.cost-note {
  margin-top: var(--s-2);
  color: var(--t-3);
  font-size: 11px;
  line-height: 1.5;
}
.cost-reco-list {
  margin: 0;
  padding-left: 18px;
  color: var(--t-2);
  font-size: 12px;
  line-height: 1.75;
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1320px) {
  .topbar { height: auto; min-height: var(--topbar-h); align-items: flex-start; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .tb-title { flex-basis: 100%; max-width: none; }
  .tb-h1, .tb-crumbs { white-space: normal; }
  .tb-spacer { display: none; }
  .tb-pills { width: calc(100% - 92px); flex-wrap: wrap; justify-content: flex-start; }
  .tb-clock { margin-left: auto; }
}

@media (max-width: 1180px) {
  .cockpit-ops { grid-template-columns: 1fr; }
  .cockpit-hero-head { grid-template-columns: 1fr; gap: var(--s-3); }
  .cost-hero { grid-template-columns: 1fr; }
  .grid-tiles { grid-template-columns: repeat(3, minmax(132px, 1fr)); }
  #sec-overview .kb-row, .kb-row-1, .kb-row-2, .kb-row-3 { grid-template-columns: 1fr !important; }
}

@media (max-width: 920px) {
  .audit-split, .ext-grid { grid-template-columns: 1fr; }
  .fn-strip { grid-template-columns: 1fr 12px 1fr 12px 1fr; }
  .cockpit-stages { grid-template-columns: repeat(2, 1fr); }
  .cockpit-stage:not(:last-child)::after { display: none; }
}

@media (max-width: 820px) {
  .cockpit-stages, .cockpit-counts { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--line); white-space: nowrap;
  }
  .brand { flex: 0 0 auto; padding: 0 12px 0 0; margin: 0 6px 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .nav-group, .sidebar-foot { display: none; }
  .nav-item { flex: 0 0 auto; min-height: 30px; margin: 0; }
  .nav-item.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .content { padding: var(--s-4) var(--s-4) 64px; }
  .grid-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-pills { width: 100%; }
  .tb-clock { margin-left: 0; }
}

@media (max-width: 640px) {
  .grid-tiles { grid-template-columns: 1fr; }
  .toolbar, .runbar { flex-direction: column; align-items: stretch; }
  .toolbar .field, .toolbar .field-flex { width: 100%; }
  .cost-budget-top, .cost-budget-meta { flex-direction: column; align-items: stretch; }
  .cost-budget-edit { align-items: stretch; }
  .cost-budget-edit input, .cost-budget-edit button { width: 100%; }
  .contract-grid, .conf-grid, .ov-grid { grid-template-columns: 1fr; }
  .cfg-row { grid-template-columns: 1fr; gap: var(--s-2); }
  .rb-action { margin-left: 0; }
}
/* ===== LNT 暖纸编辑风 · 统一浅色主题覆盖(2026-06-24)===== */
:root{
  --bg-0:#F7F4EC; --bg-1:#FBF9F3; --bg-2:#F2EEE3; --bg-3:#EDE7D8;
  --line:#D9D3C4; --line-strong:#C9C2B0;
  --t-1:#1B1A17; --t-2:#3C3A34; --t-3:#6E6A5F; --t-4:#9A9486;
  --accent:#7B2331; --accent-2:#9E3140; --accent-bg:rgba(123,35,49,.10); --accent-bg-2:rgba(123,35,49,.18); --accent-line:rgba(123,35,49,.35);
  --green:#3F6B3A; --green-bg:rgba(63,107,58,.12); --green-line:rgba(63,107,58,.30);
  --red:#8A2C2C; --red-bg:rgba(138,44,44,.10); --red-line:rgba(138,44,44,.30);
  --amber:#9C6B1E; --amber-bg:rgba(156,107,30,.13); --amber-line:rgba(156,107,30,.32);
  --surface-input:#FBF9F3; --surface-hover:#EFEADD;
}
h1,h2,h3{font-family:"Fraunces","Songti SC",serif}
/* 浅底:中和原暗色装饰(body 辉光/网格、写死深色块)*/
body{background-image:none!important}
body::before{display:none!important}
