/* =========================================================
   智汇电算 · 管理后台视觉系统
   主色：深蓝 → 青绿渐变；点缀：暖橙（重要）
   全部资源本地内联，无外部字体/CDN/图片依赖
   ========================================================= */

:root {
  --brand-900: #072b40;
  --brand-800: #0a3a52;
  --brand-700: #0d4a63;
  --brand-600: #116a72;
  --brand-500: #0f766e;
  --brand-400: #14a08c;
  --brand-300: #56c1ad;
  --brand-100: #d9f0ea;

  --accent: #e8842b;
  --accent-600: #cf6d16;
  --accent-100: #fdf0e2;

  --ink: #12232e;
  --ink-2: #33474f;
  --muted: #5f7480;
  --line: #e2eaef;
  --line-strong: #cfdae1;
  --canvas: #eef3f6;
  --surface: #ffffff;
  --surface-2: #f7fafb;

  --ok: #0f8a5f;
  --ok-bg: #e6f6ee;
  --warn: #c2410c;
  --warn-bg: #fff2e3;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --info: #0b6d9c;
  --info-bg: #e8f3fa;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(10, 40, 55, .06);
  --shadow: 0 8px 24px rgba(10, 40, 55, .07);
  --shadow-lg: 0 18px 48px rgba(7, 35, 50, .16);
  --gradient: linear-gradient(118deg, var(--brand-900) 0%, var(--brand-700) 42%, var(--brand-500) 100%);
  --gradient-soft: linear-gradient(135deg, #e8f5f2 0%, #eef3f6 60%, #fdf3e7 100%);

  /* 版心与间距：常规桌面 1360 居中，避免超宽屏两侧大片留白、也避免 1440 下贴边 */
  --page-max: 1360px;
  --gutter: clamp(18px, 2.2vw, 40px);
  --gap: 18px;
  --fs-base: 15px;
}

* { box-sizing: border-box; }

/* html 也必须上底色：后台每个操作都是整页 POST+302，
   只有 body 有背景时，跳转瞬间浏览器先画一层白底再绘出内容，看起来就是「闪一下」 */
html { background: var(--canvas); }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--brand-600); }
code {
  font-family: "Cascadia Code", Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}

/* ---------- 顶栏：内容与版心左对齐 ---------- */
.topbar {
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  flex-wrap: wrap;
  box-shadow: 0 2px 14px rgba(7, 35, 50, .22);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(255,255,255,.28), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.3);
  font-weight: 800;
  font-size: 17px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: .06em; }
.brand-text small { font-size: 11px; color: rgba(255,255,255,.72); letter-spacing: .04em; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 420px;
  flex-wrap: wrap;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.nav-item .ico { width: 15px; height: 15px; flex: 0 0 15px; opacity: .9; }

.top-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.env-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.env-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .22);
}

/* ---------- 布局 ---------- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 26px var(--gutter) 56px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head .lead { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.card + .card { margin-top: var(--gap); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }

.grid { display: grid; gap: var(--gap); align-items: start; }
.grid.cols-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 1080px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- 统计卡片 ---------- */
.tile {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gradient);
  opacity: .85;
}
.tile.accent::after { background: linear-gradient(180deg, var(--accent), #f2b463); }
.tile .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 30px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.01em; }
.tile .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tile .foot { color: var(--muted); font-size: 13px; }
.tile .foot strong { color: var(--ink-2); font-weight: 700; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--gradient);
  color: #fff;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .15s, box-shadow .15s, background .15s;
  box-shadow: 0 2px 8px rgba(13, 74, 99, .18);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: var(--surface);
  color: var(--brand-700);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand-300); }
