/**
 * [INPUT]: 依赖 index.html 与 app.js 的元素及状态类
 * [OUTPUT]: 对外提供 主题、布局与无障碍样式
 * [POS]: 浏览器表现层
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */
/* ══════════════════════════════════════════════════════════════════
   圈层谣言攻防战 —— 样式表

   配色说明（这是按数据可视化规范跑过校验的一组值，不要随手改）：

   · 三条折线系列用分类色板前三槽：蓝 #3987e5 / 橙 #d95926 / 青 #199e70，
     在深色画布 #161922 上通过了全配对色盲检查（最差 CVD ΔE 9.4）。
   · 四类节点状态是"状态色"而非"系列色"，固定不参与主题化：
     灰 #8b93a1 / 黄 #fab219 / 红 #e66767 / 绿 #0ca30c。
     红↔绿在红绿色盲下 ΔE 只有 7.1（警戒带）—— 因此**颜色绝不单独承载语义**：
     节点用形状区分（空心环 / 半填充 / 实心+! / 实心+✓），
     每条进度条都带形状标记 + 文字标签 + 数值，色盲用户和黑白打印都能读。
   ══════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* 画布与面板 */
  --plane:        #0d0f14;
  --surface:      #161922;
  --surface-2:    #1c2029;
  --surface-3:    #232833;

  /* 文字与线条 */
  --ink:          #ffffff;
  --ink-2:        #c3c2b7;
  --ink-muted:    #898781;
  --gridline:     #242833;
  --baseline:     #333a49;
  --border:       rgba(255, 255, 255, 0.10);
  --border-strong:rgba(255, 255, 255, 0.18);

  /* 分类系列色（折线图专用） */
  --series-1:     #3987e5;  /* 即时影响深度 */
  --series-2:     #d95926;  /* 时间留存长度 */
  --series-3:     #199e70;  /* 破圈传播广度 */

  /* 状态色（节点状态专用，永不挪作他用） */
  --st-gray:      #8b93a1;
  --st-yellow:    #fab219;
  --st-red:       #e66767;
  --st-green:     #0ca30c;

  --accent:       #3987e5;
  --accent-ink:   #ffffff;

  --radius:       10px;
  --radius-lg:    14px;
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

button { font-family: inherit; }

/* ─────────────────────────── 通用按钮 ─────────────────────────── */

