/* ==========================================================================
   疫情情报与决策报告平台 — 全局样式
   设计方向：深蓝政务报告风（疾控专业、正式、高信息密度）
   字体：思源宋体（标题/编号）+ 思源黑体（正文），均走 CDN 并带系统回退
   ========================================================================== */

/* ---- 2026-09-21: 品牌双行标题 ---- */
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.72); letter-spacing: .14em; margin-top: 1px; white-space: nowrap; }

/* ---- 2026-09-21: 生成报告三步引导 ---- */
.gen-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.gen-steps li { background: var(--paper); border: 1px solid var(--line); padding: 6px 14px; border-radius: 99px; font-size: 13px; color: var(--ink-500); }
.gen-steps li.now { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---- 2026-09-21: 模板可视化编辑弹窗 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 1000; overflow-y: auto; }
.modal-box { background: var(--card); border-radius: var(--radius); box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3); width: min(1080px, 100%); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink-900); }
.modal-close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--ink-500); cursor: pointer; padding: 2px 8px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--paper); color: var(--ink-900); }
.modal-body { padding: var(--sp-5) var(--sp-6); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); }
.flex-grow { flex: 1; }

.tpl-editor { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(300px, 4fr); gap: var(--sp-6); margin-top: var(--sp-4); }
@media (max-width: 900px) { .tpl-editor { grid-template-columns: 1fr; } }
.tpl-ch-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tpl-ch-row .ch-title { flex: 1; min-width: 0; }
.ch-btn { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-sm); width: 26px; height: 26px; line-height: 1; cursor: pointer; color: var(--ink-700); font-size: 13px; flex-shrink: 0; }
.ch-btn:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-500); }
.ch-btn:disabled { opacity: .35; cursor: default; }
.ch-del:hover { border-color: #d64545; color: #d64545; }
.ch-flag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--navy-800); color: #fff; flex-shrink: 0; letter-spacing: .06em; }
.ch-flag-optional { background: var(--paper); color: var(--ink-500); border: 1px solid var(--line); }
.ch-include { width: 16px; height: 16px; flex-shrink: 0; }

.tpl-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: var(--sp-4); }
.tpl-preview-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.tpl-preview-no { font-family: var(--font-display); font-weight: 700; color: var(--brand-500); font-size: 15px; width: 20px; text-align: right; flex-shrink: 0; }
.tpl-preview-title { flex: 1; font-weight: 600; color: var(--ink-900); }

.banner-actions { display: inline-flex; gap: 8px; margin-left: 14px; }

/* ---------- 设计令牌 ---------- */
:root {
  /* 字体族 */
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  /* 墨色（文字） */
  --ink-900: #0b1f33;
  --ink-700: #26405c;
  --ink-500: #4f6a86;
  --ink-300: #8fa6bc;
  --ink-100: #c4d2e0;

  /* 藏青（头部/深色面） */
  --navy-950: #06182b;
  --navy-900: #071c33;
  --navy-800: #0a2a4a;
  --navy-700: #0e3a63;
  --navy-600: #134b7e;

  /* 品牌青蓝 */
  --brand-700: #0c4f7c;
  --brand-600: #0e5e8f;
  --brand-500: #1179b0;
  --brand-100: #e3f0f8;
  --cyan-600: #0b8a9e;
  --cyan-500: #0ea5bd;
  --cyan-400: #22b8cf;
  --cyan-100: #e0f5f8;

  /* 纸面 */
  --paper: #f2f5f9;
  --paper-deep: #e8edf4;
  --card: #ffffff;
  --line: #dbe3ec;
  --line-strong: #c2cedb;

  /* 风险等级语义色（low 绿 / moderate 黄 / high 橙 / very_high 红） */
  --risk-low: #2f9e5f;
  --risk-low-bg: #e6f4ec;
  --risk-moderate: #c9930a;
  --risk-moderate-bg: #faf3dd;
  --risk-high: #e8721c;
  --risk-high-bg: #fdeee2;
  --risk-very-high: #c63a3a;
  --risk-very-high-bg: #fae8e8;

  /* 报告状态语义色 */
  --st-draft: #6b7c8f;
  --st-draft-bg: #eef1f5;
  --st-pending: #c9930a;
  --st-pending-bg: #faf3dd;
  --st-approved: #1179b0;
  --st-approved-bg: #e3f0f8;
  --st-published: #2f9e5f;
  --st-published-bg: #e6f4ec;
  --st-rejected: #c63a3a;
  --st-rejected-bg: #fae8e8;

  /* 数据更新状态 */
  --fresh: #2f9e5f;
  --stale: #c9930a;
  --expired: #c63a3a;

  /* 印章红（品牌点缀，仅用于徽记与红头线） */
  --seal-red: #b03a2e;

  /* 间距 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* 形状与阴影 */
  --radius-sm: 3px;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 51, .06);
  --shadow: 0 2px 8px rgba(11, 31, 51, .08);
  --shadow-lg: 0 8px 28px rgba(11, 31, 51, .14);

  --header-h: 64px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-900);
  background:
    /* 细网格纸纹，营造档案报告质感 */
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(14, 58, 99, .025) 27px 28px),
    var(--paper);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--cyan-600); text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