.btn.soft {
  background: var(--brand-100);
  color: var(--brand-700);
  box-shadow: none;
}
.btn.soft:hover { background: #c9e8df; }
.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: #f0c6c2;
  box-shadow: none;
}
.btn.danger:hover { background: var(--danger-bg); }
.btn.accent {
  background: linear-gradient(120deg, var(--accent) 0%, #f0a04b 100%);
  box-shadow: 0 2px 8px rgba(232, 132, 43, .25);
}
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: #eef2f5; color: var(--muted); }
.badge.accent { background: var(--accent-100); color: var(--accent-600); }
.badge.brand { background: var(--brand-100); color: var(--brand-700); }

/* ---------- 表格 ---------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 1;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
td.wrap, .cell-title { overflow-wrap: anywhere; word-break: break-word; }
.cell-title { font-weight: 600; color: var(--ink); max-width: 520px; }
.cell-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.cell-url { color: var(--muted); font-size: 12.5px; word-break: break-all; max-width: 300px; }
.cell-url a { color: var(--brand-600); text-decoration: none; }
.cell-url a:hover { text-decoration: underline; }
.cell-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.cell-actions form { display: inline-flex; margin: 0; }

.group-row td {
  background: linear-gradient(90deg, #eaf3f5, #f6fafb);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 14px;
}
.group-row.d1 td { padding-left: 28px; }
.group-row.d2 td { padding-left: 44px; }

/* 成功率进度条 */
.rate { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.rate .bar { flex: 1; height: 6px; border-radius: 99px; background: #e9eff2; overflow: hidden; }
.rate .bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-400), var(--brand-500)); }
.rate.low .bar > i { background: linear-gradient(90deg, #f0a04b, var(--accent)); }
.rate .num { font-size: 12.5px; font-weight: 700; color: var(--ink-2); min-width: 38px; text-align: right; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }

.field label, .row > label, .label-text {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field .hint, .hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 6px 0 0;
  line-height: 1.55;
}
input[type="text"], input[type="password"], input[type="url"], input[type="date"],
input[type="time"], input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(20, 160, 140, .14);
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-500); vertical-align: -2px; }
.check {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 500; font-size: 13.5px; color: var(--ink-2);
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); cursor: pointer; user-select: none;
}
.check:hover { border-color: var(--brand-300); }
.check.on { background: var(--brand-100); border-color: var(--brand-300); color: var(--brand-700); font-weight: 700; }
.check input { margin: 0; }

.day-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.day-picker label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  transition: all .15s;
}
.day-picker label:hover { border-color: var(--brand-300); }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker label:has(input:checked) {
  background: var(--brand-100); border-color: var(--brand-400);
  color: var(--brand-700); font-weight: 700;
}

.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding-top: 16px; margin-top: 18px; border-top: 1px dashed var(--line);
}

