/* ============================================================
   DCCP 数据跨境管控平台 · 全站公共样式
   依据 DESIGN.md：浅色主题 / 系统中文字体 / 裁决即界面
   ============================================================ */

:root {
  /* brand: boundary 界 */
  --boundary-50: #eef4fb;
  --boundary-100: #d9e7f6;
  --boundary-200: #b3cfed;
  --boundary-300: #7dabdd;
  --boundary-400: #3d7ec4;
  --boundary-500: #1a63b0;
  --boundary-600: #004ea2;
  --boundary-700: #003e82;
  --boundary-800: #013067;
  --boundary-900: #062348;

  /* verdict 裁决四色 */
  --allow: #0e8a5f;   --allow-bg: #e6f6ef;   --allow-line: #9dd9bf;
  --degrade: #b45309; --degrade-bg: #fdf3e3; --degrade-line: #f0cf94;
  --deny: #c2312e;    --deny-bg: #fdecec;    --deny-line: #f2b3b1;
  --pending: #6d28d9; --pending-bg: #f1ecfc; --pending-line: #cfc0f2;

  /* levels L0–L4 */
  --l0: #94a3b8; --l1: #3d7ec4; --l2: #004ea2; --l3: #b45309; --l4: #7f1d1d;

  /* neutral */
  --paper: #f7f9fc;
  --surface: #ffffff;
  --ink-900: #10233d;
  --ink-700: #33475f;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --line: #e2e8f0;
  --line-strong: #c8d3e0;

  /* type */
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC", monospace;

  /* shape */
  --radius-card: 10px;
  --radius-ctl: 8px;
  --radius-tag: 6px;
  --shadow-card: 0 1px 2px rgba(16, 35, 61, .05), 0 1px 3px rgba(16, 35, 61, .08);
  --shadow-pop: 0 8px 24px rgba(16, 35, 61, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 20px; }

.mono { font-family: var(--font-mono); font-size: .93em; color: var(--ink-700); }

:focus-visible { outline: 2px solid var(--boundary-400); outline-offset: 2px; border-radius: 4px; }

/* ---------- 应用壳 ---------- */
.dccp-topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dccp-sidebar {
  width: 220px;
  flex: none;
  align-self: flex-start;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  z-index: 40;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-ctl);
  color: var(--ink-700);
  text-decoration: none;
  font-size: 14px;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: #eef2f8; color: var(--ink-900); }
.nav-item.active {
  background: var(--boundary-50);
  color: var(--boundary-700);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--boundary-600);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }

/* 项目上下文胶囊 */
.ctx-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--boundary-50);
  border: 1px solid var(--boundary-200);
  color: var(--boundary-700);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: default;
}
.ctx-capsule--interactive {
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ctx-capsule--interactive:hover,
.ctx-capsule--interactive[aria-expanded="true"] {
  border-color: var(--boundary-400);
  background: var(--boundary-100);
}

.ctx-menu {
  position: fixed;
  z-index: 80;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ctx-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-ctl);
  background: transparent;
  font: inherit;
  color: var(--ink-900);
  cursor: pointer;
}
.ctx-menu-item:hover { background: var(--boundary-50); }
.ctx-menu-item.selected { background: var(--boundary-50); outline: 1px solid var(--boundary-200); }
.ctx-menu-item .text-muted { font-size: 12px; color: var(--ink-500); }

/* 演示角标 */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--degrade-line);
  background: var(--degrade-bg);
  color: var(--degrade);
  border-radius: var(--radius-tag);
  padding: 3px 10px;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 裁决徽章 ---------- */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-tag);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
  cursor: default;
  animation: verdict-pop .3s cubic-bezier(.34, 1.56, .64, 1);
}
.verdict svg { width: 13px; height: 13px; }
.verdict-allow   { color: var(--allow);   background: var(--allow-bg);   border-color: var(--allow-line); }
.verdict-degrade { color: var(--degrade); background: var(--degrade-bg); border-color: var(--degrade-line); }
.verdict-deny    { color: var(--deny);    background: var(--deny-bg);    border-color: var(--deny-line); }
.verdict-pending { color: var(--pending); background: var(--pending-bg); border-color: var(--pending-line); }

@keyframes verdict-pop {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- 分级级牌 ---------- */
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-tag);
  border: 1px solid transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.level-chip .lv { font-family: var(--font-mono); font-weight: 700; }
.level-chip.l0 { background: var(--l0); }
.level-chip.l1 { background: var(--l1); }
.level-chip.l2 { background: var(--l2); }
.level-chip.l3 { background: var(--l3); }
.level-chip.l4 { background: var(--l4); }
.level-chip.locked {
  background: #edf1f6;
  color: var(--ink-500);
  border-color: var(--line-strong);
}
.level-chip.locked .lv { color: var(--ink-500); }