::selection { background: rgba(14, 165, 189, .25); }

/* ---------- 顶部密级条 ---------- */
.top-strip {
  background: var(--navy-950);
  color: var(--ink-100);
  font-size: 12px;
  letter-spacing: .06em;
  padding: 5px 0;
}
.top-strip .container { display: flex; justify-content: space-between; gap: var(--sp-4); }
.top-strip .seal-note { color: #e8b7b0; }

/* ---------- 应用头部 ---------- */
.app-header {
  background:
    linear-gradient(135deg, rgba(34, 184, 207, .10) 0%, rgba(34, 184, 207, 0) 42%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  border-bottom: 3px solid var(--seal-red); /* 红头文件式红线 */
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 60;
}
.app-header .container {
  display: flex; align-items: center; gap: var(--sp-6);
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.brand-seal {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--seal-red);
  color: #fff; font-family: var(--font-display);
  font-size: 11px; line-height: 1.15; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-align: center; letter-spacing: .05em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), var(--shadow-sm);
  transform: rotate(-3deg);
}
.brand-name { font-family: var(--font-display); font-size: 19px; color: #fff; letter-spacing: .04em; white-space: nowrap; }

.main-nav { display: flex; gap: 2px; margin-left: var(--sp-4); flex: 1; }
.main-nav a {
  color: var(--ink-100); font-size: 14px; padding: 8px 14px;
  border-radius: var(--radius-sm); position: relative; letter-spacing: .02em;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.main-nav a.active { color: #fff; font-weight: 600; }
.main-nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 3px; border-radius: 2px; background: var(--cyan-400);
}

/* ---------- 布局容器 ---------- */
.container { max-width: 1360px; margin: 0 auto; padding: 0 var(--sp-6); }
.page-body { padding: var(--sp-6) 0 var(--sp-10); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-4); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-title { font-size: 24px; letter-spacing: .03em; display: flex; align-items: baseline; gap: var(--sp-3); }
.page-title::before {
  content: ""; width: 6px; height: 22px; background: var(--seal-red);
  border-radius: 1px; align-self: center;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--sp-5); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.card-title { font-size: 16px; color: var(--ink-900); display: flex; align-items: center; gap: var(--sp-2); }
.card-title .tick { width: 4px; height: 14px; background: var(--cyan-500); border-radius: 1px; display: inline-block; }
.card-body { padding: var(--sp-5); }

/* ---------- 徽章与圆点（纯 CSS，无 emoji） ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 7px; height: 7px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(11, 31, 51, .05); }

.dot-fresh, .dot-low, .dot-published, .dot-success, .dot-normal { background: var(--fresh); }
.dot-stale, .dot-moderate, .dot-pending { background: var(--stale); }
.dot-expired, .dot-very-high, .dot-very_high, .dot-rejected, .dot-failed, .dot-critical { background: var(--expired); }
.dot-high, .dot-elevated { background: var(--risk-high); }
.dot-approved, .dot-running { background: var(--st-approved); }
.dot-draft { background: var(--st-draft); }

.badge-risk-low { color: var(--risk-low); background: var(--risk-low-bg); border-color: rgba(47, 158, 95, .35); }
.badge-risk-moderate { color: var(--risk-moderate); background: var(--risk-moderate-bg); border-color: rgba(201, 147, 10, .4); }
.badge-risk-high { color: var(--risk-high); background: var(--risk-high-bg); border-color: rgba(232, 114, 28, .4); }
.badge-risk-very_high { color: var(--risk-very-high); background: var(--risk-very-high-bg); border-color: rgba(198, 58, 58, .4); }
/* 事件报告风险等级：normal=正常(绿) / elevated=关注(橙) / critical=危急(红) */
.badge-risk-normal { color: var(--risk-low); background: var(--risk-low-bg); border-color: rgba(47, 158, 95, .35); }
.badge-risk-elevated { color: var(--risk-high); background: var(--risk-high-bg); border-color: rgba(232, 114, 28, .4); }
.badge-risk-critical { color: var(--risk-very-high); background: var(--risk-very-high-bg); border-color: rgba(198, 58, 58, .4); }

.badge-status-draft { color: var(--st-draft); background: var(--st-draft-bg); border-color: rgba(107, 124, 143, .35); }
.badge-status-pending_review { color: var(--st-pending); background: var(--st-pending-bg); border-color: rgba(201, 147, 10, .4); }
.badge-status-approved { color: var(--st-approved); background: var(--st-approved-bg); border-color: rgba(17, 121, 176, .35); }
.badge-status-published { color: var(--st-published); background: var(--st-published-bg); border-color: rgba(47, 158, 95, .35); }
.badge-status-rejected { color: var(--st-rejected); background: var(--st-rejected-bg); border-color: rgba(198, 58, 58, .4); }

.badge-run-success { color: var(--fresh); background: var(--st-published-bg); border-color: rgba(47, 158, 95, .35); }
.badge-run-failed { color: var(--expired); background: var(--st-rejected-bg); border-color: rgba(198, 58, 58, .4); }
.badge-run-running { color: var(--st-approved); background: var(--st-approved-bg); border-color: rgba(17, 121, 176, .35); }

.badge-prio-urgent { color: #fff; background: var(--risk-very-high); }
.badge-prio-high { color: #fff; background: var(--risk-high); }
.badge-prio-medium { color: #fff; background: var(--brand-500); }
.badge-prio-low { color: #fff; background: var(--st-draft); }

.badge-outline { color: var(--ink-500); background: #fff; border-color: var(--line-strong); font-weight: 500; }
.badge-evidence { font-family: var(--font-mono); font-size: 11px; color: var(--brand-700); background: var(--brand-100); border-color: rgba(17, 121, 176, .3); padding: 2px 7px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-700);
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-600); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.btn-approve { background: var(--risk-low); border-color: var(--risk-low); color: #fff; }
.btn-approve:hover { background: #27824f; border-color: #27824f; color: #fff; }
.btn-reject { background: #fff; border-color: var(--risk-very-high); color: var(--risk-very-high); }
.btn-reject:hover { background: var(--risk-very-high); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  font-family: var(--font-body); font-size: 13px; color: var(--ink-900);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; padding: 6px 10px; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--cyan-500); box-shadow: 0 0 0 3px rgba(14, 165, 189, .15); }
.textarea { width: 100%; resize: vertical; min-height: 64px; }
.field-label { font-size: 12px; color: var(--ink-500); margin-bottom: 4px; display: block; }

.filter-bar {
  display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
}
/* 仅看最新 去重开关：与按钮同行底对齐 */
.dedup-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-500); cursor: pointer; user-select: none;
  white-space: nowrap; padding-bottom: 2px;
}
.dedup-toggle input { margin: 0; cursor: pointer; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-500); font-size: 12px;
  letter-spacing: .05em; padding: 10px 14px; border-bottom: 2px solid var(--line-strong);
  background: var(--paper-deep); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: var(--cyan-100); }
.table tbody tr.row-click { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.row-error-detail td { background: var(--st-rejected-bg); }

/* ---------- 定义列表 / 元信息 ---------- */
.def-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3) var(--sp-5); }
.def-item dt { font-size: 12px; color: var(--ink-500); margin-bottom: 2px; }
.def-item dd { margin: 0; font-weight: 600; color: var(--ink-900); }
.def-item dd.mono { font-weight: 500; }

/* ---------- KPI 指标卡 ---------- */
.kpi-card { position: relative; overflow: hidden; }
.kpi-card .card-body { padding: var(--sp-4) var(--sp-5); }
.kpi-label { font-size: 12px; color: var(--ink-500); letter-spacing: .08em; }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--ink-900); line-height: 1.25; }
.kpi-value small { font-size: 14px; font-weight: 400; color: var(--ink-500); }
.kpi-foot { font-size: 12px; color: var(--ink-500); }
.kpi-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-500); }
.kpi-card.kpi-cyan::after { background: var(--cyan-500); }
.kpi-card.kpi-amber::after { background: var(--risk-moderate); }
.kpi-card.kpi-red::after { background: var(--risk-very-high); }

/* ---------- 区块标题 / 风险卡行（首页：headline 与风险卡分区） ---------- */
/* section-head：headline（事件模式 h2）或风险主卡（病例模式 risk-hero）的容器 */
.section-head {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4);
}
.section-title {
  font-size: 20px; font-weight: 700; color: var(--ink-900); margin: 0;
  display: flex; align-items: center; gap: var(--sp-2);
}
.section-title .tick { width: 5px; height: 18px; background: var(--brand-500); border-radius: 1px; display: inline-block; }
/* risk-hero-cards：page-head 内与标题并排的风险分布卡行；病例模式不填充时自动隐藏 */
.risk-hero-cards { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.risk-hero-cards:empty { display: none; }

/* ---------- 当前风险主卡（等级铭牌：浅色等级底 + 等级色大字 + 刻度条） ---------- */
.risk-hero { display: grid; grid-template-columns: 210px 1fr; min-height: 190px; }
.risk-panel { --lv: var(--ink-500); } /* 默认色放低优先级，等级类按源码顺序覆盖 */
.risk-hero .risk-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: var(--sp-5);
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 1px solid var(--line);
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--lv) 12%, transparent), transparent 72%),
    var(--lv-bg, transparent);
}
/* 左侧等级色竖条，与 KPI 卡色条同一语汇 */
.risk-panel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--lv), color-mix(in srgb, var(--lv) 40%, transparent));
}
.risk-panel .risk-label {
  font-family: var(--font-display); font-size: 34px; font-weight: 700;
  letter-spacing: .12em; color: var(--lv);
}
.risk-panel .risk-en {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-500);
}
.risk-trend { font-size: 13px; }
/* 等级刻度条：4 段递增高度，按等级填充 */
.risk-meter { display: flex; align-items: flex-end; gap: 5px; height: 16px; margin-top: 2px; }
.risk-meter i {
  width: 22px; border-radius: 2px;
  background: color-mix(in srgb, var(--lv) 18%, transparent);
}
.risk-meter i:nth-child(1) { height: 6px; }
.risk-meter i:nth-child(2) { height: 9px; }
.risk-meter i:nth-child(3) { height: 12px; }
.risk-meter i:nth-child(4) { height: 15px; }
.risk-meter i.on {
  background: var(--lv);
  box-shadow: 0 0 8px color-mix(in srgb, var(--lv) 42%, transparent);
}
.risk-panel-low       { --lv: var(--risk-low);       --lv-bg: var(--risk-low-bg); }
.risk-panel-moderate  { --lv: var(--risk-moderate);  --lv-bg: var(--risk-moderate-bg); }
.risk-panel-high      { --lv: var(--risk-high);      --lv-bg: var(--risk-high-bg); }
.risk-panel-very_high { --lv: var(--risk-very-high); --lv-bg: var(--risk-very-high-bg); }
/* event 词汇（normal/elevated/critical）映射到同一套语义色 */
.risk-panel-normal    { --lv: var(--risk-low);       --lv-bg: var(--risk-low-bg); }
.risk-panel-elevated  { --lv: var(--risk-high);      --lv-bg: var(--risk-high-bg); }
.risk-panel-critical  { --lv: var(--risk-very-high); --lv-bg: var(--risk-very-high-bg); }
.risk-hero .risk-detail { padding: var(--sp-5); }