.btn {
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #2b3140; border-color: var(--border-strong); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #4d97ea; border-color: #4d97ea; }

.btn-ghost { background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }

.btn-lg { padding: 11px 30px; font-size: 15px; border-radius: 10px; }

/* ─────────────────────────── 顶栏 ─────────────────────────── */

.topbar {
  flex: 0 0 auto;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-mark { width: 26px; height: 26px; color: var(--st-red); flex: 0 0 auto; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: .3px; }

.topbar-mid {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.round-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.side-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid;
  flex: 0 0 auto;
}
.side-chip[data-side="rumor"]  { color: var(--st-red);   border-color: rgba(230,103,103,.45); background: rgba(230,103,103,.12); }
.side-chip[data-side="debunk"] { color: var(--st-green); border-color: rgba(12,163,12,.45);   background: rgba(12,163,12,.12); }

.topic-chip {
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.engine-chip {
  font-size: 11.5px;
  color: var(--ink-muted);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.engine-chip[data-state="live"]  { color: var(--st-green); border-color: rgba(12,163,12,.4); }
.engine-chip[data-state="local"] { color: var(--ink-muted); }

/* ─────────────────────────── 主体布局 ─────────────────────────── */

.layout {
  flex: 1;
  height: calc(100vh - 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}

.graph-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ─────────────────────────── 关系网画布 ─────────────────────────── */

.graph-stage {
  position: relative;
  flex: 1;
  min-height: 680px;
  min-height: 0;
  background:
    radial-gradient(1100px 620px at 26% 22%, rgba(57,135,229,.055), transparent 62%),
    radial-gradient(1100px 620px at 76% 74%, rgba(25,158,112,.05), transparent 62%),
    var(--plane);
  overflow: hidden;
}

#graph-canvas { display: block; width: 100%; height: 100%; cursor: default; }
#graph-canvas.pickable { cursor: crosshair; }

/* 图例 */
.legend {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(22, 25, 34, .9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 12px;
  min-width: 186px;
}
.legend-title {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .6px;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2.5px 0;
}
.lg-mark { width: 15px; height: 15px; flex: 0 0 auto; position: relative; border-radius: 50%; }
.lg-label { color: var(--ink-2); flex: 1; }
.lg-pct { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px; }

/* 形状通道：每种状态一个可区分的几何形态，颜色只是辅助 */
.lg-gray   { border: 1.5px dashed var(--st-gray); }
.lg-yellow {
  border: 1.5px solid var(--st-yellow);
  background: linear-gradient(to right, var(--st-yellow) 0 50%, transparent 50% 100%);
}
.lg-red    { background: var(--st-red); }
.lg-red::after    { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #16121a; }
.lg-green  { background: var(--st-green); }
.lg-green::after  { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; color: #04140a; }

.legend-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.edge-hint { margin-top: 7px; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }
.edge-line { display: inline-block; width: 18px; border-top: 2px solid currentColor; vertical-align: middle; margin: 0 3px; }
.edge-bridge { border-top-style: dashed; color: #fab219; }
.edge-cross { border-top-style: dotted; color: #8b93a1; }

/* 节点详情卡 */
.node-card {
  position: absolute;
  pointer-events: none;
  background: rgba(22, 25, 34, .97);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 12px;
  min-width: 210px;
  max-width: 268px;
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
  z-index: 5;
}
.nc-name { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.nc-tag { color: var(--ink-muted); font-size: 11px; }
.nc-state { margin: 6px 0; display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.nc-state .lg-mark { width: 12px; height: 12px; }
.nc-state .lg-red::after, .nc-state .lg-green::after { font-size: 8px; }
.nc-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; color: var(--ink-2); font-size: 11.5px; }
.nc-rows b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.nc-traits { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.nc-trait { font-size: 10.5px; color: var(--ink-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
.nc-hint { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 10.5px; }

.graph-status {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22,25,34,.95);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 12.5px;
  color: var(--ink-2);
  backdrop-filter: blur(8px);
}
.graph-status b { color: var(--ink); }

/* ─────────────────────────── 行动区 ─────────────────────────── */

.action-panel {
  flex: 0 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 13px 18px 15px;
  max-height: 27vh;
  min-height: 150px;
  overflow-y: auto;
}

.action-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}
.action-title strong { font-size: 13.5px; }
.action-sub { color: var(--ink-muted); font-size: 12px; margin-left: 9px; }

.target-guide { margin: 10px 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: rgba(57,135,229,.06); }
.target-guide > strong { font-size: 12px; color: var(--ink-2); }
.target-guide-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.target-guide-item { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); border-radius: 7px; padding: 5px 8px; text-align: left; cursor: pointer; font-size: 11px; }
.target-guide-item:hover { border-color: var(--accent); color: var(--ink); }
.target-guide-item b, .target-guide-item span { display: block; }
.target-guide-item span { color: var(--ink-muted); font-size: 10px; }
.tone-row { display:flex; align-items:center; gap:5px; margin-top:6px; font-size:11px; color:var(--ink-muted); }
.tone-row button { border:1px solid var(--border); background:var(--surface-3); color:var(--ink-2); border-radius:5px; padding:2px 7px; cursor:pointer; font-size:11px; }
.tone-row button.active { border-color:var(--accent); background:rgba(57,135,229,.2); color:var(--ink); }
.tone-row em { margin-left:auto; font-style:normal; color:var(--ink-muted); font-size:10px; }
.settle-cause { margin-top:5px; color:var(--ink-muted); font-size:10.5px; }
.ai-intent { color:var(--st-yellow); font-size:11px; white-space:nowrap; }
.goal-guide { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.goal-pill { padding:2px 7px; border-radius:999px; border:1px solid var(--border); color:var(--ink-muted); font-size:10.5px; }
.goal-pill[data-done="true"] { color:var(--st-green); border-color:rgba(12,163,12,.45); }
.event-box { margin:8px 0; padding:10px; border:1px solid rgba(250,178,25,.45); border-radius:9px; background:rgba(250,178,25,.08); }
.event-box b, .event-box span { display:block; }
.event-box span { color:var(--ink-2); font-size:11px; margin:3px 0 7px; }
.event-box button { margin-right:7px; border:1px solid var(--border); background:var(--surface-3); color:var(--ink); border-radius:6px; padding:4px 9px; cursor:pointer; }
.event-box button:focus { border-color:var(--st-yellow); }
.result-recap { margin-top:12px; padding:10px; border-radius:8px; background:var(--surface-2); color:var(--ink-2); }
.ai-intent { color:var(--st-yellow); font-size:11px; white-space:nowrap; }
.event-box { margin:8px 0; padding:10px; border:1px solid rgba(250,178,25,.45); border-radius:9px; background:rgba(250,178,25,.08); }
.event-box b,.event-box span { display:block; }
.event-box span { color:var(--ink-2); font-size:11px; margin:3px 0 7px; }
.event-box button { margin-right:7px; border:1px solid var(--border); background:var(--surface-3); color:var(--ink); border-radius:6px; padding:4px 9px; cursor:pointer; }
.action-progress { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.action-progress b { color: var(--accent); font-size: 14px; }

.content-bank { margin-bottom: 12px; }
.content-bank-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.content-bank-head strong { font-size: 12.5px; flex: 0 0 auto; }
.content-bank-head span { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.content-card { text-align: left; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 9px 10px; cursor: grab; min-width: 0; }
.content-card:hover:not(:disabled) { border-color: var(--accent); }
.content-card b, .content-card span, .content-card em { display: block; }
.content-card b { color: var(--accent); font-size: 11px; margin-bottom: 4px; }
.content-card span { font-size: 11.5px; line-height: 1.5; }
.content-card em { color: var(--st-green); font-size: 10.5px; margin-top: 5px; font-style: normal; }
.content-card .card-hint { color: var(--ink-muted); }
.content-card:disabled { opacity: .48; cursor: default; }
.content-bank-tip { color: var(--ink-muted); font-size: 10.5px; margin: 6px 0 0; }

.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 112px;
}

/* 绑定结果直接显示在话术卡上，底部不再重复显示三个对话框。 */
#slots { display: none; }

.slot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.slot.filled { border-color: var(--border-strong); }
.slot.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(57,135,229,.18); }
.slot.active-target { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(57,135,229,.22); }

.slot-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slot-idx {
  width: 19px; height: 19px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--ink-muted);
}
.slot.filled .slot-idx { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-circle { font-size: 10.5px; color: var(--ink-muted); flex: 0 0 auto; margin-left: auto; }

.slot textarea {
  width: 100%;
  min-height: 62px;
  max-height: 130px;
  resize: vertical;
  background: var(--plane);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s;
}
.slot textarea:focus { border-color: var(--accent); }
.slot textarea::placeholder { color: #5a5f6b; }
.slot textarea:disabled { opacity: .5; }
.slot textarea[readonly] { cursor: default; }

.slot-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--ink-muted); }
.slot-count { font-variant-numeric: tabular-nums; }
.slot-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.slot-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  display: grid;
  place-items: center;
  min-height: 132px;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
  line-height: 1.7;
}

.action-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}
.action-tip { font-size: 11.5px; color: var(--ink-muted); line-height: 1.6; }

/* ─────────────────────────── 侧栏 ─────────────────────────── */

.sidebar {
  border-left: 1px solid var(--border);
  background: var(--plane);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 15px 15px;
}
.card-title { font-size: 13.5px; font-weight: 650; }
.card-sub { font-size: 11.5px; color: var(--ink-muted); margin-top: 1px; margin-bottom: 12px; }

/* ── 四类状态进度条 ── */
.meters { display: flex; flex-direction: column; gap: 11px; }

.meter-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.meter-head .lg-mark { width: 13px; height: 13px; }
.meter-head .lg-red::after, .meter-head .lg-green::after { font-size: 8.5px; }
.meter-label { font-size: 12px; color: var(--ink-2); flex: 1; }
.meter-value { font-size: 13px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.meter-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;      /* 4px 圆角数据端 */
  transition: width .5s cubic-bezier(.4,0,.2,1);
  min-width: 0;
}
.meter[data-state="gray"]   .meter-fill { background: var(--st-gray); }
.meter[data-state="yellow"] .meter-fill { background: var(--st-yellow); }
.meter[data-state="red"]    .meter-fill { background: var(--st-red); }
.meter[data-state="green"]  .meter-fill { background: var(--st-green); }

.meter-foot { font-size: 10.5px; color: var(--ink-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── 折线图 ── */
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.chart-legend-swatch { width: 14px; height: 2.5px; border-radius: 2px; flex: 0 0 auto; }

.chart-wrap { position: relative; }
.line-chart { display: block; width: 100%; height: 172px; overflow: visible; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(13,15,20,.97);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  min-width: 132px;
  box-shadow: 0 8px 22px rgba(0,0,0,.55);
  z-index: 6;
}
.chart-tip-title { color: var(--ink-muted); font-size: 10.5px; margin-bottom: 5px; }
.chart-tip-row { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; }
.chart-tip-row .chart-legend-swatch { width: 10px; height: 2.5px; }
.chart-tip-name { color: var(--ink-2); flex: 1; }
.chart-tip-val { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.table-toggle { margin-top: 10px; }
.table-toggle summary {
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.table-toggle summary::-webkit-details-marker { display: none; }
.table-toggle summary::before { content: "▸ "; }
.table-toggle[open] summary::before { content: "▾ "; }
.table-scroll { overflow-x: auto; margin-top: 8px; }

.data-table { border-collapse: collapse; width: 100%; font-size: 11px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--gridline); white-space: nowrap; }
.data-table th { color: var(--ink-muted); font-weight: 500; }
.data-table td { color: var(--ink-2); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }

/* ── 回合结算 ── */
.settle { display: flex; flex-direction: column; gap: 9px; }
.empty { color: var(--ink-muted); font-size: 12px; }

.settle-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: var(--surface-2);
  font-size: 12px;
}
.settle-item[data-who="ai"] { background: transparent; border-style: dashed; }
.settle-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.settle-who {
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 6px; border-radius: 4px; flex: 0 0 auto;
}
.settle-who[data-who="player"] { background: rgba(57,135,229,.18); color: #7fb4f0; }
.settle-who[data-who="ai"]     { background: rgba(255,255,255,.07); color: var(--ink-muted); }
.settle-node { font-weight: 600; font-size: 12px; }
.settle-tactic {
  font-size: 10.5px; padding: 1.5px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-2);
}
.settle-delta { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.settle-delta.up   { color: var(--st-red); }
.settle-delta.down { color: var(--st-green); }

.settle-dims { display: flex; gap: 12px; margin: 6px 0 5px; font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.settle-dims b { color: var(--ink-2); font-weight: 600; }

.settle-reason { color: var(--ink-2); font-size: 11.5px; line-height: 1.6; }
.settle-quote {
  margin-top: 6px; padding: 6px 9px; border-left: 2px solid var(--border-strong);
  color: var(--ink-muted); font-size: 11px; line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.settle-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge { font-size: 10px; padding: 1.5px 7px; border-radius: 999px; border: 1px solid; }
.badge-warn { color: var(--st-yellow); border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.1); }
.badge-ok   { color: var(--st-green);  border-color: rgba(12,163,12,.45);  background: rgba(12,163,12,.1); }
.badge-llm  { color: #7fb4f0;          border-color: rgba(57,135,229,.45); background: rgba(57,135,229,.1); }

/* ── 日志 ── */
.log { display: flex; flex-direction: column; gap: 7px; max-height: 230px; overflow-y: auto; }
.log-line { font-size: 11.5px; line-height: 1.6; color: var(--ink-2); display: flex; gap: 7px; }
.log-round {
  flex: 0 0 auto; font-size: 10px; color: var(--ink-muted);
  font-variant-numeric: tabular-nums; padding-top: 1px; min-width: 26px;
}
.log-line[data-kind="event"] { color: var(--st-yellow); }
.log-line[data-kind="system"] { color: var(--ink-muted); }

/* ─────────────────────────── 弹窗 ─────────────────────────── */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, .84);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  overflow-y: auto;
}
.modal-mask[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 30px 34px 26px;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}

.modal-title { font-size: 25px; font-weight: 700; letter-spacing: .4px; }
.modal-lead { color: var(--ink-2); font-size: 13px; margin-top: 9px; line-height: 1.75; }
.modal-section { margin-top: 24px; }
.modal-label {
  font-size: 11.5px; color: var(--ink-muted);
  letter-spacing: .7px; margin-bottom: 11px; text-transform: uppercase;
}

.side-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side-option {
  text-align: left;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s, background .15s, transform .12s;
}
.side-option:hover { background: var(--surface-3); transform: translateY(-1px); }
.side-option[aria-pressed="true"][data-side="rumor"]  { border-color: var(--st-red);   background: rgba(230,103,103,.09); }
.side-option[aria-pressed="true"][data-side="debunk"] { border-color: var(--st-green); background: rgba(12,163,12,.09); }
.side-name { font-size: 16px; font-weight: 700; }
.side-option[data-side="rumor"]  .side-name { color: var(--st-red); }
.side-option[data-side="debunk"] .side-name { color: var(--st-green); }
.side-desc { font-size: 12px; color: var(--ink-2); line-height: 1.65; }
.side-goal { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--st-red); }
.dot-green { background: var(--st-green); }

.modal-note { font-size: 11.5px; color: var(--ink-muted); margin-top: 10px; }

.topic-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.topic-option {
  text-align: left;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .15s, background .15s;
}
.topic-option:hover { background: var(--surface-3); }
.topic-option[aria-pressed="true"] { border-color: var(--accent); background: rgba(57,135,229,.09); }
.topic-name { font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.topic-source { display: block; color: var(--accent); font-size: 10.5px; margin-top: 4px; }
.topic-brief {
  font-size: 11px; color: var(--ink-muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-susc { display: flex; gap: 9px; margin-top: 3px; font-size: 10px; color: var(--ink-muted); flex-wrap: wrap; }
.topic-susc span { font-variant-numeric: tabular-nums; }
.susc-hot  { color: var(--st-red); }
.susc-cold { color: var(--st-green); }

.modal-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.modal-warn { font-size: 11px; color: var(--ink-muted); line-height: 1.6; max-width: 460px; }

/* ── 结果弹窗 ── */
.modal-result { width: min(880px, 100%); text-align: center; }
.verdict-badge {
  width: 74px; height: 74px; margin: 0 auto 16px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 34px; font-weight: 800;
}
.verdict-badge[data-win="true"]  { background: rgba(12,163,12,.14); border: 2px solid var(--st-green); color: var(--st-green); }
.verdict-badge[data-win="false"] { background: rgba(230,103,103,.14); border: 2px solid var(--st-red); color: var(--st-red); }
.verdict-badge[data-win="draw"]  { background: rgba(250,178,25,.14); border: 2px solid var(--st-yellow); color: var(--st-yellow); }
.modal-result .modal-lead { max-width: 620px; margin-left: auto; margin-right: auto; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  text-align: left;
}
.result-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
}
.result-cell-label { font-size: 11px; color: var(--ink-muted); }
.result-cell-value { font-size: 24px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.result-cell-note { font-size: 10.5px; color: var(--ink-muted); margin-top: 3px; line-height: 1.5; }

.coverage-strip { display: flex; gap: 9px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.cov-pill {
  font-size: 11.5px; padding: 6px 14px; border-radius: 999px; border: 1px solid;
  display: flex; align-items: center; gap: 7px;
}
.cov-pill[data-hit="true"]  { border-color: rgba(57,135,229,.5); background: rgba(57,135,229,.1); color: #8cbcf4; }
.cov-pill[data-hit="false"] { border-color: var(--border); color: var(--ink-muted); }

.score-bar {
  margin-top: 22px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.score-row { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; font-size: 12px; }
.score-row:last-child { margin-bottom: 0; }
.score-name { width: 128px; color: var(--ink-2); flex: 0 0 auto; }
.score-track { flex: 1; height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.score-val { width: 74px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; flex: 0 0 auto; }
.score-weight { width: 46px; text-align: right; color: var(--ink-muted); font-size: 11px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ─────────────────────────── 响应式 ─────────────────────────── */

@media (max-width: 1180px) {
  html, body { overflow: hidden; }
  .layout { grid-template-columns: 1fr; height: calc(100vh - 54px); }
  .sidebar { border-left: none; border-top: 1px solid var(--border); }
  .graph-stage { height: 58vh; }
  .slots { grid-template-columns: 1fr; }
  .topic-picker, .side-picker { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .brand-name { font-size: 13.5px; }
  .content-cards { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px 20px; }
  .result-grid { grid-template-columns: 1fr; }
  .action-panel { min-height: 136px; max-height: 33vh; padding: 9px 12px; }
  .content-card { padding: 7px 8px; }
  .content-card span { font-size: 10.5px; }
}

/* 强制高对比 / 打印时，把状态色的形状通道再加强一档 */
@media (forced-colors: active) {
  .lg-gray   { border-style: solid; }
  .lg-yellow { background: repeating-linear-gradient(45deg, currentColor 0 2px, transparent 2px 4px); }
  .lg-red::after, .lg-green::after { color: CanvasText; }
}

/* ══════════════════════════════════════════════════════════════════
   模糊 ⇄ 精确数值切换

   pair() 在每处数值都塞了 <span class="fuzzy">档位词</span><span class="precise">精确数</span>
   两份。默认只显示档位词；body 挂上 precise-on 类后翻面。
   注意这只是显示层的开关 —— 服务端所有计算原封不动。
   ══════════════════════════════════════════════════════════════════ */

.precise { display: none; }
body.precise-on .fuzzy { display: none; }
body.precise-on .precise {
  display: inline;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* 档位词用虚线底标出"这是凭感觉的估计"，而不是硬数据 */
.fuzzy {
  color: var(--ink-2);
  font-weight: 600;
  border-bottom: 1px dashed rgba(57, 135, 229, .36);
  padding-bottom: 1px;
}

/* ══════════════════════════════════════════════════════════════════
   精修 · 深色科技风（只动表面光效，不动物料色板与形状通道）
   ══════════════════════════════════════════════════════════════════ */

/* 滚动条：细、暗，不抢画面 */
* { scrollbar-width: thin; scrollbar-color: #2b3140 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #2b3140; border-radius: 999px; border: 2px solid var(--plane); }
*::-webkit-scrollbar-thumb:hover { background: #3a4152; }
*::-webkit-scrollbar-track { background: transparent; }

/* 键盘导航焦点：一圈主色描边，看得见才敢用 Tab */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 顶栏：细渐变 + 底部高光 */
.topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 42%),
    var(--surface);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .04);
}

/* 品牌：符号加呼吸光，字标做一点金属感 */
.brand-mark { filter: drop-shadow(0 0 6px rgba(230, 103, 103, .35)); }
.brand-name {
  background: linear-gradient(180deg, #ffffff, #b4b8c4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 卡片：上高光描边 + 更柔的投影，面板感 */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 46%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .045),
    0 6px 18px rgba(0, 0, 0, .28);
}

/* 主按钮：微光晕，hover 更亮 */
.btn-primary {
  box-shadow: 0 0 0 1px rgba(57, 135, 229, .25), 0 6px 16px rgba(57, 135, 229, .2);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(57, 135, 229, .4), 0 8px 22px rgba(57, 135, 229, .3);
}

/* 槽位输入框聚焦：霓虹描边 */
.slot textarea:focus {
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(57, 135, 229, .16);
}

/* 模态：更深的纵深投影 */
.modal {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 90px rgba(0, 0, 0, .7);
}
