:root {
  color-scheme: light dark;
  --bg: #f4f6f9;
  --bg-subtle: #eef2f6;
  --panel: #ffffff;
  --panel-hover: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --fg: #0f172a;
  --fg-soft: #334155;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --chart: #2563eb;
  --chart-hover: #1d4ed8;
  --chart-grid: #e2e8f0;
  --ok-fg: #047857;
  --ok-bg: #ecfdf5;
  --ok-bd: #a7f3d0;
  --ok-dot: #10b981;
  --warn-fg: #b45309;
  --warn-bg: #fffbeb;
  --warn-bd: #fde68a;
  --warn-dot: #f59e0b;
  --info-fg: #0369a1;
  --info-bg: #f0f9ff;
  --info-bd: #bae6fd;
  --info-dot: #0ea5e9;
  --danger-fg: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-bd: #fecaca;
  --danger-dot: #ef4444;
  --muted-fg: #475569;
  --muted-bg: #f1f5f9;
  --muted-bd: #cbd5e1;
  --muted-dot: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .06);
  --radius: 10px;
  --radius-lg: 14px;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--fg);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-subtle: #111827;
    --panel: #131c2e;
    --panel-hover: #1a253b;
    --line: #1e293b;
    --line-strong: #334155;
    --fg: #f1f5f9;
    --fg-soft: #cbd5e1;
    --muted: #94a3b8;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-soft: rgba(59, 130, 246, .14);
    --primary-border: rgba(96, 165, 250, .32);
    --chart: #3b82f6;
    --chart-hover: #60a5fa;
    --chart-grid: #1e293b;
    --ok-fg: #34d399;
    --ok-bg: rgba(16, 185, 129, .14);
    --ok-bd: rgba(52, 211, 153, .28);
    --ok-dot: #34d399;
    --warn-fg: #fbbf24;
    --warn-bg: rgba(245, 158, 11, .14);
    --warn-bd: rgba(251, 191, 36, .28);
    --warn-dot: #fbbf24;
    --info-fg: #38bdf8;
    --info-bg: rgba(14, 165, 233, .14);
    --info-bd: rgba(56, 189, 248, .28);
    --info-dot: #38bdf8;
    --danger-fg: #f87171;
    --danger-bg: rgba(239, 68, 68, .14);
    --danger-bd: rgba(248, 113, 113, .28);
    --danger-dot: #f87171;
    --muted-fg: #cbd5e1;
    --muted-bg: rgba(148, 163, 184, .14);
    --muted-bd: rgba(148, 163, 184, .28);
    --muted-dot: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dt, dd, ul, ol { margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- 按钮与通用聚焦 ---------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 14px;
  background: var(--panel);
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--primary); color: var(--primary); }
button:disabled { opacity: .48; cursor: not-allowed; }
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}
button.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
button.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); border-color: transparent; color: var(--fg); }

@media (prefers-color-scheme: dark) {
  button.primary, .mark, .step-num { color: #0b1120; font-weight: 600; }
  button.primary:hover:not(:disabled) { color: #0b1120; }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
tr[tabindex]:focus-visible,
.chart-bar-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sub, .eyebrow, small { color: var(--muted); }
.error { color: var(--danger-fg); font-weight: 500; }

/* ---------- 顶栏（登录页与工作台完全统一） ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand, #identity { display: flex; align-items: center; gap: 10px; }
.brand { color: var(--muted); font-size: 14px; white-space: nowrap; }
.brand b { color: var(--fg); font-size: 15px; font-weight: 700; }
.divider { width: 1px; height: 16px; background: var(--line-strong); }
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--fg-soft);
  font-size: 13px;
  font-weight: 500;
}
.identity-status { font-size: 13px; color: var(--muted); }

/* ---------- 二级水平导航栏 ---------- */
.nav-wrap {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
}
.nav {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.nav button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 500;
}
.nav button:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--fg); }
.nav button[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}
.nav-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-bd);
}

/* ---------- 主工作区容器 ---------- */
main#app { outline: none; }
.workspace-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 56px;
}