/* 趋势箭头（CSS 绘制） */
.trend { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.trend::before { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.trend-up { color: var(--risk-very-high); }
.trend-up::before { border-bottom: 7px solid var(--risk-very-high); }
.trend-down { color: var(--risk-low); }
.trend-down::before { border-top: 7px solid var(--risk-low); }
.trend-flat { color: var(--ink-500); }
.trend-flat::before { width: 10px; height: 2px; border: 0; background: var(--ink-500); }

/* ---------- 图表容器 ---------- */
.chart { width: 100%; height: 300px; }
.chart-sm { height: 240px; }
.chart-lg { height: 360px; }
.chart-fallback { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-500); font-size: 13px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }

/* ---------- 风险概览卡片（首页 dashboard；颜色跟随主题令牌，明暗自适应） ---------- */
.risk-card {
  --cv: var(--ink-500);
  border-radius: 10px; padding: 10px 18px; text-align: center;
  transition: all .2s ease; cursor: pointer; text-decoration: none;
  display: block;
  background: var(--cv-bg, transparent);
  border: 1px solid color-mix(in srgb, var(--cv) 40%, var(--line));
}
.risk-card:hover {
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--cv);
}
.risk-card-critical { --cv: var(--risk-very-high); --cv-bg: var(--risk-very-high-bg); }
.risk-card-elevated { --cv: var(--risk-high);      --cv-bg: var(--risk-high-bg); }
.risk-card-normal   { --cv: var(--risk-low);       --cv-bg: var(--risk-low-bg); }
.risk-card-case     { --cv: var(--brand-600);      --cv-bg: var(--brand-100); }
.risk-card-total    { --cv: var(--ink-500);        --cv-bg: var(--surface-soft, #f8fafc); }
.risk-card-num { font-size: 26px; font-weight: 700; color: var(--cv); }
.risk-card-label {
  font-size: 12px; margin-top: 2px; color: var(--cv);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------- 状态块（加载 / 空 / 错误） ---------- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); padding: var(--sp-8) var(--sp-5); color: var(--ink-500); font-size: 13px; }
.state-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cyan-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-error .state-icon, .state-empty .state-icon {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.state-error .state-icon { color: var(--risk-very-high); border: 2px solid var(--risk-very-high); }
.state-empty .state-icon { color: var(--ink-300); border: 2px solid var(--ink-300); }

/* ---------- 数据源 / 信号等列表 ---------- */
.list-row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-5); border-bottom: 1px solid var(--line); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .muted { color: var(--ink-500); font-size: 12px; }

/* ---------- 审批栏 ---------- */
.approval-bar {
  position: sticky; top: calc(var(--header-h) + 3px); z-index: 40;
  background: linear-gradient(180deg, #fffdf5, #fff8e6);
  border: 1px solid rgba(201, 147, 10, .45); border-left: 4px solid var(--st-pending);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5);
}
.approval-bar .bar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.approval-bar .bar-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--ink-900); }
.approval-bar .bar-actions { display: flex; gap: var(--sp-3); align-items: center; }

