/* 医药竞争监测 · 康臣药业 — Datta Able 风格视觉改版（v2）
   原创实现：参考 Datta Able 管理后台的设计语言（深色侧栏 / 白色顶栏 / 糖果色点缀），
   未复制其代码、素材或品牌。纯原生 CSS：无外部字体、无图标库、无 CDN，图标使用文字符号。 */

:root {
  --primary: #04a9f5;
  --primary-dark: #0288d1;
  --primary-soft: #e8f6fe;
  --sidebar-bg: #2e3b51;
  --sidebar-active: #3d4f6b;
  --sidebar-text: #a9b7d0;
  --sidebar-muted: #6f7f99;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --card-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
  --border: #e6ebf1;
  --hairline: #eef1f5;
  --text: #37474f;
  --text-strong: #1e2a36;
  --muted: #8898aa;
  --success: #1de9b6;
  --success-dark: #0a9b6c;
  --warning: #f4c22b;
  --danger: #f44236;
  --purple: #a389d4;
  --purple-dark: #7b5fc4;
  --radius: 6px;
  --banner-bg: #e8f6fe;
  --banner-border: #04a9f5;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

h1 { font-size: 1.35rem; font-weight: 600; color: var(--text-strong); margin: 0 0 0.35rem; }
h2 { font-size: 1.12rem; font-weight: 600; color: var(--text-strong); margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1.02rem; font-weight: 600; color: var(--text-strong); margin: 0 0 0.5rem; }
p { margin: 0.5rem 0; }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

.muted { color: var(--muted); }

/* ---- 内测标识条 ---- */
.demo-banner {
  background: var(--banner-bg);
  border-bottom: 1px solid #bfe6fb;
  color: #0b5d8a;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
}

.demo-pill {
  display: inline-block;
  background: var(--primary-soft);
  border: 1px solid #bfe6fb;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* ---- 整体布局：侧栏 + 主列 ---- */
.layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

#sidebar {
  width: 252px;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(30, 42, 54, 0.18);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-head.brand { flex-wrap: wrap; }

.brand-logo {
  width: 118px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-sub { font-size: 0.8rem; font-weight: 600; color: #c9d6ea; white-space: nowrap; letter-spacing: 0.08em; }

#nav-close {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}
#nav-close:hover { background: rgba(255, 255, 255, 0.12); }

#nav { padding: 8px 0 16px; display: flex; flex-direction: column; }

/* Datta Able 式分组小标题 */
.nav-caption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--sidebar-muted);
  padding: 16px 20px 6px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  font-size: 0.92rem;
}
.nav-link .nav-ico {
  width: 20px;
  flex: 0 0 auto;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: #fff; }
.nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--sidebar-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scrim { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }

/* ---- 顶栏：白色 + 柔和阴影 ---- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  box-shadow: 0 1px 14px rgba(69, 90, 100, 0.1);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 24px;
  row-gap: 8px;
}

.icon-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
}
.icon-btn:hover { background: #eef3f7; }
#nav-toggle { display: none; }

/* Datta Able 式搜索：圆角输入 + 蓝色按钮 */
.search-wrap { position: relative; flex: 1 1 200px; max-width: 520px; min-width: 0; display: flex; }
#global-search {
  width: 100%;
  min-width: 0;
  border-radius: 20px 0 0 20px;
  border-right: 0;
}
.search-go {
  flex: 0 0 auto;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  border-radius: 0 20px 20px 0;
  padding: 0 22px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.search-go:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(30, 42, 54, 0.16);
  max-height: 320px;
  overflow-y: auto;
  z-index: 80;
}
.suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
}
.suggest-item:hover { background: var(--primary-soft); }
.suggest-item .s-type {
  font-size: 12px;
  color: var(--primary-dark);
  border: 1px solid #bfe6fb;
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0 8px;
  white-space: nowrap;
}
.suggest-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; }

.topbar-right { margin-left: auto; display: flex; gap: 4px; row-gap: 6px; align-items: center; flex-wrap: wrap; }

.panel-anchor { position: relative; }