/* ---------- 提示条 ---------- */
.flash {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--ok-bg);
  border: 1px solid #bfe6d3;
  color: #0b6b4b;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13.5px;
}
.flash::before { content: "✓"; font-weight: 800; }
.flash.error { background: var(--danger-bg); border-color: #f3c9c5; color: var(--danger); }
.flash.error::before { content: "!"; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--info-bg);
  border: 1px solid #cfe5f2;
  color: #0a5478;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}
.notice.warn { background: var(--warn-bg); border-color: #f6dcc1; color: #9a4408; }
.notice.accent { background: var(--accent-100); border-color: #f2dcc4; color: var(--accent-600); }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.searchbox { position: relative; display: flex; align-items: center; min-width: 220px; flex: 1 1 240px; max-width: 360px; }
.searchbox input { padding-left: 34px; }
.searchbox svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.chip.on { background: var(--gradient); border-color: transparent; color: #fff; }
.chip .count { font-size: 11px; opacity: .8; }

.panel {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.panel h3 { margin-bottom: 6px; }
.cond { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cond select { width: auto; min-width: 150px; }
.cond .btn { flex: 0 0 auto; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 0%, rgba(20, 160, 140, .07), transparent 62%),
    var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty .ico {
  width: 46px; height: 46px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-100);
  color: var(--brand-600);
}
.empty h3 { color: var(--ink-2); margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* ---------- 首页信息块 ---------- */
.hero {
  background:
    radial-gradient(900px 220px at 96% -40%, rgba(86, 193, 173, .28), transparent 70%),
    radial-gradient(700px 200px at 8% 130%, rgba(232, 132, 43, .13), transparent 70%),
    var(--gradient);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.hero h1 { font-size: 24px; letter-spacing: .02em; }
.hero p { margin: 8px 0 0; color: rgba(255,255,255,.82); font-size: 14px; }
.hero .hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.hero .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.32); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.2); }
.hero .btn.accent { box-shadow: 0 4px 14px rgba(232, 132, 43, .35); }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; font-size: 13px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 600; overflow-wrap: anywhere; }
.list-item .meta { color: var(--muted); font-size: 12.5px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot {
  width: 9px; height: 9px; border-radius: 50%; margin-top: 7px;
  background: var(--brand-400); flex: 0 0 9px;
  box-shadow: 0 0 0 3px rgba(20, 160, 140, .14);
}
.tl-dot.warn { background: var(--accent); box-shadow: 0 0 0 3px rgba(232, 132, 43, .16); }
.tl-body { min-width: 0; }
.tl-body .t { font-weight: 600; overflow-wrap: anywhere; }
.tl-body .m { color: var(--muted); font-size: 12.5px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  background: var(--gradient-soft);
}
.login-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 360px at 85% 10%, rgba(86, 193, 173, .35), transparent 65%),
    radial-gradient(560px 300px at 10% 95%, rgba(232, 132, 43, .18), transparent 65%),
    var(--gradient);
  color: #fff;
  padding: 54px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand .brand { margin-bottom: 40px; }
.login-brand h1 { font-size: 30px; line-height: 1.35; max-width: 430px; }
.login-brand .tagline { color: rgba(255,255,255,.78); margin-top: 14px; max-width: 420px; font-size: 14px; }
.login-points { display: flex; flex-direction: column; gap: 12px; margin-top: 34px; }
.login-point { display: flex; gap: 11px; align-items: flex-start; color: rgba(255,255,255,.9); font-size: 13.5px; }
.login-point .n {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
}
.login-foot { color: rgba(255,255,255,.55); font-size: 12px; }
.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
}
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; min-height: 42px; margin-top: 6px; }
.login-error {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid #f3c9c5; border-radius: 9px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 16px;
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 34px 28px 28px; }
  .login-brand h1 { font-size: 23px; }
  .login-brand .tagline, .login-points { display: none; }
  .login-brand .brand { margin-bottom: 20px; }
  .login-foot { display: none; }
}

/* ---------- 图表：柱状趋势 + 覆盖率 ---------- */
.chart {
  position: relative;
  height: clamp(200px, 24vh, 300px);
  margin: 8px 2px 0;
  padding-left: 34px;
}
.chart-grid {
  position: absolute;
  inset: 0 0 22px 0;
  border-left: 1px solid var(--line);
}
.chart-grid span {
  position: absolute;
  left: 0;
  width: 100%;
  transform: translateY(50%);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
  padding-right: 4px;
  text-align: right;
}
.chart-bars {
  position: absolute;
  inset: 0 0 0 34px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-bottom: 22px;
}
.chart-col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.chart-bar {
  display: block;
  width: 100%;
  max-width: 24px;
  min-height: 2px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  border-radius: 4px 4px 0 0;
  transition: filter .15s;
}
.chart-col:hover .chart-bar { filter: brightness(1.15); }
.chart-x {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-col:nth-child(even) .chart-x { opacity: 0; }
.chart-table { margin-top: 10px; }
.chart-table summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  padding: 4px 0;
}
.chart-table table { margin-top: 6px; }
.chart-table td, .chart-table th { padding: 6px 10px; font-size: 12.5px; }

/* 数据概览：趋势与覆盖率同一张卡内左右分栏 */
.split { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); gap: 26px; align-items: start; }
.split-main { min-width: 0; }
.split-side { border-left: 1px solid var(--line); padding-left: 26px; }
.mini-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mini-head h3 { font-size: 14px; color: var(--ink-2); }
.mini-head .muted { font-size: 12.5px; }
.empty.compact { padding: 32px 16px; }
.empty.compact .ico { width: 40px; height: 40px; margin-bottom: 8px; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 20px; }
  .split-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
}