/* ---------- 报告详情分区标题 ---------- */
.section-anchor { scroll-margin-top: 90px; }
.evidence-item:target, .flash-target { animation: flash 1.6s ease; }
@keyframes flash { 0%, 55% { background: #fff3c4; } 100% { background: transparent; } }

/* ---------- 三维风险矩阵 ---------- */
.dim-card { border-top: 4px solid var(--line-strong); }
.dim-card.dim-high { border-top-color: var(--risk-high); }
.dim-card.dim-very_high { border-top-color: var(--risk-very-high); }
.dim-card.dim-moderate { border-top-color: var(--risk-moderate); }
.dim-card.dim-low { border-top-color: var(--risk-low); }
.dim-card .dim-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.dim-card .dim-en { font-size: 11px; letter-spacing: .18em; color: var(--ink-300); text-transform: uppercase; }

/* ---------- 要点列表 ---------- */
.point-list { margin: 0; padding: 0; list-style: none; }
.point-list li { position: relative; padding: 5px 0 5px 18px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.point-list li:last-child { border-bottom: 0; }
.point-list li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px; border-radius: 1px; background: var(--cyan-500); transform: rotate(45deg); }
.point-list.warn li::before { background: var(--risk-moderate); }
.point-list.danger li::before { background: var(--risk-very-high); }

/* ---------- 页脚 ---------- */
.app-footer { border-top: 1px solid var(--line); background: var(--paper-deep); color: var(--ink-500); font-size: 12px; padding: var(--sp-5) 0; }
.app-footer .container { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.app-footer .footer-credit { flex-direction: column; align-items: center; gap: 2px; text-align: center; }

.advanced-box { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--surface-soft, var(--paper-deep)); }
.advanced-box summary { cursor: pointer; color: var(--ink-500); font-size: 13px; user-select: none; }
.advanced-box[open] summary { margin-bottom: 12px; color: var(--ink-700); }

/* ---------- Toast ---------- */
.toast-box { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy-900); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); border-left: 3px solid var(--cyan-400); animation: toast-in .25s ease; }
.toast.toast-ok { border-left-color: var(--fresh); }
.toast.toast-err { border-left-color: var(--expired); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 响应式：1280 主战场，兼容 768 ---------- */
@media (max-width: 1100px) {
  .col-3 { grid-column: span 6; } .col-4 { grid-column: span 6; }
  .col-5, .col-7 { grid-column: span 12; }
  .col-6 { grid-column: span 12; } .col-8, .col-9 { grid-column: span 12; }
  .risk-hero { grid-template-columns: 1fr; }
  .risk-hero .risk-panel {
    border-radius: var(--radius) var(--radius) 0 0; padding: var(--sp-6);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 768px) {
  .container { padding: 0 var(--sp-3); }
  .main-nav { overflow-x: auto; }
  .main-nav a { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .col-3, .col-4 { grid-column: span 12; }
  .page-title { font-size: 20px; }
  .chart { height: 240px; }
  .top-strip .container { flex-direction: column; gap: 2px; }
}

.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.tpl-card { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: var(--sp-5); min-height: 168px; }
.tpl-card:hover { border-color: var(--brand-500); }
.tpl-card.active { border-color: var(--navy-700); box-shadow: 0 0 0 1px var(--navy-700); }
.tpl-kind { font-size: 12px; color: var(--ink-500); letter-spacing: 0.04em; }
.scope-banner { background: var(--brand-100); border: 1px solid var(--line); padding: var(--sp-4); border-radius: var(--radius); margin-bottom: var(--sp-4); }
.step-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.step-list li { background: var(--paper); border: 1px solid var(--line); padding: 6px 10px; border-radius: 99px; font-size: 13px; }
.step-list li.now { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.missing-pill { color: var(--ink-500); font-style: italic; }
@media (max-width: 768px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

/* ---------- 打印（报告详情友好） ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .top-strip, .app-header, .app-footer, .approval-bar, .no-print { display: none !important; }
  .container { max-width: none; padding: 0; }
  .page-body { padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .grid { display: block; }
  .grid > [class*="col-"] { margin-bottom: 12px; }
  a { color: #000; text-decoration: none; }
  .risk-hero .risk-panel { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==========================================================================
   2026-09-29 前端体验修复：报告分组视图 + 图表/头部响应式兜底
   ========================================================================== */
/* 2026-09-29 修复"跳转舆情系统"按钮悬在页面中部：page-head 为 space-between，
   改版后头部加入 risk-hero-cards 变成三元素，按钮被挤到剩余空间正中。
   margin-left:auto 使按钮贴右侧卡片，标题独占左侧（两元素页面上行为不变）。 */
.page-head .btn { margin-left: auto; }
.page-head .risk-hero-cards { margin-left: 12px; }

/* 视图切换（分组 / 完整表格） */
.view-toggle { display: flex; gap: 8px; margin: var(--sp-4) 0 var(--sp-3); }
.view-toggle .view-btn { border: 1px solid var(--line); background: var(--card); }
.view-toggle .view-btn.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* 分组卡片 */
.report-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-4); }
.report-groups[hidden] { display: none; }
.report-group-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.all-countries-card { text-decoration: none; border-color: var(--brand-500); }
.group-head { display: flex; flex-direction: column; gap: 2px; }
.group-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-disease { font-weight: 700; font-size: 15px; color: var(--ink-900); }
.group-region { font-size: 13px; color: var(--ink-500); }
.group-meta { font-size: 12px; color: var(--ink-500); }
.group-latest {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; text-decoration: none; color: var(--ink-800);
  background: var(--paper);
}
a.group-latest:hover { border-color: var(--brand-500); }
.group-latest-label {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--brand-500);
  border-radius: 4px; padding: 1px 6px; letter-spacing: .05em;
}
.group-latest-time { margin-left: auto; font-size: 12px; color: var(--ink-500); }
.group-history summary { cursor: pointer; font-size: 13px; color: var(--ink-500); padding: 2px 0; user-select: none; }
.group-history summary:hover { color: var(--brand-500); }
.group-history .table-sm { font-size: 12.5px; margin-top: 6px; }
.group-history .table-sm th, .group-history .table-sm td { padding: 6px 8px; }

/* 图表画布兜底：任何未 resize 的画布也不允许把页面撑出横向滚动 */
.chart canvas { max-width: 100%; }
.chart > div { max-width: 100%; }

/* 头部移动端：允许换行 + nav 可收缩，消除 515px 溢出 */
@media (max-width: 768px) {
  .app-header .container { flex-wrap: wrap; gap: var(--sp-2); min-height: 0; padding-top: 8px; padding-bottom: 8px; }
  .main-nav { min-width: 0; width: 100%; order: 2; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .report-groups { grid-template-columns: 1fr; }
}

/* ==========================================================================
   2026-09-29 稳重感视觉打磨：表格 / 分组卡 / 空状态 / 焦点环
   仅细化质感（不改主题与主色）。
   ========================================================================== */

/* 长表格（疾病概览等）斑马纹：双向主题均取墨色 2.5% 混合，hover 仍优先 */
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ink-900) 2.5%, transparent); }
.table tbody tr:hover { background: var(--cyan-100); }
.table tbody tr { transition: background .12s ease; }
.table th.num { text-align: right; }