/* 迷你分级胶囊（策略摘要用） */
.mini-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.mini-level.ok   { background: var(--allow-bg);   color: var(--allow); }
.mini-level.appr { background: var(--degrade-bg); color: var(--degrade); }
.mini-level.no   { background: var(--deny-bg);    color: var(--deny); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-ctl);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--boundary-600); color: #fff; }
.btn-primary:hover { background: var(--boundary-700); }
.btn-secondary { background: var(--surface); color: var(--ink-700); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--boundary-300); color: var(--boundary-700); }
.btn-danger { background: var(--deny); color: #fff; }
.btn-danger:hover { background: #a52825; }
.btn-ghost { background: transparent; color: var(--ink-500); border-color: var(--line); cursor: not-allowed; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-tag);
  font-size: 11px;
  background: #eef2f8;
  color: var(--ink-500);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-blue { background: var(--boundary-50); color: var(--boundary-600); border-color: var(--boundary-200); }

/* ---------- 策略闸线 GateLine ---------- */
.gateline { position: relative; padding: 10px 4px 2px; }
.gateline-track {
  position: relative;
  height: 3px;
  background: var(--boundary-100);
  border-radius: 2px;
  margin: 14px 12px 10px;
}
.gateline-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--boundary-500);
  box-shadow: 0 0 0 4px rgba(26, 99, 176, .18);
  opacity: 0;
}
.gateline.flow-allow .gateline-dot {
  opacity: 1;
  animation: flow-allow 3s linear infinite;
}
.gateline.flow-deny .gateline-dot {
  opacity: 1;
  background: var(--deny);
  box-shadow: 0 0 0 4px rgba(194, 49, 46, .2);
  animation: flow-deny 1.4s ease-in forwards;
}
.gateline.flow-deny .gateline-track { animation: track-shake .35s linear 1.05s 1; }

/* 闸门位于 62% 处；放行光点穿闸时缩小（降级瘦身隐喻） */
@keyframes flow-allow {
  0%   { left: 0;    transform: scale(1);   opacity: 0; }
  6%   { opacity: 1; }
  58%  { transform: scale(1); }
  64%  { transform: scale(.72); }
  94%  { opacity: 1; }
  100% { left: 100%; transform: scale(.72); opacity: 0; }
}
@keyframes flow-deny {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 1; }
  70%  { left: 62%; transform: scale(1); }
  82%  { left: 62%; transform: scale(1.9); opacity: .9; }
  100% { left: 62%; transform: scale(2.6); opacity: 0; }
}
@keyframes track-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.gateline-nodes {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-500);
  padding: 0 2px;
}
.gateline-node { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 25%; text-align: center; }
.gateline-node svg { width: 18px; height: 18px; }

/* 国境策略闸节点 */
.gate-mark {
  position: absolute;
  left: 62%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.gate-mark .gate-bar {
  width: 0;
  height: 34px;
  border-left: 2px dashed var(--boundary-400);
}
.gate-mark .gate-shield {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--boundary-400);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--boundary-600);
  transition: border-color .2s, color .2s, background .2s;
}
.gate-mark .gate-shield svg { width: 15px; height: 15px; }
.gateline.flow-deny .gate-shield {
  border-color: var(--deny);
  color: var(--deny);
  background: var(--deny-bg);
}
.gateline.flow-deny .gate-bar { border-color: var(--deny); }

/* ---------- 锁区（因策略不可见） ---------- */
.lock-zone { position: relative; border-radius: var(--radius-ctl); overflow: hidden; border: 1px solid var(--line); }
.lock-zone .lock-content { filter: blur(8px); pointer-events: none; user-select: none; }
.lock-zone .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(247, 249, 252, .55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 12px;
}
.lock-zone .lock-overlay svg { width: 26px; height: 26px; color: var(--ink-500); }
.lock-zone.unlocked .lock-content { filter: none; pointer-events: auto; user-select: auto; }
.lock-zone.unlocked .lock-overlay { display: none; }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
  border-radius: 1px;
}
.tl-item { position: relative; padding: 0 0 14px 4px; animation: tl-in .4s ease-out; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -17px; top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--boundary-400);
}
.tl-item.tl-deny::before { border-color: var(--deny); background: var(--deny-bg); }
.tl-item.tl-allow::before { border-color: var(--allow); }
.tl-item.tl-pending::before { border-color: var(--pending); }
.tl-item.tl-deny .tl-body {
  background: var(--deny-bg);
  border-left: 3px solid var(--deny);
  border-radius: 0 var(--radius-tag) var(--radius-tag) 0;
  padding: 6px 8px;
  margin-top: 2px;
}
.tl-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.tl-text { font-size: 13px; color: var(--ink-700); margin-top: 1px; }

@keyframes tl-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 61, .32);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  z-index: 91;
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
}
.drawer-open .drawer { transform: translateX(0); }
.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }

/* 时效窗口胶囊选择 */
.pill-choice {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13px;
  cursor: pointer;
}
.pill-choice.selected {
  background: var(--boundary-50);
  border-color: var(--boundary-400);
  color: var(--boundary-700);
  font-weight: 600;
}

/* ---------- 倒计时环 ---------- */
.countdown-ring { position: relative; width: 44px; height: 44px; flex: none; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring .ring-bg { stroke: var(--line); }
.countdown-ring .ring-fg { stroke: var(--boundary-600); transition: stroke .3s; }
.countdown-ring.warn .ring-fg { stroke: var(--degrade); }

/* ---------- 拦截红屏 ---------- */
.intercept-screen {
  border: 1px solid var(--deny-line);
  background: var(--deny-bg);
  border-radius: var(--radius-card);
  padding: 34px 24px;
  text-align: center;
  animation: tl-in .35s ease-out;
}
.intercept-screen .shield-x {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  color: var(--deny);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--ink-900);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius-ctl);
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: tl-in .3s ease-out;
}
.toast svg { width: 15px; height: 15px; }

/* ---------- 打字机光标 ---------- */
.type-cursor::after {
  content: "▍";
  color: var(--boundary-500);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 呼吸告警点 */
.pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--deny);
  position: relative;
  flex: none;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--deny);
  opacity: .35;
  animation: ripple 2s ease-out infinite;
}
@keyframes ripple {
  0% { transform: scale(.5); opacity: .5; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* 矩阵格闪红（session 页复用预留） */
@keyframes flash-deny {
  0%, 100% { background: transparent; }
  50% { background: var(--deny-bg); }
}

/* Tab */
.seg-tabs {
  display: inline-flex;
  background: #edf1f6;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  padding: 3px;
  gap: 2px;
}
.seg-tab {
  border: none;
  background: transparent;
  height: 30px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink-500);
  cursor: pointer;
  font-weight: 500;
}
.seg-tab.active {
  background: var(--surface);
  color: var(--boundary-700);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

/* 数字 */
.num { font-variant-numeric: tabular-nums; }

/* ---------- KPI 卡 ---------- */
.kpi-card { padding: 14px 16px; }
.kpi-card .kpi-label { font-size: 12px; color: var(--ink-500); }
.kpi-card .kpi-num {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-num .unit { font-size: 14px; font-weight: 500; color: var(--ink-500); margin-left: 2px; }

/* 三色裁决条 */
.hit-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.hit-bar .seg-allow { background: var(--allow); }
.hit-bar .seg-degrade { background: var(--degrade); }
.hit-bar .seg-deny { background: var(--deny); }

/* ---------- 规则卡片 ---------- */
.rule-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  padding: 10px 12px 10px 16px;
  background: var(--surface);
}
.rule-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--boundary-400);
}
.rule-card.strict::before { background: var(--deny); }
.rule-card.contract::before { background: var(--degrade); }

/* ---------- 地图标记 ---------- */
.map-marker { cursor: pointer; }
.map-marker .marker-core { transition: r .2s; }
.map-marker .marker-ripple {
  transform-origin: center;
  transform-box: fill-box;
  animation: marker-ripple 2.2s ease-out infinite;
}
@keyframes marker-ripple {
  0% { transform: scale(.4); opacity: .55; }
  100% { transform: scale(2.1); opacity: 0; }
}
.map-marker.selected .marker-core { r: 8; }
.map-marker text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-700);
  font-weight: 600;
}

/* ---------- 裁决滚动条（跑马灯） ---------- */
.ticker-wrap {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  height: 40px;
  display: flex;
  align-items: center;
}
.ticker-label {
  flex: none;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--boundary-700);
  background: var(--boundary-50);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.ticker-view { flex: 1; overflow: hidden; }
.ticker-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: ticker-x 36s linear infinite;
  padding-left: 16px;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-x { to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-700);
  white-space: nowrap;
}

/* ---------- 项目列表项 ---------- */
.proj-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color .15s, background .15s;
}
.proj-item:hover { border-color: var(--boundary-300); }
.proj-item.selected {
  border-color: var(--boundary-400);
  background: var(--boundary-50);
  box-shadow: 0 0 0 1px var(--boundary-400) inset;
}
.risk-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.risk-dot.green { background: var(--allow); }
.risk-dot.yellow { background: var(--degrade); }
.risk-dot.red { background: var(--deny); }

/* 影响清单项 */
.impact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-tag);
  font-size: 12px;
  color: var(--ink-700);
  background: var(--surface);
  animation: tl-in .35s ease-out both;
}

