:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e6eb;
  --text: #1f2933;
  --muted: #6b7684;
  --accent: #2f6fde;
  --accent-soft: #eaf1fd;
  --ok: #1f8a4c;
  --ok-soft: #e6f4ec;
  --warn: #b26b00;
  --warn-soft: #fdf3e2;
  --bad: #c2362c;
  --bad-soft: #fbeaea;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.side { background: #fbfcfd; border-right: 1px solid var(--line); padding: 14px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 600; font-size: 15px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.nav-group { padding: 8px 0 4px; }
.nav-group h4 { margin: 0; padding: 4px 18px; font-size: 12px; color: var(--muted); font-weight: 500; }
.nav-group a { display: block; padding: 6px 18px 6px 26px; color: var(--text); }
.nav-group a:hover { background: var(--accent-soft); text-decoration: none; }
.nav-group a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; border-right: 2px solid var(--accent); }

.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; height: 48px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who b { color: var(--text); font-weight: 500; }
.content { padding: 18px 20px 40px; max-width: 1400px; }

h1 { font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.c2, .grid.c3, .grid.c5 { grid-template-columns: 1fr 1fr; } .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

.toolbar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.form .wide { grid-column: 1 / -1; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
textarea.tall { min-height: 360px; }
input[type="checkbox"] { width: auto; }

button { font: inherit; padding: 6px 12px; border-radius: 4px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
button:hover { border-color: #c9ced6; background: #fafbfc; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #255ec2; }
button.danger { color: var(--bad); border-color: #ecc5c2; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.alert { padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: #234f9e; }

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-all; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

.steps { display: flex; gap: 0; margin: 4px 0 14px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); margin-right: -1px; background: #fff; }
.steps span:first-child { border-radius: 4px 0 0 4px; }
.steps span:last-child { border-radius: 0 4px 4px 0; }
.steps span.done { color: var(--ok); background: var(--ok-soft); }
.steps span.now { color: #fff; background: var(--accent); border-color: var(--accent); }

.bar { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.chart { width: 100%; height: 140px; }
.chart rect { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 10px; }

.login { max-width: 400px; margin: 12vh auto; }
.login .panel { padding: 24px; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
pre.json { background: #fafbfc; border: 1px solid var(--line); border-radius: 4px; padding: 8px; font-size: 12px; overflow: auto; max-height: 260px; margin: 0; }

/* 管理视图 */
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: inherit; display: block; }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 21px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .delta { font-size: 12px; margin-top: 2px; color: var(--muted); }
.tile.alert-on { border-color: #ecc5c2; background: #fffafa; }
.tile.na .value { color: #b6bcc6; font-size: 15px; font-weight: 500; }
.up { color: var(--ok); } .down { color: var(--bad); }
td.ok { color: var(--ok); } td.bad { color: var(--bad); } td.warn { color: var(--warn); }
.persona-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.persona-head .q { color: var(--muted); font-size: 13px; margin-top: 2px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.chip button { border: none; background: none; padding: 0 6px; color: var(--muted); }
.path { color: var(--muted); font-size: 12px; }
.path b { color: var(--text); font-weight: 500; }
.pending li { padding: 6px 0; border-bottom: 1px solid var(--line); list-style: none; display: flex; gap: 8px; align-items: baseline; }
.pending { margin: 0; padding: 0; }
.decision { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.nav-group.sub a { font-size: 13px; color: var(--muted); padding-top: 4px; padding-bottom: 4px; }
details.nav-group summary { cursor: pointer; padding: 4px 18px; font-size: 12px; color: var(--muted); font-weight: 500; list-style: none; }

/* ================= 视觉层：管理者界面 ================= */
:root {
  --bg: #f3f5f9;
  --line: #e4e8ee;
  --text: #182230;
  --muted: #667085;
  --accent: #257de0;
  --accent-soft: #e8f1fd;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --nav-bg: #0f1a2b;
  --nav-ink: #c3cede;
  --nav-dim: #6e7f98;
  font-size: 14px;
}
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
.shell { grid-template-columns: 224px 1fr; background: linear-gradient(to right, var(--nav-bg) 224px, transparent 224px); }
.side { background: var(--nav-bg); border-right: none; color: var(--nav-ink); padding: 18px 0 24px; }
.brand { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); padding: 0 18px 16px; margin-bottom: 10px; color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand small { color: var(--nav-dim); }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #338ced 0%, #6a4ce2 100%); box-shadow: 0 4px 12px rgba(51,140,237,.35); flex: none; }
.nav-group h4 { color: var(--nav-dim); font-size: 11px; letter-spacing: .08em; padding: 10px 18px 6px; }
.nav-group a { color: var(--nav-ink); padding: 7px 18px 7px 22px; margin: 1px 10px; border-radius: 8px; font-size: 13.5px; }
.nav-group a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-group a[aria-current="page"] { background: rgba(51,140,237,.18); color: #fff; border-right: none; box-shadow: inset 3px 0 0 #338ced; }
details.nav-group summary { color: var(--nav-dim); font-size: 11px; letter-spacing: .08em; padding: 10px 18px 6px; }
.nav-group.sub a { color: #9aa8bd; }
.topbar { height: 56px; padding: 0 28px; box-shadow: 0 1px 0 var(--line); border-bottom: none; }
.topbar button { border-radius: 8px; }
.content { padding: 24px 28px 48px; max-width: 1480px; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.2px; margin-bottom: 6px; }
h2 { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.panel { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.grid { gap: 16px; }
.persona-head { margin-bottom: 14px; align-items: center; }
.persona-head .q { font-size: 13px; line-height: 1.6; }
.persona-head .tabs, .seg { display: inline-flex; gap: 2px; padding: 3px; background: #e9edf3; border-radius: 10px; border: none; }
.persona-head .tabs button, .seg button { border: none; border-radius: 8px; padding: 6px 14px; background: transparent; color: #475467; font-size: 13px; }
.persona-head .tabs button.on, .seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.12); font-weight: 600; }
.filters { margin-bottom: 16px; }
.chip { border-radius: 999px; background: #fff; box-shadow: var(--shadow); }

/* 数字卡片 */
.tiles { grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { position: relative; border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); border-color: var(--line); overflow: hidden; min-height: 104px; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, #338ced, #6aabf1); opacity: .85; }
.tile .label { font-size: 12.5px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 680; letter-spacing: -.4px; margin-top: 6px; color: var(--text); }
.tile .delta { font-size: 12px; margin-top: 4px; }
.tile .up, .tile .down { font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.tile .up { background: #e7f6ec; color: #0f7b2c; }
.tile .down { background: #fdecec; color: #c0282d; }
.tile.alert-on { background: #fff; border-color: #f3c3c3; }
.tile.alert-on::before { background: linear-gradient(90deg, #ec4647, #f47230); }
.tile.na::before { background: #d6dbe3; }
.tile.na .value { color: #a2abb8; font-size: 16px; font-weight: 500; }
a.tile:hover { border-color: #9dc8f7; box-shadow: 0 4px 14px rgba(37,125,224,.12); }
.tile-spark { width: 100%; height: 26px; margin-top: 8px; }
.spark { width: 100%; height: 100%; display: block; overflow: visible; }

/* 表格与横条 */
th { background: #f8fafc; color: #667085; font-size: 12px; font-weight: 600; }
th, td { border-bottom-color: #eef1f5; padding: 8px 10px; }
.bar { height: 8px; background: #edf2f9; border-radius: 999px; }
.bar i { border-radius: 999px; background: linear-gradient(90deg, #338ced, #257de0); }
.pending li, .decision { border-bottom-color: #eef1f5; padding: 9px 0; }

/* 图表 */
.chart-wrap { position: relative; }
.legend { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 14px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.line-chart { width: 100%; height: auto; display: block; cursor: crosshair; }
.grid-line { stroke: #eef1f5; stroke-width: 1; }
.axis { fill: #8a94a6; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.axis-title { fill: #667085; font-size: 12px; }
.cross { stroke: #98a2b3; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 8px; pointer-events: none; background: rgba(17, 24, 39, .94); color: #fff; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; line-height: 1.6; box-shadow: 0 8px 24px rgba(16,24,40,.22); min-width: 140px; z-index: 5; white-space: nowrap; }
.tip b { display: block; margin-bottom: 2px; }
.tip div { display: flex; align-items: center; gap: 6px; }
.tip div i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tip div span { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* 加载 */
.loading { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 28px 0; color: var(--muted); font-size: 13px; }
.loading i { width: 7px; height: 7px; border-radius: 50%; background: #338ced; animation: pulse 1s infinite ease-in-out; }
.loading i:nth-child(2) { animation-delay: .15s; } .loading i:nth-child(3) { animation-delay: .3s; }
.loading span { margin-left: 6px; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* 控件条 */
.controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 16px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ctl select { border-radius: 8px; padding: 6px 10px; min-width: 150px; }
.timeline { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.timeline input[type=range] { width: 220px; accent-color: #257de0; }
.timeline b { font-variant-numeric: tabular-nums; min-width: 48px; }
button.play { border-radius: 8px; background: #257de0; border-color: #257de0; color: #fff; }
button.play:hover { background: #1b64be; }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
.big-tabs { margin-bottom: 16px; }
.big-tabs button { font-size: 14px; padding: 10px 16px; }

/* 地图 */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } }
.map-panel { padding: 12px; }
.map-wrap { position: relative; }
svg.africa { width: 100%; height: auto; max-height: min(64vh, 720px); display: block; border-radius: 10px; }
.sea { fill: #eef3f9; }
.land-bg { fill: #e1e5eb; stroke: #f8fafc; stroke-width: .8; }
.cty { stroke: #ffffff; stroke-width: .9; cursor: pointer; transition: opacity .15s; }
.cty:hover { stroke: #182230; stroke-width: 1.6; }
.cty-outline { fill: none; stroke: #182230; stroke-width: 2.4; pointer-events: none; }
.heat-layer { pointer-events: none; }
.bubble { fill: rgba(244, 114, 48, .62); stroke: #fff; stroke-width: 1.2; cursor: pointer; }
.bubble:hover { fill: rgba(229, 72, 31, .9); }
.map-label { font-size: 13px; font-weight: 600; fill: #182230; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; pointer-events: none; }
.map-tip { top: 0; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 6px 2px; font-size: 12px; }
.scale { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.scale i { width: 160px; height: 10px; border-radius: 999px; display: inline-block; }
.detail .detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.detail .eyebrow { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.detail .big { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.detail-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: 13px; }
.side-panel .panel { margin-bottom: 16px; }
table.rank td { vertical-align: middle; }
table.rank td:first-child { white-space: nowrap; }

/* 热力矩阵与留存队列 */
.matrix-scroll { overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 2px; }
table.matrix th { background: none; text-align: center; padding: 4px; }
table.matrix td { border: none; }
table.matrix td.rlabel { white-space: nowrap; padding-right: 12px; font-size: 13px; }
table.matrix td.cell { text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 7px 4px; border-radius: 4px; min-width: 56px; cursor: default; }
table.matrix td.cell.none { background: #f5f6f8; color: #b6bcc6; }
table.matrix td.cell.blank { background: transparent; }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: 12px; }
.f-row { display: grid; grid-template-columns: 200px 1fr 190px; gap: 16px; align-items: center; }
.f-name { display: flex; flex-direction: column; font-size: 13px; }
.f-name span { font-size: 12px; }
.f-bar { background: #f3f6fa; border-radius: 10px; height: 40px; overflow: hidden; }
.f-bar i { display: flex; align-items: center; height: 100%; border-radius: 10px; min-width: 60px; }
.f-bar span { color: #fff; font-weight: 650; font-size: 14px; padding-left: 14px; font-variant-numeric: tabular-nums; }
.f-rate { display: flex; flex-direction: column; font-size: 12.5px; }

/* 散点 */
svg.scatter { width: 100%; height: auto; display: block; }
.median { stroke: #98a2b3; stroke-dasharray: 4 4; }
.quad-bad { fill: #fdecec; opacity: .7; }
.quad-good { fill: #e7f6ec; opacity: .6; }
.pt { fill-opacity: .6; stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.pt:hover { fill-opacity: .95; }
.pt-label { font-size: 11.5px; fill: #344054; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.side-panel table td:first-child { width: 46% !important; }

/* ---------- 三维地图 ---------- */
.m3-shell { position: relative; height: calc(100vh - 230px); min-height: 560px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #1b2550 0%, #0c1230 45%, #050816 100%);
  box-shadow: 0 18px 50px rgba(8, 12, 40, .35), inset 0 0 0 1px rgba(120, 140, 255, .18); }
.m3-shell:fullscreen { height: 100vh; border-radius: 0; }
.m3-stage { position: absolute; inset: 0; }
.m3-stage canvas { outline: none; }
.m3-card { position: absolute; background: rgba(14, 20, 46, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(140, 160, 255, .22); border-radius: 12px; color: #e6eaf8; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); z-index: 2; }
.m3-top { position: absolute; left: 16px; right: 16px; top: 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 2; }
.m3-top .m3-card { position: static; pointer-events: auto; }
.m3-kpi { padding: 14px 18px; min-width: 210px; }
.m3-eyebrow { font-size: 12px; color: #9fa9d6; letter-spacing: .02em; }
.m3-big { font-size: 34px; font-weight: 700; line-height: 1.15; margin-top: 4px;
  background: linear-gradient(90deg, #ffe066, #ff8a4c 45%, #ff4fb4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.m3-sub { font-size: 12px; color: #b7bfe6; margin-top: 2px; }
.m3-views { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; max-width: 560px; justify-content: flex-end; }
.m3-views button { background: transparent; border: 0; color: #c9d0f2; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.m3-views button:hover { background: rgba(140, 160, 255, .14); }
.m3-views button.on { background: linear-gradient(135deg, #6a4ce2, #e2489d); color: #fff; }
.m3-rank { right: 16px; top: 116px; width: 250px; padding: 12px 14px; }
.m3-row { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 0 7px; }
.m3-row i { position: absolute; left: 26px; bottom: 1px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #6a4ce2, #ff8a4c, #ffe066); }
.m3-n { color: #8f98c8; font-variant-numeric: tabular-nums; }
.m3-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.m3-legend { left: 16px; bottom: 16px; padding: 9px 14px; display: flex; gap: 10px; align-items: center; font-size: 12px; color: #c4cbef; }
.m3-legend i { width: 160px; height: 8px; border-radius: 4px; display: inline-block; }
.m3-legend i.seq { background: linear-gradient(90deg, #2c1e8c, #6012aa, #b02a96, #e65462, #fa9234, #fcde40); }
.m3-legend i.div { background: linear-gradient(90deg, #288cff, #466ebe, #68708c, #d6465a, #ff463c); }
.m3-arc { margin-left: 8px; padding-left: 12px; border-left: 1px solid rgba(140, 160, 255, .25); }
.m3-arc::before { content: ""; display: inline-block; width: 26px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle;
  background: linear-gradient(90deg, #00e6ff, #ff50c8); }
.m3-error { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; color: #ffb4b4; }
.m3-controls { margin-top: 14px; }
@media (max-width: 900px) { .m3-rank { display: none; } .m3-views { max-width: 100%; } }

/* ---------- 用户行为 ---------- */
.legend .lg i.dash { width: 14px; height: 0; border-top: 2px dashed #344054; background: none; }
.tip i.dash { display: inline-block; width: 10px; height: 0; border-top: 2px dashed #344054; margin-right: 6px; vertical-align: middle; }
.base-line { stroke: #98a2b3; stroke-width: 1; }
.col-chart g:hover rect[fill="transparent"] { fill: rgba(37, 125, 224, .06); }
.sankey .sk-link { opacity: .32; transition: opacity .15s; }
.sankey .sk-link:hover, .sankey .sk-link.on { opacity: .7; }
.sankey .sk-label { font-size: 12px; fill: #344054; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.calendar { max-height: 150px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); align-items: start; }
@media (max-width: 1100px) { .grid2, .grid2.wide-right { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: #e7f6ec; color: #0f7b2c; }
.pill.warn { background: #fff4e0; color: #a15c00; }
.pill.bad { background: #fdecec; color: #c0282d; }
td.ok { color: #0f7b2c; } td.bad { color: #c0282d; }
.sankey .sk-head { font-size: 12.5px; font-weight: 600; fill: #667085; }

/* 数据范围筛选栏 */
.scope-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px;padding:8px 12px;background:var(--panel,#fff);border:1px solid var(--line,#e5e7eb);border-radius:10px}
.scope-bar .scope-title{font-size:12px;color:var(--muted,#6b7280);margin-right:4px}
.scope-bar select{min-width:130px;padding:5px 8px;border-radius:7px;border:1px solid var(--line,#e5e7eb);background:transparent;font-size:13px}
.scope-bar select.set{border-color:var(--accent,#4f46e5);color:var(--accent,#4f46e5);font-weight:600;background:color-mix(in srgb,var(--accent,#4f46e5) 7%,transparent)}
.scope-bar button.link{background:none;border:none;color:var(--accent,#4f46e5);cursor:pointer;font-size:13px;padding:4px 6px}

/* ---------- 窄屏与手机 ---------- */
.menu-btn { display: none; }
.panel, .side-panel { min-width: 0; }
.panel:has(> table), .panel:has(> .table-scroll) { overflow-x: auto; }
table.matrix { min-width: max-content; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .side { position: sticky; top: 0; z-index: 50; height: auto; max-height: 100vh; padding: 10px 0; }
  .side .brand { padding: 0 14px; margin: 0; border-bottom: none; }
  .side .brand > div { flex: 1; }
  .menu-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
  .side .nav-group { display: none; }
  .side.open { overflow-y: auto; }
  .side.open .nav-group { display: block; }
  .side.open .brand { padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
  .topbar { padding: 0 14px; height: 48px; }
  .content { padding: 14px 14px 40px; }
  .grid.c2, .grid.c3, .grid.c4, .grid.c5, .grid2, .grid2.wide-right, .map-layout { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 22px; }
  .persona-head { flex-direction: column; align-items: stretch; }
  .persona-head h1 { font-size: 20px; }
  .persona-head .tabs, .tabs, .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs button, .seg button { white-space: nowrap; flex: none; }
  .controls { flex-wrap: wrap; }
  .controls .ctl, .controls select { max-width: 100%; }
  .timeline { flex: 1 1 100%; }
  .scope-bar select { flex: 1 1 140px; min-width: 0; }
  .f-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  dl.kv { grid-template-columns: 96px minmax(0, 1fr); }
  .panel { padding: 14px; }
  .form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile .value { font-size: 19px; }
  .tile .muted { font-size: 11px !important; }
}
.map-panel { overflow: hidden; }
.map-layout > div, .side-panel { min-width: 0; }
@media (max-width: 900px) { .panel:has(table.rank) { overflow-x: auto; } }

/* ---------- 电脑大屏 ---------- */
.resp { width: 100%; }
.resp > svg { width: 100%; height: auto; display: block; }
@media (min-width: 1700px) {
  .content { max-width: 2400px; padding: 28px 36px 56px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .grid.c2.wide-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 2200px) {
  body { font-size: 15px; }
  .tile .value { font-size: 30px; }
  .panel h2 { font-size: 16px; }
}
@media (min-width: 901px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); } }
@media (min-width: 1700px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
@media (min-width: 2200px) { .axis { font-size: 12px; } .legend { font-size: 13px; } }

/* ---------- 大屏看板（1920×1080 画布，等比缩放） ---------- */
.wall { position: fixed; inset: 0; background: #050916; overflow: hidden; color: #e6ecff; }
.wall-canvas { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: center center;
  display: grid; grid-template-columns: 470px minmax(0, 1fr) 470px; grid-template-rows: 84px minmax(0, 1fr); gap: 18px; padding: 0 24px 24px;
  background: radial-gradient(1200px 700px at 50% 45%, #13245a 0%, #0a1330 45%, #050916 100%); font-size: 15px; }
.wall-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(120, 160, 255, .18);
  background: linear-gradient(90deg, rgba(54, 215, 255, 0), rgba(54, 215, 255, .08) 50%, rgba(54, 215, 255, 0)); }
.wall-title { font-size: 34px; font-weight: 700; letter-spacing: 2px; background: linear-gradient(90deg, #7fe3ff, #b9a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wall-title small { display: block; font-size: 14px; letter-spacing: .5px; color: #8b98c9; -webkit-text-fill-color: #8b98c9; font-weight: 400; margin-top: 2px; }
.wall-meta { display: flex; align-items: center; gap: 18px; color: #9fb0e0; font-size: 15px; }
.wall-clock { font-size: 24px; font-variant-numeric: tabular-nums; color: #e6ecff; letter-spacing: 1px; }
.wall-live i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2ee59d; margin-right: 8px; box-shadow: 0 0 10px #2ee59d; animation: wallpulse 1.6s infinite; }
@keyframes wallpulse { 50% { opacity: .35; } }
.wall-btn { border: 1px solid rgba(127, 227, 255, .35); background: rgba(127, 227, 255, .06); color: #bfefff; border-radius: 8px; padding: 6px 14px; font-size: 14px; cursor: pointer; text-decoration: none; }
.wall-left, .wall-right, .wall-center { display: flex; flex-direction: column; gap: 18px; min-height: 0; min-width: 0; }
.wall-card { background: linear-gradient(180deg, rgba(25, 42, 92, .72), rgba(12, 22, 52, .72)); border: 1px solid rgba(110, 150, 255, .2); border-radius: 14px; padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .25); min-height: 0; }
.wall-card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; color: #dbe4ff; padding-left: 10px; border-left: 3px solid #36d7ff; }
.wall-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wall-kpi { background: linear-gradient(160deg, rgba(54, 215, 255, .14), rgba(120, 90, 255, .08)); border: 1px solid rgba(110, 150, 255, .22); border-radius: 14px; padding: 14px 16px; }
.wall-kpi .l { color: #9fb0e0; font-size: 14px; }
.wall-kpi .v { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.2; margin-top: 4px; text-shadow: 0 0 18px rgba(54, 215, 255, .35); }
.wall-delta { font-size: 14px; font-weight: 600; }
.wall-delta.up { color: #2ee59d; } .wall-delta.down { color: #ff6b8b; }
.wall .axis { fill: #8b98c9; font-size: 12px; }
.wall .grid-line { stroke: rgba(140, 170, 255, .12); }
.wall .base-line { stroke: rgba(140, 170, 255, .4); }
.wall .legend { color: #b9c5ee; font-size: 13px; }
.wall .tip { background: #0d1838; color: #e6ecff; border-color: rgba(110, 150, 255, .35); }
.wall .cross { stroke: rgba(255, 255, 255, .35); }
.wall .line-chart polygon { opacity: .6; }
.wall-stack { display: flex; height: 16px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 12px; }
.wall-stack i { display: block; height: 100%; }
.wall-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 14px; color: #c9d3f5; }
.wall-legend span { display: flex; align-items: center; gap: 8px; }
.wall-legend i { width: 10px; height: 10px; border-radius: 3px; }
.wall-legend b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }
.wall-center .wall-map { position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; border: 1px solid rgba(110, 150, 255, .2);
  background: radial-gradient(900px 600px at 50% 40%, #142a66, #070d24 70%); }
.wall-map-tag { position: absolute; left: 18px; top: 16px; z-index: 2; pointer-events: none; }
.wall-map-tag b { display: block; font-size: 26px; color: #fff; text-shadow: 0 0 14px rgba(54, 215, 255, .5); }
.wall-map-tag span { font-size: 13px; color: #9fb0e0; }
.wall-dots { position: absolute; right: 18px; top: 22px; display: flex; gap: 8px; z-index: 2; }
.wall-dots i { width: 26px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.wall-dots i.on { background: #36d7ff; box-shadow: 0 0 10px #36d7ff; }
.wall-rank .row { display: grid; grid-template-columns: 28px 92px 1fr 66px 86px; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; }
.wall-rank .no { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 13px; color: #b9c5ee; }
.wall-rank .no.top { background: linear-gradient(135deg, #36d7ff, #7a6bff); color: #fff; font-weight: 700; }
.wall-rank .bar { height: 10px; background: rgba(255, 255, 255, .06); border-radius: 5px; overflow: hidden; }
.wall-rank .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2a7bff, #36d7ff); }
.wall-rank b { text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.wall-rank small { color: #8b98c9; font-size: 12px; text-align: right; }
.wall-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wall-quality .q { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border-left: 3px solid; }
.wall-quality .q b { font-size: 22px; font-variant-numeric: tabular-nums; }
.wall-quality .ok { border-color: #2ee59d; } .wall-quality .ok b { color: #2ee59d; }
.wall-quality .warn { border-color: #ffb347; } .wall-quality .warn b { color: #ffb347; }
.wall-quality .bad { border-color: #ff6b8b; } .wall-quality .bad b { color: #ff6b8b; }
.wall-feed-card { flex: 1; display: flex; flex-direction: column; }
.wall-feed { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
.wall-feed .roll { animation: wallroll 60s linear infinite; }
@keyframes wallroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.wall-feed .f { display: grid; grid-template-columns: 52px 1fr 110px 64px; gap: 8px; padding: 8px 0; border-bottom: 1px dashed rgba(140, 170, 255, .14); font-size: 14px; }
.wall-feed .t { color: #7fe3ff; font-variant-numeric: tabular-nums; }
.wall-feed .p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-feed .m { color: #9fb0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-feed .s { text-align: center; border-radius: 6px; font-size: 12px; padding: 2px 0; }
.wall-feed .s.ok { background: rgba(46, 229, 157, .14); color: #2ee59d; }
.wall-feed .s.warn { background: rgba(255, 179, 71, .14); color: #ffb347; }
.wall-feed .s.bad { background: rgba(255, 107, 139, .14); color: #ff6b8b; }
.export-btn { margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.export-btn:hover { color: var(--accent); border-color: var(--accent); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.wall-left > .wall-card:last-child { flex: 1; }
.table-tools { display: flex; align-items: center; gap: 10px; margin: -4px 0 8px; font-size: 12px; }
.cty, .land-bg, .bubble, .cty-outline { vector-effect: non-scaling-stroke; }
.map-label { stroke-width: calc(3px * var(--k, 1)); }
.empty-state { text-align: center; padding: 64px 24px; background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; color: var(--text); }
.empty-state .es-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.empty-state h3 { margin: 0 0 8px; font-size: 17px; }
.empty-state p { margin: 4px auto; max-width: 560px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }

/* 上报策略、完整性与驻留区域 */
.grid2.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.form-row > .field, .form-row > input { flex: 1; min-width: 140px; }
.panel.editor { border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.panel.editor textarea { width: 100%; min-height: 220px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 4px 10px; font-size: 12px; cursor: pointer; border: 1px solid var(--line); }
.chips .chip:hover { border-color: var(--accent); color: var(--accent); }
.file-pick { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px dashed var(--accent); border-radius: 8px; color: var(--accent); cursor: pointer; margin-bottom: 10px; }
.file-pick input { display: none; }
@media (max-width: 1400px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .grid2.wide-left, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* 2K 与 4K 显示器：字号随宽度适度放大，避免大屏上文字过小。 */
@media (min-width: 2400px) {
  body { font-size: 16px; }
  .tile .label { font-size: 14px; }
  .tile .value { font-size: 34px; }
  .panel h2 { font-size: 18px; }
  table { font-size: 15px; }
  .persona-head h1, .content > h1 { font-size: 30px; }
  .side a { font-size: 15px; }
}
@media (min-width: 3200px) {
  body { font-size: 18px; }
  .content { max-width: 3200px; }
  .tile .value { font-size: 40px; }
  .panel h2 { font-size: 20px; }
  table { font-size: 17px; }
  .axis { font-size: 14px; } .legend { font-size: 15px; }
}
table.kv-edit td { padding: 6px 8px; vertical-align: middle; }
label.switch { display: inline-flex; gap: 8px; align-items: center; }
.chips .chip:disabled { opacity: .4; cursor: default; border-color: var(--line); color: inherit; }
.batch-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--accent-soft); position: sticky; top: 0; z-index: 5; }
.batch-confirm { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.batch-confirm span { flex: 1; min-width: 240px; }

/* 运行与异常 */
.anomalies td { vertical-align: middle; }
.anomalies tr.sev-high td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.anomalies tr.sev-medium td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.anomalies b.up, .anomalies small.up { color: var(--bad); }
.anomalies b.down, .anomalies small.down { color: var(--accent); }
.anomalies small.note { display: block; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anomalies tr.expand td { background: var(--bg); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; align-self: flex-end; padding-bottom: 6px; }

/* ================= 主题切换与图表标注 ================= */
.top-actions { display: inline-flex; gap: 8px; align-items: center; }
select.theme { padding: 5px 8px; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.line-chart .dot { stroke: var(--panel); stroke-width: 2; }
.amark line { stroke-dasharray: 2 3; stroke-width: 1; }
.amark circle { stroke: var(--panel); stroke-width: 1.5; }
.amark.high line { stroke: var(--bad); } .amark.high circle { fill: var(--bad); }
.amark.medium line { stroke: var(--warn); } .amark.medium circle { fill: var(--warn); }
.amark.low line { stroke: var(--muted); } .amark.low circle { fill: var(--muted); }
.tip .tip-mark { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.18); color: #ffd0c9; white-space: normal; max-width: 260px; }
:root { --map-empty: #e9ecf1; --map-land: #eef1f5; }
.ref-line { stroke: #344054; }
.chart-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.chart-note a { margin-left: 6px; }

/* 顶栏：搜索、保存视图 */
.pop-anchor { position: relative; display: inline-block; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 280px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .16); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pop-anchor.search { flex: 1; max-width: 520px; margin-right: 16px; }
.pop-anchor.search input { width: 100%; border-radius: 8px; padding: 7px 12px; }
.popover.results { left: 0; right: auto; width: 100%; gap: 2px; padding: 6px; max-height: 420px; overflow-y: auto; }
.popover.results .hit { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 6px; color: var(--text); cursor: pointer; }
.popover.results .hit:hover { background: var(--accent-soft); text-decoration: none; }
.popover.results .muted { padding: 8px; font-size: 12.5px; }
.link + .link { margin-left: 10px; }
.top-actions a.who { color: var(--text); font-size: 13px; padding: 0 4px; }

/* 深色主题：只替换颜色，版式不变。界面中固定写死的浅色在此逐项覆盖。 */
:root[data-theme="dark"] {
  --bg: #0e131a;
  --panel: #161c25;
  --line: #263040;
  --text: #e4e8ef;
  --muted: #98a2b3;
  --accent: #4c9bf0;
  --accent-soft: rgba(76, 155, 240, .16);
  --ok: #43b874;
  --ok-soft: rgba(67, 184, 116, .16);
  --warn: #e0a640;
  --warn-soft: rgba(224, 166, 64, .16);
  --bad: #f0675d;
  --bad-soft: rgba(240, 103, 93, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --nav-bg: #0a0f15;
  --map-empty: #263042;
  --map-land: #222b3a;
}
[data-theme="dark"] th, [data-theme="dark"] pre.json, [data-theme="dark"] button:hover { background: #1b2230; color: var(--muted); }
[data-theme="dark"] th, [data-theme="dark"] td { border-bottom-color: var(--line); }
[data-theme="dark"] tr.click:hover td { background: #1b2230; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea, [data-theme="dark"] button,
[data-theme="dark"] .steps span, [data-theme="dark"] .chip, [data-theme="dark"] .controls, [data-theme="dark"] .export-btn,
[data-theme="dark"] .tile.alert-on { background: var(--panel); color: var(--text); border-color: var(--line); }
[data-theme="dark"] button:hover { border-color: #3a475b; }
[data-theme="dark"] button.primary, [data-theme="dark"] .steps span.now, [data-theme="dark"] button.play { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] button.danger { color: var(--bad); border-color: rgba(240, 103, 93, .45); }
[data-theme="dark"] .badge { background: #222b39; }
[data-theme="dark"] .alert.info { color: #a9cdf7; }
[data-theme="dark"] .persona-head .tabs, [data-theme="dark"] .seg { background: #1b2230; }
[data-theme="dark"] .persona-head .tabs button, [data-theme="dark"] .seg button { color: var(--muted); background: transparent; }
[data-theme="dark"] .persona-head .tabs button.on, [data-theme="dark"] .seg button.on { background: #2a3445; color: var(--text); }
[data-theme="dark"] .tile .up, [data-theme="dark"] .pill.ok { background: var(--ok-soft); color: var(--ok); }
[data-theme="dark"] .tile .down, [data-theme="dark"] .pill.bad { background: var(--bad-soft); color: var(--bad); }
[data-theme="dark"] .pill.warn { background: var(--warn-soft); color: var(--warn); }
[data-theme="dark"] td.ok { color: var(--ok); } [data-theme="dark"] td.bad { color: var(--bad); }
[data-theme="dark"] .tile.alert-on { border-color: rgba(240, 103, 93, .45); }
[data-theme="dark"] .tile.na .value { color: #5b6677; }
[data-theme="dark"] .tile.na::before { background: #2a3445; }
[data-theme="dark"] .bar, [data-theme="dark"] .f-bar { background: #222b39; }
[data-theme="dark"] .grid-line { stroke: #222b39; }
[data-theme="dark"] .axis { fill: #7d8899; }
[data-theme="dark"] .axis-title, [data-theme="dark"] .sankey .sk-head { fill: var(--muted); }
[data-theme="dark"] .cross, [data-theme="dark"] .median, [data-theme="dark"] .base-line { stroke: #5b6677; }
[data-theme="dark"] .tip { background: rgba(36, 44, 58, .97); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
[data-theme="dark"] .legend .lg i.dash, [data-theme="dark"] .tip i.dash { border-top-color: var(--muted); }
[data-theme="dark"] .sea { fill: #111824; }
[data-theme="dark"] .land-bg { fill: #283243; stroke: #161c25; }
[data-theme="dark"] .cty { stroke: #161c25; }
[data-theme="dark"] .cty:hover, [data-theme="dark"] .cty-outline { stroke: #e4e8ef; }
[data-theme="dark"] .bubble, [data-theme="dark"] .pt { stroke: var(--panel); }
[data-theme="dark"] .map-label, [data-theme="dark"] .pt-label, [data-theme="dark"] .sankey .sk-label { fill: var(--text); stroke: rgba(14, 19, 26, .85); }
[data-theme="dark"] table.matrix td.cell.none { background: #1b2230; color: #5b6677; }
[data-theme="dark"] .quad-bad { fill: var(--bad-soft); opacity: 1; }
[data-theme="dark"] .quad-good { fill: var(--ok-soft); opacity: 1; }
[data-theme="dark"] .scope-bar select { color: var(--text); }
[data-theme="dark"] .ref-line { stroke: var(--muted); }
@media (max-width: 900px) {
  .pop-anchor.search { margin-right: 8px; max-width: none; }
  .top-actions a.who, .top-actions select.theme { display: none; }
}

/* 数据质量：每日结果色块 */
.dq-strip { display: inline-flex; gap: 2px; vertical-align: middle; }
.dq-strip i { display: inline-block; width: 7px; height: 14px; border-radius: 2px; }