/* 整行可点的表格行：hover 时操作提示显形 */
tr[data-slug], tr[data-country], tr.row-click { transition: background .12s ease; }
.row-action { color: var(--brand-600); font-size: 12px; white-space: nowrap; opacity: .75; transition: opacity .12s ease; }
tr:hover .row-action { opacity: 1; text-decoration: underline; }

/* 键盘可达性：焦点环（可靠感） */
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.main-nav a:focus-visible, .view-btn:focus-visible, .group-latest:focus-visible {
  outline: 2px solid var(--cyan-500); outline-offset: 2px;
}

/* 报告分组卡：hover 抬升反馈；疾病名用标题宋体增庄重感 */
.report-group-card { transition: border-color .18s ease, box-shadow .18s ease; }
.report-group-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow); }
a.report-group-card:hover { text-decoration: none; }
.group-disease { font-family: var(--font-display); letter-spacing: .02em; }

/* “最新一份”直达行：hover 底色反馈更明确 */
a.group-latest { transition: border-color .15s ease, background .15s ease; }
a.group-latest:hover { background: var(--surface-accent); }

/* 历史折叠行：summary 变成整行热区 */
.group-history summary {
  border-radius: var(--radius-sm); padding: 5px 10px; margin: 0 -10px;
  list-style-position: inside; transition: background .12s ease, color .12s ease;
}
.group-history summary:hover { background: var(--surface-soft); color: var(--brand-600); }
.group-history summary::marker { color: var(--ink-300); }