/* ---------- 权限矩阵 ---------- */
.pcell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-tag);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  white-space: nowrap;
}
.pcell-allow { color: var(--allow); background: var(--allow-bg); border-color: var(--allow-line); }
.pcell-approve { color: var(--degrade); background: var(--degrade-bg); border-color: var(--degrade-line); }
.pcell-deny { color: var(--deny); background: var(--deny-bg); border-color: var(--deny-line); }
.pcell-dual, .pcell-exception { color: var(--pending); background: var(--pending-bg); border-color: var(--pending-line); }
.pcell-local { color: var(--ink-500); background: #eef2f8; border-color: var(--line-strong); }
.pcell:hover { filter: brightness(.96); }

.pmx-col-dim { opacity: .45; }
.pmx-col-hl { background: var(--boundary-50); }
.cell-flash { animation: flash-deny .45s linear 2; border-radius: var(--radius-tag); }

/* ---------- 评分环 ---------- */
.score-ring { position: relative; width: 76px; height: 76px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { stroke: var(--line); }
.score-ring .ring-fg { stroke: var(--boundary-600); transition: stroke-dashoffset 1s ease; }
.score-ring .score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}

/* ---------- 证据目录树 ---------- */
.tree-node { border: 1px solid var(--line); border-radius: var(--radius-ctl); overflow: hidden; }
.tree-node + .tree-node { margin-top: 8px; }
.tree-node summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--surface);
  font-size: 13px;
}
.tree-node summary::-webkit-details-marker { display: none; }
.tree-node summary:hover { background: #f4f7fb; }
.tree-node .tree-caret { transition: transform .18s; color: var(--ink-500); flex: none; }
.tree-node[open] .tree-caret { transform: rotate(90deg); }
.tree-node .tree-body { border-top: 1px solid var(--line); background: #fafcfe; padding: 10px 14px; }
.tree-node.pending-gen { opacity: .45; pointer-events: none; }
.tree-node.gen-done { animation: tl-in .35s ease-out; }

.count-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--boundary-600);
  background: var(--boundary-50);
  border: 1px solid var(--boundary-200);
  border-radius: 999px;
  padding: 1px 8px;
}

/* JSON 抽样块 */
.json-block {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 18px;
  color: var(--ink-700);
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-tag);
  padding: 10px 12px;
  white-space: pre;
  overflow-x: auto;
}

/* ---------- diff 行 ---------- */
.diff-line {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 20px;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
}
.diff-line.del { background: var(--deny-bg); color: var(--deny); }
.diff-line.add { background: var(--allow-bg); color: var(--allow); }
.diff-line.del::before { content: "− "; font-weight: 700; }
.diff-line.add::before { content: "+ "; font-weight: 700; }

/* ---------- 模态弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 61, .38);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  width: 480px;
  max-width: 100%;
  animation: tl-in .28s ease-out;
}

/* ---------- 演示引导条 ---------- */
.tour-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--boundary-200);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 10px 14px;
}
.tour-bar-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tour-step {
  font-size: 11px;
  font-weight: 700;
  color: var(--boundary-600);
  background: var(--boundary-50);
  border: 1px solid var(--boundary-200);
  border-radius: 999px;
  padding: 2px 8px;
}
.tour-hint { font-size: 12px; color: var(--ink-500); }
.tour-bar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
body.has-tour-bar { padding-bottom: 72px; }

.vertical-switch {
  display: block;
  margin-top: 10px;
  width: 100%;
  text-align: left;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-500);
  font-size: 11px;
  padding: 6px 8px;
  border-radius: var(--radius-tag);
  cursor: pointer;
  font-family: inherit;
}
.vertical-switch:hover { color: var(--boundary-600); border-color: var(--boundary-300); }

/* 工单闭环结果卡 */
.local-close-card {
  margin-top: 16px;
  border: 1px solid var(--allow-line);
  background: var(--allow-bg);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.local-close-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--allow); }

/* 可点击风险链路行 */
tr.risk-row { cursor: pointer; }
tr.risk-row:hover { background: var(--boundary-50); }

/* ---------- 响应式：侧栏图标态 / 移动降级 ---------- */
@media (max-width: 1279px) {
  .dccp-sidebar {
    width: 64px;
    padding: 12px 6px;
  }
  .dccp-sidebar .nav-item {
    justify-content: center;
    padding: 10px 8px;
    font-size: 0;
    gap: 0;
  }
  .dccp-sidebar .nav-item svg { margin: 0; }
  .dccp-sidebar > div { display: none; }
}

@media (max-width: 767px) {
  .map-stage { display: none !important; }
  .map-card-fallback { display: block !important; }
  .pmx-scroll-hint { display: block !important; }
}

.map-card-fallback { display: none; }
.pmx-scroll-hint {
  display: none;
  font-size: 12px;
  color: var(--ink-500);
  margin: 0 0 8px;
}

/* ---------- 减动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .gateline.flow-allow .gateline-dot { left: 30%; opacity: 1; animation: none; }
  .gateline.flow-deny .gateline-dot { animation: none; }
}