.coverage { padding-top: 4px; }
.coverage-num { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.coverage-num small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.coverage .rate { margin-top: 10px; }
.coverage .rate .bar { height: 8px; }

/* ---------- 标签 / 已读 / 预览 ---------- */
.tag-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.chip.sm { padding: 3px 9px; font-size: 12px; font-weight: 600; }
.tag {
  display: inline-block;
  padding: 1px 7px; margin: 2px 4px 0 0;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: none;
}
.tag:hover { border-color: var(--brand-300); color: var(--brand-700); }
.tag-editor { display: flex; gap: 6px; margin-top: 6px; }
.tag-editor[hidden] { display: none; }
.tag-editor input { min-height: 30px; padding: 3px 9px; font-size: 12.5px; }
tr.is-read .cell-title { color: var(--muted); font-weight: 500; }
tr.is-read { background: #fbfcfd; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(7, 30, 42, .48);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; color: var(--ink);
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  width: min(400px, 100%);
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal .actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 16px; }

/* ---------- 期次正文（独立预览页 + 推送日志页内抽屉共用） ---------- */
.reader { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 16px; align-items: start; }
.reader-body {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 40px; line-height: 1.85; font-size: 15px; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.reader-body h2 { font-size: 24px; margin: 0 0 6px; }
.reader-body h3 {
  font-size: 15px; color: var(--brand-700); margin: 26px 0 10px;
  padding: 6px 12px; background: var(--brand-100); border-radius: 8px;
  display: inline-block;
}
.reader-body h4 { font-size: 14.5px; margin: 18px 0 6px; }
.reader-body p { margin: 0 0 8px; color: var(--ink-2); }
.reader-body ul, .reader-body ol { margin: 0 0 12px; padding-left: 20px; }
.reader-body li { margin-bottom: 4px; }
.reader-body blockquote {
  margin: 8px 0; padding: 8px 12px; background: var(--accent-100);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  color: var(--accent-600); font-size: 13px;
}
.reader-body strong { color: var(--ink); }
.reader-body a { color: var(--brand-600); }
.reader-body img { max-width: 100%; border-radius: 10px; margin: 10px 0; }
.reader-body hr { border: 0; border-top: 1px dashed var(--line); margin: 22px 0; }
@media (max-width: 980px) {
  .reader { grid-template-columns: 1fr; }
  .reader-body { padding: 22px 18px; }
}

/* ---------- 页内抽屉：查看内容不离开推送日志 ---------- */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(7, 30, 42, .48);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: clamp(12px, 3vh, 40px) clamp(12px, 3vw, 40px);
  overflow-y: auto;
}
.drawer-mask.show { display: flex; }
.drawer {
  background: var(--canvas);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(980px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.drawer-head .drawer-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.drawer-head .drawer-meta { color: var(--muted); font-size: 12.5px; }
.drawer-head .drawer-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.drawer-close {
  width: 32px; height: 32px; min-height: 0; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.drawer-close:hover { background: var(--surface-2); border-color: var(--brand-300); color: var(--brand-700); }
.drawer-body { padding: 18px 20px 24px; overflow-y: auto; }
.drawer-body .reader-body { padding: 26px 30px; }
.drawer-state { padding: 28px; text-align: center; color: var(--muted); font-size: 13.5px; }
.drawer-state.error { color: var(--danger); }
@media (max-width: 768px) {
  .drawer-mask { padding: 0; }
  /* 满屏铺开并让正文区内部滚动：抽屉自身不撑出视口，顶部按钮始终可点 */
  .drawer { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .drawer-head { padding: 12px 14px; }
  .drawer-head .drawer-meta { white-space: normal; }
  .drawer-body { padding: 12px 12px 24px; }
  .drawer-body .reader-body { padding: 20px 16px; }
}

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.pager .info { color: var(--muted); font-size: 12.5px; }
.pager .pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager .pg {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink-2); font-size: 13px; text-decoration: none;
}
.pager .pg:hover { border-color: var(--brand-300); color: var(--brand-700); }
.pager .pg.on { background: var(--gradient); color: #fff; border-color: transparent; font-weight: 700; }
.pager .pg.disabled { opacity: .45; pointer-events: none; }

/* ---------- 其他 ---------- */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .txt { min-width: 0; }
.switch-row .txt b { display: block; font-size: 13.5px; }
.switch-row .txt span { color: var(--muted); font-size: 12.5px; }

.skip-list { list-style: none; margin: 0; padding: 0; }
.skip-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 8px; background: var(--surface-2); font-size: 13px;
}
.skip-list li:last-child { margin-bottom: 0; }

.char-count { color: var(--muted); font-size: 12px; text-align: right; margin-top: 4px; }
.char-count.over { color: var(--danger); font-weight: 700; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

@media (max-width: 640px) {
  .page { padding: 16px 14px 40px; }
  .topbar { padding: 10px 14px; gap: 12px; }
  /* 移动端导航改为 3 列换行，避免横向滚动把文字截断 */
  .nav {
    order: 3;
    flex-basis: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  .nav-item { justify-content: center; padding: 8px 4px; font-size: 12.5px; }
  .top-actions { margin-left: auto; }
  .env-chip { display: none; }
  .card { padding: 15px 14px; }
  .hero { padding: 18px 16px; }
  .hero .hero-actions { width: 100%; }
  .hero .hero-actions form { flex: 1 1 auto; }
  .hero .hero-actions .btn { width: 100%; }
  .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile .value { font-size: 21px; margin: 3px 0 1px; }
  .tile .foot { font-size: 11.5px; line-height: 1.45; }
  .tile .label { font-size: 11.5px; }
  .cell-title { max-width: 240px; }
  .cell-url { max-width: 160px; }
}

/* ---------- 窄屏：表格转卡片，避免文字被挤压遮挡 ---------- */
@media (max-width: 760px) {
  .data-table { display: block; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 10px;
    padding: 4px 2px;
  }
  .data-table tbody tr:hover { background: var(--surface); }
  .data-table td {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px dashed var(--line);
    padding: 9px 12px;
    max-width: none !important;
    /* 标签列固定 76px 后，内容列必须能收缩；默认 min-width:auto 会让长中文
       在窄屏被挤成「国家 / 能源 / 局官 / 网」这种每行 2 个字的竖条 */
    min-width: 0;
  }
  /* 长文本列才吃剩余宽度；徽标、下拉框等保持原宽度，否则徽标会被拉成一整条 */
  .data-table .cell-title,
  .data-table .cell-sub,
  .data-table .cell-url {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: normal;
    max-width: none !important;
  }
  /* 一格里放两段内容（如「名称 + 备注」）时并排放不下，改成各占一行 */
  .data-table td[data-label="名称"],
  .data-table td[data-label="标题"] {
    flex-wrap: wrap;
  }
  .data-table td[data-label="名称"] > .cell-title,
  .data-table td[data-label="名称"] > .cell-sub,
  .data-table td[data-label="标题"] > .cell-title,
  .data-table td[data-label="标题"] > .cell-sub { flex: 1 1 100%; }
  .data-table td[data-label="类型"],
  .data-table td[data-label="状态"] { align-items: center; }
  /* 触控目标：移动端 28px 高的按钮太小，手指容易点错 */
  .data-table .cell-actions .btn,
  .data-table .cell-actions a.btn {
    min-height: 38px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 13px;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    padding-top: 2px;
  }
  .data-table td[data-label=""]::before,
  .data-table td.cell-check::before { display: none; }
  .data-table tr { position: relative; }
  .data-table .cell-check {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    border: 0;
  }
  .data-table td[data-label="标题"] { padding-right: 44px; }
  .data-table .cell-title { max-width: none; font-size: 14px; }
  .data-table .cell-url { max-width: none; }
  .data-table .cell-actions { flex-wrap: wrap; }
  .data-table .rate { flex: 1; min-width: 120px; }
  .data-table .group-row { padding: 0; }
  .data-table .group-row td { display: block; padding: 9px 12px; }
  .data-table .group-row td::before { display: none; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .toolbar .searchbox { max-width: none; flex-basis: 100%; }
  .pager .pages { width: 100%; justify-content: flex-start; }
}

/* =========================================================
   信息源 · 站点性质专题卡片（卡片视图）
   五类各一张大卡：官方权威 / 电力算力 / 垂直门户 / 研究机构 / 海外资讯
   强调色由 site_category.py 提供，通过 --cat-accent 注入
   ========================================================= */
.cat-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px 8px;
  transition: box-shadow .18s ease-out;
}
.cat-card:hover { box-shadow: var(--shadow); }

.cat-head { margin-bottom: 12px; }
.cat-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  color: var(--ink);
}
.cat-accent-bar {
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--cat-accent, var(--brand-500));
}
.cat-ico {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--cat-accent, var(--brand-500));
  background: color-mix(in srgb, var(--cat-accent, var(--brand-500)) 12%, transparent);
}
.cat-ico .ico { width: 14px; height: 14px; }
.cat-scope {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.cat-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.cat-metrics .metric b { font-size: 14px; color: var(--ink); }
.metric-sep { color: var(--line-strong); }
.cat-warn {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.rate-ok { color: var(--ok); font-weight: 600; }
.rate-mid { color: var(--warn); font-weight: 600; }
.rate-low { color: var(--danger); font-weight: 600; }

.source-list { list-style: none; margin: 0; padding: 0; }
.source-line {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.source-line + .source-line { border-top-style: dashed; border-top-color: #eef4f7; }
.source-line.is-off { opacity: .6; }

.source-line-main { display: flex; align-items: center; gap: 7px; }
.source-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--ok);
}
.status-dot.warn { background: var(--accent); }
.status-dot.off { background: var(--line-strong); }

.source-note {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.source-meta .freq-form select {
  width: auto;
  min-width: 96px;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 12.5px;
}
.source-line .cell-actions { margin-top: 8px; flex-wrap: wrap; gap: 6px; }

.cat-empty {
  margin: 4px 0 14px;
  padding: 16px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .cat-card { transition: none; }
  .cat-card:hover { box-shadow: var(--shadow-sm); }
}

@media (max-width: 1080px) {
  .cat-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .cat-card { padding: 16px 16px 6px; }
  .cat-metrics { gap: 4px; }
  .cat-warn { margin-left: 0; }
  .source-line { padding: 12px 0; }
  .source-note { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .source-meta { gap: 8px; }
  .source-line .cell-actions { gap: 8px; }
  /* 触控目标 38px：与表格视图的移动端规则一致 */
  .source-line .cell-actions .btn,
  .source-line .cell-actions a.btn {
    min-height: 38px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 13px;
  }
  .source-meta .freq-form select { min-height: 38px; min-width: 104px; }
}

/* =========================================================
   信息源 · 专题封面卡（总览）与专题子页
   封面图是氛围图，叠深色渐变后只承载文字信息
   ========================================================= */
.cover-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.cover-card {
  position: relative;
  display: block;
  min-height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient);
  border: 1px solid color-mix(in srgb, var(--cat-accent, var(--brand-500)) 26%, var(--line));
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: #fff;
  transition: box-shadow .18s ease-out, transform .18s ease-out;
}
.cover-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cover-card:focus-visible {
  outline: 2px solid var(--cat-accent, var(--brand-500));
  outline-offset: 3px;
}

.cover-media {
  position: absolute;
  inset: 0;
  display: block;
}
.cover-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease-out;
}
.cover-card:hover .cover-media img { transform: scale(1.03); }
/* 渐变覆盖：下浓上淡，保证白字可读，同时露出照片 */
.cover-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 35, 50, .94) 0%,
    rgba(7, 35, 50, .72) 38%,
    rgba(7, 35, 50, .28) 68%,
    rgba(7, 35, 50, .04) 100%
  );
  pointer-events: none;
}

.cover-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
  min-height: 220px;
  padding: 18px 20px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.cover-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
}
.cover-ico {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(4px);
}
.cover-ico .ico { width: 15px; height: 15px; }
.cover-scope {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .9);
}
.cover-metrics .metric b { font-size: 14px; color: #fff; }
.cover-metrics .metric-sep { color: rgba(255, 255, 255, .45); }
.cover-warn {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- 专题子页 ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.crumb a { color: var(--brand-600); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb [aria-current="page"] { color: var(--ink-2); font-weight: 600; }

.cat-head-page .cat-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
}
.cat-card--standalone {
  list-style: none;
  margin: 4px 0 0;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .cover-card, .cover-media img { transition: none; }
  .cover-card:hover { transform: none; }
  .cover-card:hover .cover-media img { transform: none; }
}

@media (max-width: 1080px) {
  .cover-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .cover-card { min-height: 176px; }
  .cover-body { min-height: 176px; padding: 14px 16px; }
  .cover-title { font-size: 17px; }
  .cover-warn { margin-left: 0; }
  .cat-head-page .page-actions { width: 100%; }
}

/* ---------- 数据分析页 ---------- */
.analytics-filters { display: flex; flex-direction: column; gap: 12px; }
.analytics-filters .filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.analytics-filters .filter-label {
  flex: 0 0 76px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.analytics-filters .chip-group { flex: 1 1 auto; }
@media (max-width: 720px) {
  .analytics-filters .filter-label { flex-basis: 100%; }
}

/* ---------- 栏目分布（横向占比条 + 图例） ---------- */
.segbar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segbar-seg { display: block; height: 100%; min-width: 2px; }
.segbar-0 { background: var(--brand-500); }
.segbar-1 { background: #2a78d6; }
.segbar-2 { background: #a13d63; }
.segbar-3 { background: #6250d6; }
.segbar-4 { background: #b45309; }
.segbar-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin: 12px 0 0; padding: 0; list-style: none;
  font-size: 12.5px; color: var(--ink-2);
}
.segbar-legend li { display: flex; align-items: center; gap: 6px; }
.segbar-legend strong { font-weight: 700; }
.segbar-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ---------- 内容详情：四段摘要 ---------- */
.summary-grid { display: flex; flex-direction: column; gap: 10px; }
.summary-block {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px 14px;
}
.summary-block.lead-idea { border-left-color: var(--brand-500); background: var(--surface); }
.summary-block.accent { border-left-color: var(--accent); background: var(--accent-100); }
.summary-label {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--muted); margin-bottom: 4px;
}
.summary-block p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; white-space: pre-wrap; }

/* ---------- 内容详情：同源条目 ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li {
  display: flex; gap: 10px; align-items: baseline; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: var(--ink-2); text-decoration: none; }
.mini-list a:hover { color: var(--brand-700); text-decoration: underline; }
.mini-list .muted { white-space: nowrap; font-size: 12px; }

.cell-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.cell-link:hover { color: var(--brand-700); text-decoration: underline; }

/* ---------- 抓取监控：失败明细展开行 ---------- */
.fail-row td { background: var(--surface-2); padding: 0 12px 10px; }
.fail-row summary {
  cursor: pointer; font-size: 12.5px; color: var(--muted);
  padding: 6px 0; list-style: none;
}
.fail-row summary::-webkit-details-marker { display: none; }
.fail-row summary::before { content: "▸ "; }
.fail-row details[open] summary::before { content: "▾ "; }
.fail-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.fail-list li {
  display: flex; gap: 12px; padding: 5px 0;
  border-top: 1px solid var(--line); color: var(--ink-2);
  overflow-wrap: anywhere;
}
.fail-list .muted { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- 专题 ---------- */
.topic-grid {
  display: grid; gap: 14px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.topic-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.topic-card:hover {
  border-color: var(--brand-300); box-shadow: var(--shadow-md, var(--shadow-sm));
  transform: translateY(-1px);
}
.topic-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.topic-head h2 { font-size: 17px; margin: 0; color: var(--brand-700); }
.topic-count {
  font-size: 12px; font-weight: 700; color: var(--brand-700);
  background: var(--brand-100); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.topic-latest {
  margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