/* 空 / 错误状态：虚线框收拢，避免大段空白显得粗糙 */
.state-empty, .state-error { margin: 6px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* 筛选区控件与按钮同高，基线整齐 */
.filter-bar .input, .filter-bar .select { min-height: 40px; }

/* 定义列表标签字距，层次更稳 */
.def-item dt { letter-spacing: .05em; }

/* 打印时不带斑马纹 */
@media print {
  .table tbody tr:nth-child(even) { background: transparent; }
  .table tbody tr:hover { background: transparent; }
}

/* ==========================================================================
   2026-09-29 第二轮稳重感打磨：按钮成组 / 过渡统一 / 焦点与动效收敛
   仅细化质感（不改主题与主色）。
   ========================================================================== */

/* 页头多按钮贴右成组：首个 .btn 以 margin-left:auto 吸收剩余空间，其后按钮
   不再各自均分空隙（此前数据源页"刷新"与注入按钮被拉开，注入按钮悬于中部）。 */
.page-head .btn ~ .btn { margin-left: 0; }

/* 卡片统一过渡：hover 反馈不再生硬跳变 */
.card { transition: border-color .18s ease, box-shadow .18s ease; }

/* 导航与徽章细节 */
.main-nav a { transition: color .15s ease, background .15s ease; }
.badge { letter-spacing: .02em; }

/* 输入框 focus 阴影过渡补齐（原仅 border-color 过渡） */
.input, .select, .textarea { transition: border-color .15s ease, box-shadow .15s ease; }

/* 平滑滚动 + 动效收敛（稳重感与可达性） */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 首页风险卡（可点链接）补键盘焦点环 */
.risk-card:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 2px; text-decoration: none; }

