/* 竞衡 · 发电集团电力现货交易决策中枢
 * 版式语言：浅色交易台 + 行情条 + 24 时段矩阵；深色顶栏、琥珀色价格主色、
 * 青色实时价、蓝色负荷；数字统一等宽字体（tabular numerals）。
 */
:root {
  --bg: #edf0f4;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --ink2: #33455e;
  --muted: #77869a;
  --line: #dce3ec;
  --line2: #eef2f7;
  --navy: #0a1526;
  --navy2: #13263f;
  --amber: #b8781a;
  --amber2: #d9a441;
  --amber-bg: #fbf3e3;
  --teal: #0e7a72;
  --teal-bg: #e9f6f4;
  --blue: #1d56c4;
  --blue-bg: #eaf0fc;
  --red: #ad3a33;
  --red-bg: #fbeeec;
  --green: #2c7549;
  --green-bg: #eaf5ee;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Menlo", monospace;
  --sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
em, i { font-style: normal; }
b { font-weight: 700; }
.num, .kpi-val b, .tick b, .doc-table .num, .split-table td, .out-cell b, .stat-grid b,
.perm-table, .rc-rows b, .cb-hash, .heat-foot span, .mini-bar, .auth-limits b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ============================ 顶栏 ============================ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  color: #e9eff8;
  background:
    radial-gradient(900px 120px at 4% 0%, rgba(96, 148, 220, .22), transparent 70%),
    linear-gradient(96deg, #08111f 0%, #0e1e34 52%, #122641 100%);
  border-bottom: 1px solid #1c3454;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 430px; }
.logo {
  width: 54px; height: 54px; flex: 0 0 54px;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  color: #f7e6c4;
  border: 1px solid rgba(217, 164, 65, .55);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(217, 164, 65, .22), rgba(217, 164, 65, .04));
  box-shadow: inset 0 0 0 4px rgba(8, 17, 31, .6);
}
.brand-text h1 { font-size: 17px; letter-spacing: .6px; font-weight: 650; display: flex; align-items: baseline; gap: 10px; }
.brand-text h1 span { font-size: 11.5px; font-weight: 400; letter-spacing: .4px; color: #9fb2ca; }
.brand-text p { margin-top: 2px; font-size: 11px; letter-spacing: 2.4px; color: #7e93ad; }
.top-market { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.mkt { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #b9c8db; }
.live { width: 7px; height: 7px; border-radius: 50%; background: #45c08a; box-shadow: 0 0 0 3px rgba(69, 192, 138, .18); animation: pulse 2.2s infinite; }
.tm { display: flex; flex-direction: column; line-height: 1.35; }
.tm span { font-size: 10px; letter-spacing: 1.2px; color: #7e93ad; }
.tm strong { font-size: 12px; font-weight: 600; color: #e2ebf6; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.stamp {
  font-size: 10.5px; letter-spacing: .4px; color: #d9a441;
  border: 1px solid rgba(217, 164, 65, .4); border-radius: 4px;
  padding: 2px 6px; background: rgba(217, 164, 65, .08);
}
.role-picker { display: flex; flex-direction: column; gap: 2px; }
.role-picker > span { font-size: 9.5px; letter-spacing: 1.4px; color: #7e93ad; }
.role-picker select {
  appearance: none;
  background: #0f2138 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%237e93ad'/></svg>") no-repeat right 8px center;
  border: 1px solid #2a4466; border-radius: 6px;
  color: #e6eef8; font-size: 12px; padding: 5px 24px 5px 9px;
  min-width: 168px;
}

/* ============================ 行情条 ============================ */
.ticker {
  flex: 0 0 40px;
  display: flex; align-items: stretch;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.tick {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 14px;
  border-right: 1px dashed var(--line);
  line-height: 1.2;
}
.tick:last-child { border-right: 0; }
.tick em { font-size: 9.5px; letter-spacing: .8px; color: var(--muted); font-style: normal; white-space: nowrap; }
.tick b { font-size: 14px; color: var(--ink); font-weight: 650; }
.tick i { font-size: 9.5px; color: var(--muted); margin-left: 3px; }
.tick:nth-child(1) b { color: var(--amber); }
.tick:nth-child(8) b { color: var(--red); }

/* ============================ 阶段导航 ============================ */
.stagebar {
  flex: 0 0 54px;
  display: flex; align-items: stretch;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.stage {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.stage b { font-family: var(--mono); font-size: 10px; color: #a9b6c7; }
.stage span { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.stage i { font-size: 9px; letter-spacing: 1.1px; color: #aebbcb; }
.stage:hover { color: var(--ink2); background: rgba(29, 86, 196, .04); }
.stage.active { color: var(--ink); border-bottom-color: var(--amber); background: #fff; }
.stage.active b { color: var(--amber); }
.stage.active i { color: var(--amber); }
.stage .dot { position: absolute; top: 14px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.stage .count {
  font-family: var(--mono); font-size: 9px; color: #fff; background: var(--navy2);
  border-radius: 8px; padding: 0 5px; margin-left: 2px;
}
.stage-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.plan-state {
  font-size: 11.5px; color: var(--ink2); background: #fff;
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 11px;
}
.plan-tier { font-size: 10.5px; color: var(--amber); background: var(--amber-bg); border: 1px solid #eeddbd; border-radius: 20px; padding: 3px 10px; }

/* ============================ 主体 ============================ */
.app-main { flex: 1 1 auto; padding: 14px 20px 6px; }
.view { display: none; }
.view.active { display: block; animation: fade .35s ease; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 11px; }
.view-head.compact { margin-bottom: 12px; }
.eyebrow { font-family: var(--mono); font-size: 9.5px; letter-spacing: 2.2px; color: var(--amber); }
.view-heading h2 { font-size: 21px; letter-spacing: .3px; margin-top: 3px; font-weight: 650; }
.view-heading p { margin-top: 5px; font-size: 12px; color: var(--ink2); max-width: 980px; }
.view-heading p b { color: var(--ink); }
.view-meta { display: flex; gap: 22px; padding-bottom: 2px; }
.view-meta > div { display: flex; flex-direction: column; line-height: 1.35; }
.view-meta span { font-size: 9.5px; letter-spacing: .8px; color: var(--muted); }
.view-meta strong { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.audit-meta { align-items: flex-end; gap: 10px; }
.audit-meta > div { flex-direction: row; align-items: baseline; gap: 8px; }

/* ============================ 面板 ============================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 12px 30px -26px rgba(15, 27, 45, .4);
  min-width: 0;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.panel-head.tight { margin-bottom: 7px; }
.panel-kicker { font-family: var(--mono); font-size: 8.6px; letter-spacing: 1.5px; color: #9aa7b8; }
.panel-head h3 { font-size: 14.5px; font-weight: 650; margin-top: 1px; letter-spacing: .2px; }
.panel-head-note, .hint { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.legend-inline { display: flex; gap: 12px; font-size: 10px; color: var(--ink2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lg.amber { background: var(--amber2); }
.lg.teal { background: var(--teal); }
.lg.blue { background: #9db8e8; }
.lg.red { background: var(--red); }
.lg.dash { background: none; border-top: 2px dashed var(--teal); height: 0; border-radius: 0; width: 14px; }

/* ============================ KPI ============================ */
.kpi-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 9px; }
.kpi {
  position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px 9px 14px; min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .03);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--amber2); }
.kpi.warn::before { background: var(--red); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-top span { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; white-space: nowrap; }
.kpi .tag { font-family: var(--mono); font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--line2); color: var(--ink2); }
.kpi .tag.up { background: var(--green-bg); color: var(--green); }
.kpi .tag.down { background: var(--red-bg); color: var(--red); }
.kpi-val { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.kpi-val b { font-size: 25px; line-height: 1.1; letter-spacing: -.5px; font-weight: 650; }
.kpi-val i { font-size: 10.5px; color: var(--muted); }
.kpi-foot { margin-top: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ 市场看板 ============================ */
.market-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; }
.market-grid.lower { margin-top: 10px; grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr); }
.chart-panel { display: flex; flex-direction: column; }
.chart-box { flex: 1 1 auto; min-height: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e6ecf3; stroke-width: 1; }
.chart .grid.solid { stroke: #cfd8e4; }
.chart .ax { font-family: var(--mono); font-size: 8.5px; fill: #8e9bad; }
.chart .loadbar { fill: #dbe6f8; }
.chart .pline { fill: none; stroke: var(--amber); stroke-width: 1.9; }
.chart .rtline { fill: none; stroke: var(--teal); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .85; }
.chart .peak-dot { fill: #fff; stroke: var(--amber); stroke-width: 2; }
.chart .peak-label { font-family: var(--mono); font-size: 9px; fill: var(--amber); font-weight: 700; }
.chart .hot { fill: transparent; cursor: crosshair; }
.chart .hot:hover { fill: rgba(29, 86, 196, .05); }
.chart .pos { fill: var(--teal); opacity: .82; }
.chart .neg { fill: var(--red); opacity: .78; }
.chart-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 4px; font-size: 10px; color: var(--muted); }

/* AI 卡片 */
.ai-panel { display: flex; flex-direction: column; }
.ai-list { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.ai-card {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px 7px; background: #fcfdff;
  border-left: 3px solid var(--amber2);
}
.ai-card.applied { border-left-color: var(--green); background: var(--green-bg); }
.ai-head { display: flex; align-items: center; gap: 7px; }
.ai-tag { font-size: 9.5px; color: var(--amber); background: var(--amber-bg); border-radius: 3px; padding: 1px 5px; white-space: nowrap; }
.ai-head h4 { font-size: 12.2px; font-weight: 650; line-height: 1.35; flex: 1 1 auto; }
.ai-impact { font-family: var(--mono); font-size: 11.5px; color: var(--green); font-weight: 700; white-space: nowrap; }
.ai-claim { margin-top: 3px; font-size: 10.8px; color: var(--ink2); line-height: 1.55; }
.ai-evi { margin-top: 4px; }
.ai-evi summary { font-size: 10px; color: var(--blue); cursor: pointer; letter-spacing: .2px; }
.evi-table { width: 100%; border-collapse: collapse; margin-top: 5px; }
.evi-table th { text-align: left; font-size: 9.6px; color: var(--muted); font-weight: 500; padding: 2px 6px 2px 0; white-space: nowrap; width: 34%; }
.evi-table td { font-size: 10.2px; color: var(--ink); padding: 2px 6px 2px 0; }
.evi-table td.src { font-size: 9.2px; color: var(--muted); white-space: nowrap; }
.evi-note { font-size: 9.8px; color: var(--ink2); background: #f3f6fa; border-radius: 4px; padding: 4px 6px; margin-top: 5px; }
.ai-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.ai-scope { font-size: 9.6px; color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--navy2); color: #fff; border: 1px solid var(--navy2);
  border-radius: 6px; padding: 6px 14px; font-size: 12px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #1d3a5e; }
.btn.ghost { background: #fff; color: var(--ink2); border-color: #c9d4e2; }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn.small { padding: 4px 10px; font-size: 11px; }
.btn.tiny { padding: 3px 8px; font-size: 10.5px; background: #f3f6fa; color: var(--ink2); border-color: #d9e2ee; }
.btn.tiny:hover { border-color: var(--amber); color: var(--amber); }
.btn[disabled] { opacity: .5; cursor: default; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 9.4px; letter-spacing: .5px; color: var(--muted); font-weight: 500;
  text-align: left; padding: 0 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { font-size: 11.6px; padding: 4.5px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f7fafd; cursor: pointer; }
.data-table .num, .doc-table .num { text-align: right; }
.td-unit { display: flex; align-items: center; gap: 6px; }
.td-unit b { font-size: 11.8px; }
.u-dot { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 7px; }
.u-sub { font-size: 9.4px; color: var(--muted); }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--amber); }
.mini-bar { display: inline-block; width: 54px; height: 5px; border-radius: 3px; background: var(--line2); overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--teal); }

/* 申报热力 */
.heat-panel { display: flex; flex-direction: column; }
.heat-grid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 102px; align-items: end; }
.heat-cell { position: relative; height: 100%; background: var(--line2); border-radius: 3px; overflow: hidden; cursor: pointer; }
.heat-cell i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, var(--amber2), #c79433); opacity: .85; }
.heat-cell span { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 7.6px; color: #7d8a9b; }
.heat-cell.neg i { background: linear-gradient(180deg, #d98b84, #ad3a33); }
.heat-cell.off { background: repeating-linear-gradient(135deg, #eef2f7, #eef2f7 3px, #e2e8f0 3px, #e2e8f0 6px); }
.heat-cell:hover { outline: 1px solid rgba(29, 86, 196, .5); }
.heat-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 10px; color: var(--muted); }

/* ============================ 申报 ============================ */
.bid-grid { display: grid; grid-template-columns: 226px minmax(0, 1fr) 344px; gap: 12px; }
.unit-list-panel { display: flex; flex-direction: column; padding: 13px 11px; }
.unit-list { display: flex; flex-direction: column; gap: 5px; }
.unit-item {
  display: flex; align-items: center; gap: 7px; text-align: left;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer;
}
.unit-item:hover { border-color: #b9c9dd; }
.unit-item.active { border-color: var(--amber); background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber); }
.ui-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.ui-main b { font-size: 11.8px; white-space: nowrap; }
.ui-main span { font-size: 9.3px; color: var(--muted); }
.ui-side { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.ui-side b { font-family: var(--mono); font-size: 12px; }
.ui-side span { font-size: 8.5px; color: var(--muted); }
.unit-list-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.unit-list-foot > div { display: flex; justify-content: space-between; font-size: 10.2px; color: var(--muted); }
.unit-list-foot b { color: var(--ink); font-family: var(--mono); font-size: 10.6px; }

.matrix-panel { padding: 13px 14px 10px; }
.matrix-scroll { overflow-x: auto; }
.bid-matrix { display: grid; grid-template-columns: repeat(24, minmax(30px, 1fr)); gap: 4px; }
.mcell {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 3px; height: 142px; padding: 3px 2px 4px;
  background: #f9fbfd; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.mcell:hover { border-color: #b7c8dd; }
.mcell.sel { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(184, 120, 26, .18); background: #fffdf7; }
.mcell.off { background: repeating-linear-gradient(135deg, #f3f6fa, #f3f6fa 4px, #e9eef5 4px, #e9eef5 8px); }
.mcell.over::after { content: ""; position: absolute; top: 2px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.mprice { font-family: var(--mono); font-size: 8.6px; color: var(--ink2); line-height: 1; }
.mbar { position: relative; width: 62%; flex: 1 1 auto; background: #eef3f9; border-radius: 2px; overflow: hidden; display: flex; align-items: flex-end; }
.mbar .raw { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, #e4bd72, #c99a3e); }
.mbar .clr { position: absolute; bottom: 0; left: 18%; right: 18%; background: var(--teal); opacity: .85; }
.mmw { font-family: var(--mono); font-size: 8.4px; color: var(--ink); line-height: 1; }
.mh { font-family: var(--mono); font-size: 7.8px; color: #97a4b6; line-height: 1; }
.bid-chart-box { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 4px; }
.formula-bar { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.formula-bar b { font-size: 9.6px; color: var(--amber); letter-spacing: .4px; }
.formula-bar span { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }

.editor-panel { padding: 13px 14px; display: flex; flex-direction: column; }
.ed-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ed-head h3 { font-size: 14px; margin-top: 1px; }
.ed-head p { font-size: 10px; color: var(--muted); margin-top: 2px; }
.pill { font-size: 9.6px; border-radius: 4px; padding: 1.5px 6px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.edit { background: var(--blue-bg); color: var(--blue); }
.pill.locked { background: #eef1f5; color: var(--muted); }
.ed-control { margin-top: 10px; }
.ed-label { display: flex; justify-content: space-between; align-items: baseline; }
.ed-label label { font-size: 10.4px; color: var(--muted); letter-spacing: .4px; }
.ed-label b { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.ed-label b i { font-size: 9.5px; color: var(--muted); font-weight: 400; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 8px 0 4px;
  background: #e4ebf4;
  border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 3px solid var(--amber); cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 27, 45, .25);
}
input[type="range"]:disabled { opacity: .45; }
input[type="range"]:disabled::-webkit-slider-thumb { cursor: not-allowed; }
.ed-scale { display: flex; justify-content: space-between; font-size: 8.8px; color: #9dabbd; font-family: var(--mono); }
.ed-quick { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.ed-out { margin-top: 11px; }
.out-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.out-cell { border: 1px solid var(--line2); background: #f9fbfd; border-radius: 6px; padding: 5px 7px; display: flex; flex-direction: column; gap: 1px; }
.out-cell span { font-size: 9px; color: var(--muted); }
.out-cell b { font-family: var(--mono); font-size: 12.6px; }
.out-cell b i { font-size: 8.5px; color: var(--muted); font-weight: 400; margin-left: 1px; }
.ed-split { margin-top: 9px; }
.split-table { width: 100%; border-collapse: collapse; }
.split-table th { text-align: left; font-size: 9.6px; color: var(--muted); font-weight: 400; padding: 2px 0; }
.split-table td { text-align: right; font-size: 10.6px; padding: 2px 0; }
.split-table .sum th, .split-table .sum td { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 700; color: var(--ink); }
.split-note { margin-top: 4px; font-size: 9.1px; color: var(--muted); }
.ed-actions { display: flex; gap: 6px; margin-top: 12px; }
.ed-actions .btn { flex: 1 1 0; }
.ed-lock { margin-top: 10px; border: 1px dashed #e0b9b5; background: var(--red-bg); color: var(--red); border-radius: 6px; padding: 8px 10px; font-size: 11px; }
.rules-strip { margin-top: 12px; }
.rules-panel { padding: 11px 14px; }
.rules-summary { display: flex; gap: 6px; align-self: center; }
.rs { font-size: 9.8px; border-radius: 4px; padding: 1.5px 6px; background: var(--line2); color: var(--ink2); }
.rs.bad { background: var(--red-bg); color: var(--red); }
.rs.warn { background: var(--amber-bg); color: var(--amber); }
.rs.ok { background: var(--green-bg); color: var(--green); }
.rules-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rule { border: 1px solid var(--line); border-left-width: 3px; border-radius: 6px; padding: 6px 8px; background: #fcfdff; }
.rule.ok { border-left-color: #9cc4a9; }
.rule.warn { border-left-color: var(--amber2); background: #fffdf6; }
.rule.bad { border-left-color: var(--red); background: #fffafa; }
.rule-head { display: flex; align-items: center; gap: 5px; }
.rule-head .rid { font-family: var(--mono); font-size: 9px; color: #fff; background: var(--ink2); border-radius: 3px; padding: 0 3px; }
.rule.bad .rid { background: var(--red); }
.rule.warn .rid { background: var(--amber); }
.rule.ok .rid { background: #6f9a7f; }
.rule-head b { font-size: 10.8px; flex: 1 1 auto; }
.rule-head em { font-size: 8.8px; color: var(--muted); }
.rule p { font-size: 9.5px; color: var(--ink2); margin-top: 3px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rule-basis { display: block; margin-top: 3px; font-size: 8.6px; color: #9dabbd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ 偏差复盘 ============================ */
.dev-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.unit-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill-btn { font-size: 9.6px; border: 1px solid var(--line); background: #fff; color: var(--ink2); border-radius: 4px; padding: 2px 7px; cursor: pointer; }
.pill-btn.active { background: var(--navy2); color: #fff; border-color: var(--navy2); }
.dev-ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.dev-ai-card .panel-head h3 { font-size: 13px; }
.cause-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cause-list li { display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; align-items: baseline; border-top: 1px dashed var(--line2); padding-top: 4px; }
.cause-list li:first-child { border-top: 0; padding-top: 0; }
.cause-list b { font-size: 10.4px; color: var(--ink); }
.cause-list span { font-size: 10.4px; color: var(--ink2); line-height: 1.45; }
.cause-list em { font-size: 8.8px; color: var(--muted); white-space: nowrap; }
.dev-ai-foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.dev-ai-foot span { font-size: 9.4px; color: var(--muted); }

/* ============================ 签批 ============================ */
.appr-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; }
.appr-left, .appr-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.doc-top { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.doc-top h3 { font-size: 16px; margin-top: 1px; letter-spacing: .5px; }
.doc-meta { display: flex; gap: 14px; margin-top: 5px; font-size: 10px; color: var(--muted); }
.doc-stamp {
  align-self: flex-start; font-size: 12px; letter-spacing: 3px; color: var(--red);
  border: 2px solid var(--red); border-radius: 4px; padding: 2px 8px; transform: rotate(-6deg);
  font-weight: 700; opacity: .8;
}
.doc-stamp.done { color: var(--green); border-color: var(--green); }
.doc-stamp.rej { color: var(--red); border-color: var(--red); }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.doc-table th { font-size: 9.4px; color: var(--muted); font-weight: 500; text-align: left; padding: 3px 7px; border-bottom: 1px solid var(--line); }
.doc-table td { font-size: 11.2px; padding: 5px 7px; border-bottom: 1px solid var(--line2); }
.doc-table tr.sum td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: #f9fbfd; }
.doc-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 9px; }
.doc-sum > div { background: #f7fafd; border: 1px solid var(--line2); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.doc-sum span { font-size: 9.2px; color: var(--muted); }
.doc-sum b { font-family: var(--mono); font-size: 13px; }
.check-list { display: flex; flex-direction: column; gap: 3px; }
.check { display: flex; gap: 7px; align-items: flex-start; padding: 4px 0; border-bottom: 1px dashed var(--line2); }
.check:last-child { border-bottom: 0; }
.check .ck { width: 15px; height: 15px; flex: 0 0 15px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; background: #8fae9a; margin-top: 1px; }
.check.warn .ck { background: var(--amber); }
.check.block .ck { background: var(--red); }
.check b { font-size: 10.6px; }
.check p { font-size: 9.7px; color: var(--ink2); line-height: 1.45; }
.flow-list { list-style: none; margin: 0; padding: 0; position: relative; }
.flow-step { position: relative; display: flex; gap: 9px; padding: 0 0 12px 0; }
.flow-step::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.flow-step:last-child::before { display: none; }
.fs-dot { width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; background: #eef2f7; color: var(--muted); border: 1px solid var(--line); z-index: 1; }
.flow-step.done .fs-dot { background: var(--green); border-color: var(--green); color: #fff; }
.flow-step.now .fs-dot { background: #fff; border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 3px rgba(184, 120, 26, .14); }
.flow-step.skip .fs-dot { color: #b9c4d2; }
.fs-main { display: flex; flex-direction: column; line-height: 1.35; }
.fs-main b { font-size: 11.6px; }
.fs-main span { font-size: 9.6px; color: var(--muted); }
.fs-main em { font-size: 9.4px; color: var(--ink2); margin-top: 1px; }
.fs-state { margin-left: auto; font-size: 9.4px; color: var(--muted); align-self: flex-start; }
.flow-step.now .fs-state { color: var(--amber); }
.flow-step.done .fs-state { color: var(--green); }
.flow-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.flow-actions .btn { padding: 5px 10px; font-size: 11px; }
.flow-note { margin-top: 8px; font-size: 9.8px; color: var(--ink2); background: #f7fafd; border-left: 2px solid var(--amber2); padding: 5px 8px; line-height: 1.45; }
.auth-desc { font-size: 10.2px; color: var(--ink2); line-height: 1.5; margin-top: 2px; }
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 7px; }
.cap { display: flex; align-items: center; gap: 5px; font-size: 10px; padding: 3px 6px; border-radius: 4px; background: #f7fafd; color: var(--muted); }
.cap.on { background: var(--green-bg); color: var(--green); }
.cap i { font-size: 9px; width: 11px; }
.auth-limits { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.auth-limits > div { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.auth-limits b { color: var(--ink); font-size: 10.6px; }
.receipt { border: 1px solid #ddc9a6; border-radius: 8px; background: linear-gradient(180deg, #fffdf7, #fdf8ec); padding: 10px 12px; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed #e2d3b6; padding-bottom: 5px; }
.rc-head span { font-size: 9.6px; color: var(--amber); letter-spacing: 1px; }
.rc-head b { font-size: 12.5px; }
.rc-no { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; margin: 7px 0 6px; }
.rc-rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 14px; }
.rc-rows > div { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); border-bottom: 1px dotted #ece0c8; padding-bottom: 2px; }
.rc-rows b { color: var(--ink); font-size: 10.4px; }
.rc-foot { margin-top: 7px; font-size: 9px; color: #a08b64; line-height: 1.45; }
.empty { border: 1px dashed var(--line); border-radius: 7px; padding: 14px; font-size: 10.6px; color: var(--muted); text-align: center; }

/* ============================ 留痕 ============================ */
.audit-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.audit-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chain-badge { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--green); }
.chain-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chain-badge.bad { color: var(--red); }
.chain-badge.bad i { background: var(--red); }
.chain-list { max-height: 610px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-right: 4px; }
.chain-block { border: 1px solid var(--line); border-left: 3px solid #9cc4a9; border-radius: 6px; padding: 6px 9px; background: #fcfdff; }
.chain-block.warn { border-left-color: var(--amber2); background: #fffdf7; }
.chain-block.deny { border-left-color: var(--red); background: #fffafa; }
.chain-block.ai { border-left-color: var(--blue); background: #fafcff; }
.cb-top { display: flex; align-items: center; gap: 9px; font-size: 9.2px; color: var(--muted); }
.cb-seq { font-family: var(--mono); color: var(--ink2); }
.cb-at { font-family: var(--mono); }
.cb-actor { margin-left: auto; color: var(--ink2); }
.cb-body { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; }
.cb-body b { font-size: 11px; white-space: nowrap; }
.cb-body span { font-size: 10.2px; color: var(--ink2); }
.cb-hash { display: flex; gap: 12px; font-size: 8.5px; color: #9dabbd; margin-top: 2px; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th { font-size: 8.8px; color: var(--muted); font-weight: 500; padding: 0 2px 5px; text-align: center; }
.perm-table th:first-child { text-align: left; }
.perm-table td { font-size: 9.6px; text-align: center; padding: 4px 2px; border-top: 1px solid var(--line2); }
.perm-table td:first-child { text-align: left; }
.perm-table td:first-child b { display: block; font-size: 10px; }
.perm-table td:first-child span { font-size: 8.6px; color: var(--muted); }
.perm-table tr.active { background: #fffaf0; }
.perm-table i.yes { color: var(--green); font-weight: 700; }
.perm-table i.no { color: #c3ccd8; }
.denial-list { display: flex; flex-direction: column; gap: 4px; max-height: 186px; overflow-y: auto; }
.denial { border: 1px solid #f0d9d6; background: #fffafa; border-radius: 5px; padding: 4px 7px; display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.dn-at { font-family: var(--mono); font-size: 8.6px; color: var(--muted); }
.denial b { font-size: 10.2px; color: var(--red); }
.dn-actor { font-size: 8.8px; color: var(--muted); margin-left: auto; }
.denial p { flex: 1 1 100%; font-size: 9.4px; color: var(--ink2); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat-grid > div { background: #f7fafd; border: 1px solid var(--line2); border-radius: 6px; padding: 5px 7px; display: flex; flex-direction: column; }
.stat-grid span { font-size: 8.8px; color: var(--muted); }
.stat-grid b { font-size: 15px; }
.stat-people { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.stat-people > div { display: flex; justify-content: space-between; font-size: 9.4px; color: var(--muted); border-bottom: 1px dotted var(--line2); padding-bottom: 1px; }
.stat-people b { color: var(--ink); font-family: var(--mono); }

/* ============================ 页脚 / 提示 ============================ */
.site-foot {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; gap: 18px;
  padding: 6px 22px 7px; border-top: 1px solid var(--line);
  background: #f7f9fc; color: var(--muted); font-size: 9.6px;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px);
  background: var(--navy2); color: #fff; border-radius: 8px;
  padding: 9px 18px; font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: 70vw;
  box-shadow: 0 10px 30px -10px rgba(10, 21, 38, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: #1c5a3a; }
.toast.bad { background: #8c2f2a; }
.modal-layer[hidden] { display: none; }
.noscript { padding: 30px; text-align: center; color: var(--muted); }
.is-static *, .is-static *::before, .is-static *::after { animation: none !important; transition: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ============================ 补充态 ============================ */
.btn[data-locked] { opacity: .4; border-style: dashed; }
.kpi-val b.sm { font-size: 17px; letter-spacing: 0; }
.chart .neg.over { stroke: #6f1f1a; stroke-width: .9; }
.dev-top-panel { margin-top: 6px; }
.dev-ai-card { padding: 11px 14px; }
.dev-top-panel .data-table td { padding: 4px 8px; }
.dev-top-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; font-size: 9.8px; color: var(--muted); }
.flow-actions .btn.primary { background: var(--amber); border-color: var(--amber); }
.flow-actions .btn.primary:hover { background: #9c6413; }

/* ============================ 窄屏 ============================ */
@media (max-width: 1440px) {
  .brand { min-width: 360px; }
  .top-market { gap: 14px; }
  .kpi-val b { font-size: 22px; }
  .bid-grid { grid-template-columns: 210px minmax(0, 1fr) 318px; }
  .mcell { height: 128px; }
  .rules-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 12px; }
  .top-market { margin-left: 0; }
  .market-grid, .dev-grid, .appr-grid, .audit-grid { grid-template-columns: minmax(0, 1fr); }
  .bid-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ticker { overflow-x: auto; }
  .tick { min-width: 120px; }
}