/* 顶栏操作：Datta Able 式无边框按钮 */
.panel-btn {
  position: relative;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  color: var(--text);
}
.panel-btn:hover { background: #eef3f7; color: var(--primary-dark); }

.badge {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 10px 32px rgba(30, 42, 54, 0.18);
  z-index: 80;
  padding: 8px;
}
.dropdown h3 { font-size: 14px; padding: 4px 8px; }
.notif-item, .saved-item {
  padding: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
}
.notif-item .n-title { font-weight: 600; }
.notif-item .n-meta, .saved-item .n-meta { color: var(--muted); font-size: 12px; }
.dropdown-note {
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}

.store-warn {
  background: #fff1f0;
  border-bottom: 1px solid #f5b5b1;
  color: #8c2b1d;
  font-size: 13px;
  padding: 6px 24px;
}

/* ---- 路由挂载点 ---- */
#app { padding: 24px 24px 48px; max-width: 1500px; }

.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary-dark); }

/* ---- 通用组件 ---- */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: #eef3f7; text-decoration: none; border-color: #cfd9e2; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(4, 169, 245, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(4, 169, 245, 0.15); }
select.input { padding-right: 28px; }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--primary-soft);
  border: 1px solid #bfe6fb;
  border-radius: 999px;
  padding: 3px 6px 3px 12px;
  font-size: 13px;
  color: #0b5d8a;
}
.chip button {
  margin-left: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 6px;
}
.chip button:hover { color: var(--danger); }

/* ---- 表格：去填充表头 + 细分割线 ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table th, .table td {
  border-bottom: 1px solid var(--hairline);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}
.table thead th {
  background: transparent;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-strong);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.table tbody tr:hover { background: #f8fbfe; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Datta Able 式状态胶囊 */
.st-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 12px;
  white-space: nowrap;
}
.st-done { background: #d3f8ec; color: var(--success-dark); }
.st-progress { background: var(--primary-soft); color: var(--primary-dark); }
.st-ended { background: #fdecea; color: #cf3527; }

/* ---- 首页 ---- */
.home-hero { margin-bottom: 8px; }
.home-hero h1 { margin-bottom: 4px; }

.card-grid {
  display: grid;
  /* auto-fit 收起空轨道：卡片不足整行时拉伸填满，避免右侧留白与下方通栏卡片错位 */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 14px;
}
/* 卡片：无边框 + 柔和阴影 + 标题左侧色条 */
.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 22px;
}
.card > h2:first-child,
.card > h3:first-child {
  margin: 0 0 12px;
  font-size: 1.05rem;
  position: relative;
  padding-left: 14px;
}
.card > h2:first-child::before,
.card > h3:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: var(--primary);
}
.card-grid .card:nth-child(4n+2) > h2:first-child::before,
.card-grid .card:nth-child(4n+2) > h3:first-child::before { background: var(--success); }
.card-grid .card:nth-child(4n+3) > h2:first-child::before,
.card-grid .card:nth-child(4n+3) > h3:first-child::before { background: var(--purple); }
.card-grid .card:nth-child(4n+4) > h2:first-child::before,
.card-grid .card:nth-child(4n+4) > h3:first-child::before { background: var(--warning); }
.card .field { margin-bottom: 12px; }
.card .btn + .muted, .card .muted + .btn { margin-top: 4px; }
.scenario-card .count-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.scenario-card .count-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px dotted var(--border);
  padding: 3px 0;
}
.scenario-card .sec-count { font-weight: 700; color: var(--primary-dark); }

.home-actions .btn { margin-top: 8px; }
.stage-note {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
}

/* ---- 建设中占位页 ---- */
.placeholder {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 56px 32px;
  text-align: center;
  margin-top: 16px;
}
.placeholder-note {
  display: inline-block;
  background: #fff7d6;
  border: 1px solid var(--warning);
  color: #7a5c00;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  margin: 12px 0;
}

.error-page {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 48px 32px;
  margin-top: 24px;
}
.error-page h1 { color: var(--danger); }

/* ---- 响应式断点：窄屏侧栏折叠为顶部菜单按钮 ---- */
@media (max-width: 860px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    width: 250px;
  }
  body.nav-open #sidebar { transform: none; }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 150;
  }
  #nav-toggle { display: inline-block; }
  #nav-close { display: inline-block; }
  #app { padding: 16px 14px 40px; }
  #topbar { padding: 10px 14px; }
  .demo-pill { display: none; }
  #global-search::placeholder { font-size: 12px; }
  .search-go { padding: 0 14px; }
}

/* ---- 图表（js/charts.js 手绘 SVG） ---- */
.chart {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 18px 20px;
  min-width: 0;
}
.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 10px;
  position: relative;
  padding-left: 12px;
}
.chart-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: var(--primary);
}
.chart svg {
  display: block;
  max-width: 100%;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}