/* ==========================================================================
   2026-09-29 第三轮前端修复（巡检清单）
   ========================================================================== */

/* ---- 「跳转到舆情系统」按钮统一固定到页头最右端 ----
   注入脚本把按钮插在 h1 之后，各页 page-head 子元素不同导致按钮位置四种漂移。
   统一方案：标题 margin-right:auto 吸收剩余空间（右侧所有控件贴右成组），
   跳转按钮 order:99 恒为视觉末位。覆盖此前 .page-head .btn 的 margin-left:auto。 */
.page-head .page-title { margin-right: auto; }
.page-head .btn { margin-left: 0; }
.page-head .btn ~ .btn { margin-left: 0; }
.page-head #xsys-jump { order: 99; margin-left: 12px; }

/* ---- 表格横向滚动的渐隐提示（移动端列溢出时给出"可滑动"视觉线索） ----
   纯 CSS 滚动阴影：左/右边缘在可滚动方向露出阴影，滚动到底后由遮盖层隐去。 */
.table-wrap {
  background:
    linear-gradient(to right, var(--card) 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), var(--card) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 24px 100%, 24px 100%;
  background-attachment: local, local, scroll, scroll;
  background-color: var(--card);
}
@media (max-width: 768px) {
  .table th, .table td { padding: 8px 10px; }
  /* 窄屏下表格被压向 min-content：数字列折行无意义（值都很短），禁止折行 */
  .table td.num, .table th.num { white-space: nowrap; }
  /* 疾病概览：日期区间列在连字符处折成 4~5 行会把整行撑成大块空白，
     禁止折行让表格按真实宽度横向溢出（配合上方渐隐提示滑动） */
  #disease-list .table td.mono { white-space: nowrap; }
  /* 报告完整表格：列多且标题列是唯一弹性列，没下限时被压成逐字一列 */
  #report-table { min-width: 880px; }
}

/* ---- 移动端汉堡导航（≤900px；特异性高于 theme.css 的 768px 换行规则） ---- */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 9px 8px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px; border-radius: 1px;
  background: var(--ink-100);
}
.nav-toggle:hover { background: rgba(255, 255, 255, .08); }
.nav-toggle:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 2px; }