.boot-card {
  max-width: 460px;
  margin: 96px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.boot-line-lg { width: 65%; height: 18px; }
.boot-line-sm { width: 45%; height: 12px; }

/* ---------- 登录页：三步引导 + 二维码 + 醒目核对数字 ---------- */
.login-stage {
  max-width: 980px;
  margin: 44px auto;
  padding: 0 24px 48px;
}
.login {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.login h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.login-lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.steps-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-body strong { display: block; font-size: 14px; color: var(--fg); margin-bottom: 2px; }
.step-body span { display: block; font-size: 13px; color: var(--muted); }
.login-security {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.qrbox {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-canvas-frame {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
}
.qrbox canvas { width: 184px; height: 184px; display: block; image-rendering: pixelated; }

.match-box {
  width: 100%;
  background: var(--primary-soft);
  border: 1.5px solid var(--primary-border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.match-label { text-align: left; }
.match-label strong { display: block; font-size: 13px; color: var(--primary); }
.match-label span { display: block; font-size: 12px; color: var(--muted); }
.code {
  font: 800 36px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  color: var(--primary);
}

.countdown-wrap { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.countdown-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.countdown-svg { width: 100%; height: 6px; display: block; }
.countdown-track-rect { fill: var(--line); }
.countdown-fill-rect { fill: var(--primary); transition: width .25s ease; }
.countdown-wrap.is-expiring .countdown-fill-rect { fill: var(--warn-dot); }
.countdown-wrap.is-expiring .countdown-time { color: var(--warn-fg); font-weight: 600; }

.qr-notice {
  width: 100%;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-bd);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
}
.qr-state-box {
  width: 100%;
  min-height: 240px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.qr-state-title { font-size: 15px; font-weight: 600; color: var(--fg); }
.qr-skeleton { width: 184px; height: 184px; border-radius: 12px; }

/* ---------- 页面标题与只读徽章 ---------- */
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.heading-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.heading h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.heading-sub { font-size: 13px; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
}

/* ---------- 语义徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge--ok { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-bd); }
.badge--ok::before { background: var(--ok-dot); }
.badge--warn { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-bd); }
.badge--warn::before { background: var(--warn-dot); }
.badge--info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.badge--info::before { background: var(--info-dot); }
.badge--danger { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-bd); }
.badge--danger::before { background: var(--danger-dot); }
.badge--muted { color: var(--muted-fg); background: var(--muted-bg); border-color: var(--muted-bd); }
.badge--muted::before { background: var(--muted-dot); }

/* ---------- 工作台 KPI 卡片与双栏图表面板 ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metric--alert {
  border-color: var(--warn-bd);
  background: linear-gradient(180deg, var(--warn-bg) 0%, var(--panel) 65%);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.metric--alert strong { color: var(--warn-fg); }
.metric-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
button.textlink {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
button.textlink:hover:not(:disabled) { background: transparent; text-decoration: underline; }

.desk-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.block h2 { font-size: 16px; font-weight: 650; }
.block-meta { font-size: 12px; color: var(--muted); }

/* 柱状图（带 Y 轴刻度、虚线参考线及悬停/聚焦数值浮层） */
.chart-wrap { padding-top: 26px; }
.chart-area {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  height: 210px;
  align-items: stretch;
}
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 28px;
  font-variant-numeric: tabular-nums;
}
.chart-plot { position: relative; display: flex; flex-direction: column; }
.chart-lines {
  position: absolute;
  inset: 8px 0 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-line { border-top: 1px dashed var(--chart-grid); width: 100%; }
.chart-line:last-child { border-top-style: solid; border-top-color: var(--line-strong); }

.chart {
  position: relative;
  z-index: 1;
  flex: 1;
  list-style: none;
  padding: 8px 6px 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.chart li {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.chart-bar-btn {
  width: 100%;
  max-width: 48px;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}
.chart-bar-btn:hover:not(:disabled),
.chart-bar-btn:focus-visible { background: transparent; border-color: transparent; }
.chart-svg { width: 100%; height: 140px; display: block; overflow: visible; }
.chart-bar-rect { fill: var(--chart); transition: fill .15s; }
.chart-bar-btn:hover .chart-bar-rect,
.chart-bar-btn:focus-visible .chart-bar-rect { fill: var(--chart-hover); }

.chart-tooltip {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translate(-50%, -100%);
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 10;
}
.chart-bar-btn:hover .chart-tooltip,
.chart-bar-btn:focus-visible .chart-tooltip { opacity: 1; }
.chart-x { font-size: 12px; color: var(--muted); margin-top: 8px; white-space: nowrap; }

.stat-list { display: flex; flex-direction: column; }
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.stat-row:last-child { border-bottom: 0; }
.stat-k { color: var(--muted); }
.stat-v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 工具栏、表格列表与翻页 ---------- */
.tools {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tools-left, .tools-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input, select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13.5px;
}
input[type="search"] { min-width: 230px; }

.tablebox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13.5px;
}
tbody tr { transition: background-color .12s; cursor: pointer; }
tbody tr:hover { background: var(--primary-soft); }
tbody tr:last-child td { border-bottom: 0; }
.cell-primary { font-weight: 600; color: var(--fg); }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.cell-excerpt { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg-soft); }
.cell-time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.pager-btns { display: flex; align-items: center; gap: 8px; }

/* ---------- 详情页：吸顶返回条 + 分区卡片 + 时间线 ---------- */
.detail-bar {
  position: sticky;
  top: 60px;
  z-index: 20;
  background: var(--bg);
  padding: 10px 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-bar h1 { font-size: 20px; font-weight: 700; }
.detail-stack { display: flex; flex-direction: column; gap: 16px; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
}
.fact-item { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.detail-subtitle { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
.detail-subtitle--first { margin-top: 0; }
.detailtext {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.photo-pill {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}

.timeline { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline-item { position: relative; padding-left: 18px; border-left: 2px solid var(--line-strong); }
.timeline-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: -5px;
  top: 7px;
}
.timeline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 13.5px; }
.timeline-time { font-size: 12px; color: var(--muted); font-weight: 400; }
.timeline-body { font-size: 13px; color: var(--fg-soft); margin-top: 3px; overflow-wrap: anywhere; }

.recent-posts { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recent-post-item {
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recent-post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ---------- 骨架屏 / 空状态 / 报错状态 ---------- */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--line) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
.skel-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.skel-card { height: 108px; }
.skel-table { height: 280px; }

.state-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 52px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.state-card--error { border-color: var(--danger-bd); }
.state-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.state-card--error .state-icon { background: var(--danger-bg); color: var(--danger-fg); }
.state-title { font-size: 16px; font-weight: 650; color: var(--fg); }
.state-desc { font-size: 13.5px; color: var(--muted); max-width: 440px; }

/* ---------- 响应式适配（1280px / 1920px 优先，800px 窄屏可用不崩） ---------- */
@media (max-width: 900px) {
  .site-header, .nav-wrap, .workspace-body { padding-left: 16px; padding-right: 16px; }
  .login-stage { margin: 20px auto; padding: 0 16px 36px; }
  .login { grid-template-columns: 1fr; padding: 24px 20px; gap: 24px; }
  .metrics, .skel-kpis { grid-template-columns: repeat(2, 1fr); }
  .desk-grid, .facts { grid-template-columns: 1fr; }
  input[type="search"] { min-width: 170px; }
}
@media (max-width: 600px) {
  .site-header { height: auto; min-height: 56px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .metrics, .skel-kpis { grid-template-columns: 1fr; }
  .chart { gap: 4px; }
}

/* ---------- 二期：按钮变体、通知条、看图器、处置表单与弹窗 ---------- */
button.danger {
  background: var(--danger-bg);
  border-color: var(--danger-bd);
  color: var(--danger-fg);
}
button.danger:hover:not(:disabled) {
  background: var(--danger-fg);
  border-color: var(--danger-fg);
  color: #ffffff;
}
button.warn {
  background: var(--warn-bg);
  border-color: var(--warn-bd);
  color: var(--warn-fg);
}
button.warn:hover:not(:disabled) {
  background: var(--warn-fg);
  border-color: var(--warn-fg);
  color: #ffffff;
}

.notice-region {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}
.notice-banner {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.notice-banner--ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.notice-banner--warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.notice-banner--danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger-fg); }
.notice-banner--info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.notice-text { overflow-wrap: anywhere; }

.img-viewer {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.img-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.img-meta { font-size: 12.5px; color: var(--muted); }
.img-ttl { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.img-ttl--warn { color: var(--warn-fg); font-weight: 600; }
.img-ttl--expired { color: var(--danger-fg); font-weight: 600; }
.img-expired { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.img-thumb-btn {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--panel);
  border: 1px solid var(--line-strong);
}
.img-thumb-btn:hover:not(:disabled) { border-color: var(--primary); }
.img-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-fail { padding: 8px; font-size: 11.5px; color: var(--muted); white-space: normal; text-align: center; line-height: 1.4; }

.lightbox-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop { z-index: 60; }
.lightbox-backdrop { z-index: 70; }

.lightbox-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: min(92vw, 960px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lightbox-head,
.lightbox-foot {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.lightbox-foot { border-bottom: 0; border-top: 1px solid var(--line); justify-content: center; }
.lightbox-stage {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  min-height: 240px;
  overflow: auto;
}
.lightbox-img { max-width: 86vw; max-height: 72vh; object-fit: contain; border-radius: 6px; display: block; }
.lightbox-error { color: var(--danger-fg); font-size: 14px; text-align: center; padding: 24px; }

.modal-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: min(92vw, 480px);
  overflow: hidden;
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-summary { font-size: 14px; font-weight: 600; color: var(--fg); }
.modal-consequences {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--fg-soft);
  line-height: 1.6;
}
.modal-field-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg-soft); }
.modal-textarea {
  width: 100%;
  min-height: 82px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}
.modal-field-error,
.form-error { font-size: 13px; color: var(--danger-fg); font-weight: 600; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.action-panel { display: flex; flex-direction: column; gap: 14px; }
.action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resolve-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.form-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-field input,
.form-field select { width: 100%; font-weight: 400; }
.form-field--wide { grid-column: 1 / -1; }

.queue-list { display: flex; flex-direction: column; gap: 14px; }
.queue-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.queue-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.queue-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

@media (max-width: 900px) {
  .notice-region { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