.chart-empty {
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
/* 图表两列排布，窄屏变一列；同行图表等高（网格项拉伸，内层图表填满） */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.chart-grid > div { min-width: 0; display: flex; flex-direction: column; }
.chart-grid > div > div:not(.chart) { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.chart-grid .chart { flex: 1 1 auto; }
/* 卡片内嵌套图表/空状态：去重阴影与内边距，避免双层卡片 */
.card .chart { box-shadow: none; padding: 4px 0 0; }
.card .empty { box-shadow: none; }
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
}
/* 可点击图表元素：指针 + hover 高亮 */
[data-chart-click] { cursor: pointer; }
[data-chart-click]:hover { filter: brightness(1.12); }
[data-chart-click]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============ 阶段 B：筛选区 ============ */
.f-grid, .filter-grid, .filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 16px;
  margin: 12px 0;
  /* 顶部对齐：各筛选组按内容高度排列，避免被拉伸出的内部空白 */
  align-items: start;
}
/* 选项较多的筛选组横跨 2 列，复选框排成两列更紧凑；窄屏取消跨列避免溢出 */
@media (min-width: 700px) {
  .f-grid > .f-wide2, .filter-grid > .f-wide2 { grid-column: span 2; }
}
.f-item, .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.f-sel { display: flex; flex-wrap: wrap; gap: 6px; }
.f-sel:empty { display: none; }
.f-actions, .filter-actions, .detail-actions, .empty-actions, .result-actions {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.f-advanced { margin-top: 8px; }
.f-advanced > summary { cursor: pointer; color: var(--primary-dark); font-size: 14px; }
.filters-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.filters-head h2 { margin: 0; }
.filters-body { margin-top: 8px; }
.f-group {
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--card-shadow);
  padding: 12px 16px 14px;
  margin: 0;
  min-width: 0;
}
.f-group > legend, .f-group > .f-label {
  font-size: 13px;
  color: var(--text-strong);
  font-weight: 700;
  padding: 0 4px;
  margin-bottom: 2px;
}
.f-note { font-size: 12px; margin: 4px 0 0; }
.chips-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chips-row:empty { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.cond-title { font-size: 13px; color: var(--muted); margin-right: 4px; }
.cond-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.date-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-input-row { display: flex; gap: 8px; }

/* ============ 阶段 B：通用组件 ============ */
.btn-sm { padding: 4px 10px; font-size: 12px; }
/* Datta Able 式统计卡：大数字 + 底部渐变色条 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 16px 0; }
.stat-card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 18px 18px 22px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sc1, var(--primary)), var(--sc2, #38bdf8));
}
.stat-card:nth-child(4n+1) { --sc1: #04a9f5; --sc2: #38bdf8; }
.stat-card:nth-child(4n+2) { --sc1: #1de9b6; --sc2: #0a9b6c; }
.stat-card:nth-child(4n+3) { --sc1: #a389d4; --sc2: #7b5fc4; }
.stat-card:nth-child(4n+4) { --sc1: #f4c22b; --sc2: #f39c12; }
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.stat-value { font-size: 30px; font-weight: 300; color: var(--text-strong); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-note { margin: 4px 0 0; font-size: 12px; }
.stat-list { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; font-size: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.seg-toggle button[data-seg], .seg { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.seg-toggle button[data-seg].active, .seg.active { background: var(--primary); color: #fff; }
/* 日期快捷预设：Datta Able 胶囊按钮组 */
#f-preset.seg { padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.seg-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.seg-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(4, 169, 245, 0.35);
}
/* 筛选区裸 input 统一为 Datta Able 输入框样式 */
.filter-card input[type="text"],
.filter-card input[type="search"],
.filter-card input[type="date"] {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.filter-card input[type="text"]:focus,
.filter-card input[type="search"]:focus,
.filter-card input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(4, 169, 245, 0.15);
}
.filter-card .field > input,
.filter-card .suggest-wrap input,
.filter-card .tag-input-row input { width: 100%; box-sizing: border-box; }
.date-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--hairline); padding: 10px; text-align: left; vertical-align: middle; }
.data-table th { background: transparent; font-weight: 700; font-size: 12.5px; color: var(--text-strong); white-space: nowrap; border-bottom: 2px solid var(--border); }
.data-table th[data-sort] { cursor: pointer; color: var(--primary-dark); }
.data-table th[data-sort]:hover { text-decoration: underline; }
.sort-ind { margin-left: 4px; font-size: 11px; }
.cell-text { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* 短名称列（药品名等）禁止换行，避免"普罗/利单/抗"式逐字断行 */
.cell-nowrap { white-space: nowrap; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; font-size: 13px; }
.page-total { color: var(--muted); margin-right: 8px; }
.page-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(4, 169, 245, 0.35); }
.page-btn:disabled { opacity: 0.45; cursor: default; }
.page-ellipsis { color: var(--muted); }
.page-jump { display: inline-flex; gap: 4px; align-items: center; margin-left: 8px; }
.page-jump input { width: 56px; }
.pg-gap { height: 4px; }
/* ---- 选项框：Datta Able 式 ---- */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}
.check-group, .check-list { display: flex; flex-wrap: wrap; gap: 2px 2px; }
.check-item, .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  cursor: pointer;
  padding: 5px 10px 5px 8px;
  border-radius: 6px;
  color: var(--text);
}
.check-item:hover, .check:hover { background: var(--primary-soft); }
.check-all { color: var(--primary-dark); font-weight: 600; }
.check-count { color: var(--muted); font-size: 12px; }
/* 下拉框：定制箭头 */
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238898aa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.date-range, .num-range { display: flex; align-items: center; gap: 6px; }
.date-range .input, .num-range .input { width: 150px; }
.num-range .input { width: 110px; }
.quick-date { display: flex; flex-direction: column; gap: 6px; }
.quick-opts { display: flex; flex-wrap: wrap; gap: 2px 2px; }
.quick-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  cursor: pointer;
  padding: 5px 10px 5px 8px;
  border-radius: 6px;
}
.quick-opt:hover { background: var(--primary-soft); }
.suggest-wrap { position: relative; }
.suggest-list { position: absolute; z-index: 30; }
.suggest-name { font-weight: 600; }
.suggest-alias { color: var(--muted); font-size: 12px; margin-left: 6px; }
.chip-link { text-decoration: none; }
.ent-kind { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

/* ============ 阶段 B：新闻 ============ */
.news-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.news-main { min-width: 0; }
.news-side { display: flex; flex-direction: column; gap: 16px; }
.news-side .card { padding: 18px; }
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.news-item { padding: 16px 4px; border-bottom: 1px solid var(--hairline); }
.news-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.news-date, .news-source { white-space: nowrap; }
.news-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; background: var(--primary-soft); color: var(--primary-dark); border-radius: 4px; padding: 1px 8px; }
.news-title { font-size: 15px; font-weight: 600; margin: 4px 0; display: block; color: var(--text-strong); text-decoration: none; }
a.news-title:hover { color: var(--primary-dark); text-decoration: underline; }
.news-summary, .news-summary-full { font-size: 13px; color: #3a4552; line-height: 1.7; margin: 6px 0; }
.news-entities { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ai-badge { display: inline-block; font-size: 11px; color: #8a5a00; background: #fff4d6; border: 1px solid #f0d48a; border-radius: 4px; padding: 0 6px; margin-left: 6px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud .tag { cursor: pointer; border: 1px solid transparent; }
.tag-cloud .tag:hover { border-color: var(--primary); }
.tag-cloud .tag.active { background: var(--primary); color: #fff; }
.cloud-count { color: var(--muted); font-size: 11px; }
.data-note { font-size: 13px; }
.data-note dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.data-note dt { color: var(--muted); }
.data-note dd { margin: 0; font-weight: 600; }
@media (max-width: 1100px) {
  .news-layout { grid-template-columns: 1fr; }
  .news-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .news-side { grid-template-columns: 1fr; }
}

/* ============ 阶段 B：交易 ============ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 12px; }
.tab { border: 0; background: transparent; padding: 10px 18px; font-size: 15px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.entity-filter { display: flex; flex-direction: column; gap: 6px; position: relative; }
.entity-chips-slot { display: flex; flex-wrap: wrap; gap: 6px; }
.entity-chips-slot:empty { display: none; }
.topamt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .topamt-grid { grid-template-columns: 1fr; } }

/* ============ 阶段 B：详情页 ============ */
.info-list { margin: 0; }
.info-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.rel-item:last-child { border-bottom: 0; }
.rel-title { font-weight: 600; color: var(--text-strong); text-decoration: none; }
a.rel-title:hover { color: var(--primary-dark); text-decoration: underline; }
.rel-meta { font-size: 12px; margin: 4px 0; }
.rel-summary { font-size: 13px; color: #3a4552; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.id-tag { font-size: 12px; font-weight: 400; }
.fav-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 4px; padding: 2px 8px; cursor: pointer; font-size: 14px; }
.fav-btn.on { color: #d48806; border-color: #f0d48a; background: #fffbe8; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th, .kv-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.kv-table th { background: #f8fafc; width: 140px; color: var(--muted); font-weight: 600; }
@media (max-width: 700px) {
  .info-row { grid-template-columns: 110px 1fr; }
}

/* ============ 阶段 B：通知 / 已保存检索面板 ============ */
.notif-list, .saved-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.notif-item.notif-clickable { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--hairline); }
.notif-item.notif-clickable:hover { background: var(--primary-soft); }
.n-unread { display: inline-block; font-size: 11px; color: #fff; background: var(--primary); border-radius: 8px; padding: 0 6px; margin-left: 6px; }
.saved-item { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--hairline); }
.saved-go { flex: 1; border: 0; background: transparent; text-align: left; padding: 10px 4px 10px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.saved-go:hover { color: var(--primary-dark); }
.saved-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; font-size: 12px; }
.saved-del:hover { color: var(--danger); }

/* ============ 阶段 C：流行病学 ============ */
/* 值类型文字标签：报告值/推算为中性样式，预测拟合醒目 */
.vt { display: inline-block; font-size: 12px; border-radius: 4px; padding: 1px 8px; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.vt-pred { background: #fdecea; color: #b3261e; border: 1px solid #f3b8b3; font-weight: 600; }
/* 年份范围输入 */
.year-range { display: flex; align-items: center; gap: 8px; }
.year-range .input { width: 110px; }
/* 详情页定义列表 */
.def-list { display: grid; gap: 8px; margin: 12px 0; }
.def-list > div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.def-list dt { color: var(--muted); }
.note-list { margin: 8px 0 8px 20px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ 阶段 C：窄屏筛选区可折叠 ============ */
.f-collapse { border: 0; padding: 0; margin: 0; }
.f-collapse > summary.f-collapse-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.f-collapse-title { margin: 1.75rem 0 0.75rem; font-size: 1.12rem; font-weight: 600; color: var(--text-strong); }
.f-collapse-hint { display: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (min-width: 861px) {
  .f-collapse > summary.f-collapse-bar { list-style: none; cursor: default; pointer-events: none; }
  .f-collapse > summary.f-collapse-bar::-webkit-details-marker { display: none; }
}
@media (max-width: 860px) {
  .f-collapse > summary.f-collapse-bar { cursor: pointer; list-style: none; padding: 6px 0; }
  .f-collapse > summary.f-collapse-bar::-webkit-details-marker { display: none; }
  .f-collapse > summary.f-collapse-bar::before { content: '▸'; color: var(--primary); font-size: 14px; }
  .f-collapse[open] > summary.f-collapse-bar::before { content: '▾'; }
  .f-collapse-title { margin: 0; font-size: 16px; }
  .f-collapse-hint { display: inline; }
  .data-table td { overflow-wrap: anywhere; }
  .rel-title { overflow-wrap: anywhere; }
}

/* ---------- 非阻塞对话框 ---------- */
.dlg-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(30, 42, 54, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dlg {
  background: var(--surface); color: var(--text);
  border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  width: 100%; max-width: 420px; padding: 20px 20px 16px;
}
.dlg h3 { margin: 0 0 8px; font-size: 17px; }
.dlg-hint { margin: 0 0 12px; font-size: 13px; }
.dlg-label { display: block; font-size: 13px; color: var(--muted); }
.dlg-input { width: 100%; box-sizing: border-box; margin-top: 6px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-danger {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.btn-danger:hover { background: #cf3527; border-color: #cf3527; }
/* ---------- 共享轻提示 ---------- */
#shared-toast-box {
  position: fixed; right: 16px; bottom: 16px; z-index: 3000;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 90vw);
}
.shared-toast {
  background: #2e3b51; color: #fff; font-size: 13px;
  padding: 10px 14px; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: opacity 0.4s, transform 0.4s;
}
.shared-toast-ok { background: var(--success-dark); }
.shared-toast-error { background: #cf3527; }
.shared-toast-out { opacity: 0; transform: translateY(6px); }