@media (max-width: 900px) {
  .app-header .container { flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  /* 面板默认隐藏，展开时整行落为纵向列表（覆盖 theme.css 的平铺换行） */
  .app-header .main-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 0; padding: 6px 10px 10px;
    background: var(--navy-900);
    border-bottom: 3px solid var(--seal-red);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .app-header.nav-open .main-nav { display: flex; }
  .app-header .main-nav a {
    padding: 11px 14px; font-size: 14px; border-radius: var(--radius-sm);
    color: var(--ink-100);
  }
  .app-header .main-nav a.active::after { left: 50%; right: auto; width: 28px; bottom: 4px; transform: translateX(-50%); }
}
/* theme.css 的深色头部在亮色模式下同样是深藏青，面板底色与之一致即可 */

/* ---- 报告完整表格分页器 ---- */
.pager {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
.pager .pager-btn {
  min-width: 32px; padding: 4px 10px; font-size: 12.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-raised, #fff); color: var(--ink-700); cursor: pointer;
}
.pager .pager-btn:hover:not(:disabled):not(.cur) { border-color: var(--brand-500); color: var(--brand-600); }
.pager .pager-btn.cur { background: var(--navy-800); border-color: var(--navy-800); color: #fff; cursor: default; }
.pager .pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager .pager-info { font-size: 12px; color: var(--ink-500); margin-left: 8px; }
.pager .pager-ellipsis { color: var(--ink-300); padding: 0 2px; }

/* ==========================================================================
   2026-09-29 第四轮：报告页打磨（字体统一 / 留白 / 配套分页器）
   ========================================================================== */
/* 分组卡病种名回归黑体族：theme.css 已把全站标题统一为 var(--font-body)，
   此前 main.css 给 .group-disease 单独设宋体（--font-display），成为全页唯一
   serif 孤岛（用户反馈"字体嵌入不均匀"；且站方 CSP font-src 'self' 下
   --font-display 实际回落为系统 SimSun/Songti，粗体渲染粗糙）。
   庄重感靠 700 字重与字距，不靠字体切换。 */
.group-disease { font-family: var(--font-body); font-weight: 700; }

/* 分组卡留白（"留空太小"主因：卡片本身无内边距，内容贴四边） */
.report-group-card { padding: var(--sp-4) var(--sp-5); }
.report-groups { gap: var(--sp-5); }
.group-head { gap: var(--sp-1); }
.group-latest { padding: var(--sp-3) var(--sp-4); gap: var(--sp-2); color: var(--ink-900); } /* 顺带修正：原引用未定义的 --ink-800 */
.group-history .table-sm th, .group-history .table-sm td { padding: var(--sp-2) var(--sp-3); }
#report-groups > .state { grid-column: 1 / -1; } /* 空/加载态占满整行，不再挤在首列 */

/* 筛选区弱信息与控件宽度（替代原内联 style="width:120px"） */
#result-count { font-size: 13px; color: var(--ink-500); align-self: center; }
.filter-bar #f-disease, .filter-bar #f-region { width: 120px; }

/* theme.css 的 .btn{min-height:40px} 压过 .btn-sm，小按钮比设计意图笨重 */
.btn.btn-sm { min-height: 32px; }

/* 视图切换节奏 */
.view-toggle { margin: var(--sp-5) 0 var(--sp-4); }

/* 表格行高（仅桌面；移动端的 8px 10px 由第三轮段处理，min-width 避免覆盖它） */
@media (min-width: 769px) {
  .table th, .table td { padding: var(--sp-3) var(--sp-4); }
}

/* 分页器补齐：字体继承站点黑体、点击高度 32px；当前页改品牌色
   （深藏青 --navy-800 在深色模式下与卡片底色对比弱） */
.pager { padding: var(--sp-4) var(--sp-5); }
.pager .pager-btn { font-family: var(--font-body); min-height: 32px; }
.pager .pager-btn.cur { background: var(--brand-600); border-color: var(--brand-600); }

/* ==========================================================================
   2026-09-30 移动端（≤768px）表格可读性与横向溢出修复
   全部规则限定在窄屏媒体查询内，桌面端（>768px）表现不变。
   ========================================================================== */
/* mobile-fix-20260930 */
@media (max-width: 768px) {
  /* 根因：grid 子项默认 min-width:auto，内部宽表/画布会把整条 12 列轨道
     撑出视口，造成整页横向滚动。允许子项收缩后，溢出改由 .table-wrap
     内部横滚吸收。 */
  .grid > [class*="col-"] { min-width: 0; }

  /* 兜底：残余横向溢出裁在视口内。overflow:clip 不产生滚动容器，
     不影响 position:sticky 头部与审批栏；不支持的旧浏览器自动忽略。 */
  html, body { overflow-x: clip; }

  /* 表格横滚容器补 iOS 旧机型惯性滚动 */
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* 表格字号微收 + min-width 下限：列不再被压成逐字竖排（审核/管理页实测），
     放不下的部分在 .table-wrap 内横滚（渐隐滑动提示已有）。 */
  .table { font-size: 12.5px; }
  .table-wrap > .table { min-width: 520px; }
  /* 按表头列数分档抬高下限（:has 不支持的旧浏览器回落到 520px 档） */
  .table-wrap > .table:has(> thead > tr > th:nth-child(6)) { min-width: 640px; }
  .table-wrap > .table:has(> thead > tr > th:nth-child(7)) { min-width: 700px; }
  .table-wrap > .table:has(> thead > tr > th:nth-child(8)) { min-width: 800px; }

  /* 长单号/时间戳等 mono 单元格允许任意折行，避免把整列顶出可读宽度
     （疾病概览日期区间列的 nowrap 规则特异性更高，不受影响） */
  .table td.mono { overflow-wrap: anywhere; }

  /* 触控目标加高到 40px（原 32px 偏小）：表格操作列小按钮与分页按钮 */
  .btn.btn-sm { min-height: 40px; }
  .pager .pager-btn { min-height: 40px; }
}
