/* --------------------------------------------------------------------------
   财务 DRG 成本盈亏分析 · 桌面端原型样式
   组织顺序：基础 → 壳层 → 通用控件 → 卡片/KPI → 表格 → 图表
            → 业务组件 → 抽屉/反馈 → 各页面布局
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-width: 1180px;
  background: var(--bg-app);
  color: var(--text-1);
  font: var(--fs-sm)/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.icon { width: 14px; height: 14px; flex: none; }
body.no-scroll { overflow: hidden; }
::selection { background: var(--brand-100); }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 999;
  padding: 8px 12px; background: var(--brand-500); color: #fff;
  border-radius: var(--r-sm); font-size: var(--fs-xs);
}
.skip-link:focus { top: 10px; }

/* ---------- 壳层 ---------- */
.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--h-topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-1);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 26px; height: 26px; display: grid; place-items: center;
  color: var(--brand-500); flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); letter-spacing: .01em; white-space: nowrap; }
.brand-divider { width: 1px; height: 16px; background: var(--border-1); margin: 0 2px; }
.brand-module { font-size: var(--fs-xs); color: var(--text-4); white-space: nowrap; }

.topbar-context { display: flex; align-items: center; gap: 12px; }
.ctx-field { display: flex; flex-direction: column; gap: 1px; }
.ctx-field > span { font-size: 10.5px; color: var(--text-4); line-height: 1.2; }
.ctx-field select {
  height: 26px; padding: 0 24px 0 7px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; font-size: var(--fs-xs); font-weight: 600; color: var(--text-1);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235b6b82' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  cursor: pointer;
}
.ctx-field select:hover { background-color: var(--bg-hover); }
.ctx-field select:focus-visible { border-color: var(--brand-300); outline-offset: 1px; }

.scope-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--r-sm); border: 1px solid var(--border-1);
  background: var(--bg-subtle); color: var(--text-3);
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.demo-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
  border-radius: var(--r-sm); border: 1px dashed var(--brand-200);
  background: var(--brand-50); color: var(--brand-600);
  font-size: 10.5px; white-space: nowrap;
}
.publish-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  background: var(--success-bg); border: 1px solid var(--success-border);
  color: var(--success); font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.publish-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.publish-chip.is-draft { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.topbar-divider { width: 1px; height: 22px; background: var(--border-1); }

.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--text-4);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-600);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  border: 1px solid var(--brand-200);
}
.user-copy { display: flex; flex-direction: column; line-height: 1.25; }
.user-copy strong { font-size: 12px; font-weight: 600; }
.user-copy small { font-size: 10.5px; color: var(--text-4); }

.shell { display: grid; grid-template-columns: var(--w-sidebar) minmax(0, 1fr); align-items: start; }

.sidebar {
  position: sticky; top: var(--h-topbar);
  height: calc(100vh - var(--h-topbar));
  background: var(--bg-card);
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  z-index: 20;
}
.side-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.nav-group { padding: 8px 0 4px; border-top: 1px solid var(--border-2); }
.nav-group:first-child { border-top: 0; padding-top: 2px; }
.nav-label {
  padding: 0 8px 4px; font-size: 10.5px; font-weight: 500;
  color: var(--text-4); letter-spacing: .04em;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 8px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: var(--fs-sm); text-decoration: none;
}
.nav-item:hover { background: var(--bg-app); color: var(--text-1); text-decoration: none; }
.nav-item.is-active { background: var(--bg-active); color: var(--brand-600); font-weight: 600; }
.nav-icon { width: 16px; height: 16px; color: currentColor; flex: none; }
.nav-icon svg { width: 16px; height: 16px; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); background: var(--danger-bg); border: 1px solid var(--danger-border);
  color: var(--danger); font-size: 10.5px; font-weight: 600;
}
.sidebar-foot {
  padding: 10px 14px 12px; border-top: 1px solid var(--border-1);
  font-size: 11px; color: var(--text-4); background: var(--bg-subtle);
}
.version-line { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.version-line strong { color: var(--text-2); font-weight: 600; }
.version-sub { margin-top: 2px; padding-left: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--success); }
.dot-warn { background: var(--warning); }
.dot-danger { background: var(--danger); }

.main { min-width: 0; }
.view {
  max-width: var(--w-content-max);
  margin: 0 auto;
  padding: 20px 24px 48px;
}
.view:focus { outline: none; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.page-title-row { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: var(--fs-2xl); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.page-sub { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-4); }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.eyebrow { font-size: 11px; color: var(--text-4); letter-spacing: .04em; margin-bottom: 4px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-4); margin-bottom: 6px; }
.crumb button { border: 0; background: none; padding: 0; color: var(--text-link); font-size: inherit; }
.crumb span.sep { color: var(--n-400); }

/* ---------- 通用 ---------- */
.muted { color: var(--text-4); }
.small { font-size: var(--fs-xs); }
.tiny { font-size: var(--fs-2xs); }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.zero { color: var(--text-4); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-2); margin: 12px 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h-control); padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-card); color: var(--text-2);
  font-size: var(--fs-xs); font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--bg-hover); color: var(--text-1); }
.btn:active { background: var(--n-100); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-border); color: #fff; }
.btn-primary:hover { background: var(--btn-primary-bg-hover); border-color: var(--btn-primary-bg-hover); color: #fff; }
.btn-primary:active { background: var(--brand-700); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { height: var(--h-control-sm); padding: 0 9px; font-size: 11.5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-link {
  display: inline; border: 0; background: none; padding: 0;
  color: var(--text-link); font-size: inherit; font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--text-4); }
.field > span .req { color: var(--danger); margin-left: 2px; }
.input, .select {
  height: var(--h-control); padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-card); color: var(--text-1);
  font-size: var(--fs-xs);
}
.select {
  appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235b6b82' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  cursor: pointer;
}
.input:hover, .select:hover { border-color: var(--n-400); }
.input:focus, .select:focus { border-color: var(--brand-300); outline: 2px solid var(--brand-100); outline-offset: 0; }
.input[readonly] { background: var(--bg-subtle); color: var(--text-4); }
.select:disabled { background: var(--bg-subtle); color: var(--text-3); cursor: default; opacity: 1; }
.input-sm { height: var(--h-control-sm); font-size: 11.5px; }
.search { position: relative; }
.search svg {
  position: absolute; left: 9px; top: 50%; width: 14px; height: 14px;
  transform: translateY(-50%); color: var(--text-4); pointer-events: none;
}
.search .input { padding-left: 28px; width: 100%; }
.search.w-220 { width: 220px; } .search.w-260 { width: 260px; } .search.w-300 { width: 300px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.check input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand-500); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 8px; }
.form-hint { color: var(--text-4); font-size: 11.5px; }

.segmented {
  display: inline-flex; height: 30px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); overflow: hidden; background: var(--bg-card);
}
.segmented button {
  height: 100%; padding: 0 12px; border: 0; border-right: 1px solid var(--border-1);
  background: transparent; color: var(--text-3); font-size: 11.5px; white-space: nowrap;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--bg-hover); color: var(--text-1); }
.segmented button.is-active { background: var(--bg-active); color: var(--brand-600); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-1); }
.tab {
  height: 34px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--text-3); font-size: var(--fs-xs);
}
.tab:hover { color: var(--text-1); }
.tab.is-active { color: var(--brand-600); border-bottom-color: var(--brand-500); font-weight: 600; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px; border-radius: 3px;
  border: 1px solid var(--border-1); background: var(--bg-subtle);
  color: var(--text-3); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.tag.no-dot::before { display: none; }
.tag-blue { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-600); }
.tag-green { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.tag-red { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.tag-amber { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.tag-purple { background: #f4f0fb; border-color: #ded2f2; color: #5b3f94; }
.tag-gray { background: var(--n-100); border-color: var(--border-1); color: var(--text-3); }
.tag-solid-blue { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.tag-solid-blue::before { background: #fff; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 18px; padding: 0 6px; border-radius: 3px;
  background: var(--bg-subtle); border: 1px solid var(--border-1);
  color: var(--text-3); font-size: 10.5px; white-space: nowrap;
}
.pill-warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.pill-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  min-width: 0;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-2);
}
.card-head.no-border { border-bottom: 0; padding-bottom: 4px; }
.card-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.card-title .count { color: var(--text-4); font-weight: 400; margin-left: 4px; }
.card-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-4); }
.card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.card-body { padding: 14px 16px; }
.card-body.tight { padding: 10px 16px; }
.card-body.flush { padding: 0; }
.card-foot {
  padding: 9px 16px; border-top: 1px solid var(--border-2);
  background: var(--bg-subtle); font-size: 11.5px; color: var(--text-4);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.card-note {
  padding: 8px 16px; border-top: 1px solid var(--border-2);
  font-size: 11.5px; color: var(--text-4); line-height: 1.55;
}
.grid { display: grid; gap: 12px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-12.grid { margin-top: 12px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--r-md);
  padding: 13px 15px 10px; min-width: 0;
}
.kpi-label { font-size: 11.5px; color: var(--text-4); display: flex; align-items: center; gap: 5px; }
.kpi-value {
  margin-top: 4px; font-size: var(--fs-kpi); line-height: 1.2; font-weight: 600;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.kpi-value .unit { font-size: 12px; font-weight: 400; color: var(--text-4); margin-left: 3px; }
.kpi-foot { margin-top: 4px; min-height: 17px; font-size: 11px; color: var(--text-4); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-spark { margin-top: 6px; height: 24px; }
.kpi-spark svg { width: 100%; height: 24px; }
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  height: 17px; padding: 0 4px; border-radius: 3px;
  font-size: 10.5px; font-weight: 600;
}
.delta svg { width: 9px; height: 9px; }
.delta-good { background: var(--success-bg); color: var(--success); }
.delta-bad { background: var(--danger-bg); color: var(--danger); }
.delta-flat { background: var(--n-100); color: var(--text-4); }
.kpi.is-alert { border-color: var(--warning-border); background: linear-gradient(0deg, var(--warning-bg), var(--warning-bg)) padding-box; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--r-md);
}
.toolbar .field .select, .toolbar .field .input { min-width: 118px; }
.toolbar-right { margin-left: auto; display: flex; align-items: flex-end; gap: 8px; }
.toolbar-sep { width: 1px; height: 26px; background: var(--border-1); margin: 0 2px; align-self: flex-end; }
.filter-summary { font-size: 11.5px; color: var(--text-4); }
.filter-summary strong { color: var(--text-2); font-weight: 600; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow: auto; }
.table-wrap.scroll-y { max-height: 62vh; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-xs); }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  height: var(--h-row-head); padding: 0 12px;
  background: var(--bg-subtle); color: var(--text-3);
  font-size: 11.5px; font-weight: 500; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--border-1);
}
.table thead th:first-child { text-align: left; }
.table thead th.left { text-align: left; }
.table tbody td {
  height: var(--h-row); padding: 0 12px;
  border-bottom: 1px solid var(--border-2);
  text-align: right; white-space: nowrap; vertical-align: middle;
}
.table tbody td:first-child { text-align: left; }
.table tbody td.left { text-align: left; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-subtle); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover td { background: var(--bg-active); }
.table tbody tr.is-selected td { background: var(--bg-active); }
.table tbody tr.is-muted td { color: var(--text-4); }
.table tbody tr.is-warning td { background: #fffdf8; }
.table tbody tr.is-warning:hover td { background: var(--warning-bg); }
.table.sticky-first tbody tr.is-warning td:first-child { background: #fffdf8; }
.table.sticky-first tbody tr.is-warning:hover td:first-child { background: var(--warning-bg); }
.table tbody tr.total-row td { background: var(--bg-subtle); font-weight: 600; border-top: 1px solid var(--border-1); }
.table .cell-main { font-weight: 500; color: var(--text-1); }
.table .cell-sub { display: block; font-size: 10.5px; color: var(--text-4); font-weight: 400; margin-top: 1px; }
.table .cell-sub.pos, .table .cell-sub.neg { font-weight: 500; }
.table .ref-col { color: var(--text-4); background: #fbfcfe; font-size: 11.5px; }
.table tbody tr:hover .ref-col { background: #f3f6fa; }
.table .num-strong { font-weight: 600; }
.table .col-tight { padding-left: 8px; padding-right: 8px; }
.table.sticky-first thead th:first-child {
  left: 0; z-index: 3; background: var(--bg-subtle);
  box-shadow: inset -1px 0 0 var(--border-1);
}
.table.sticky-first tbody td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--bg-card);
  box-shadow: inset -1px 0 0 var(--border-2);
}
.table.sticky-first tbody tr:hover td:first-child { background: var(--bg-subtle); }
.table.sticky-first tbody tr.is-clickable:hover td:first-child { background: var(--bg-active); }
.table.sticky-first tbody tr.is-selected td:first-child { background: var(--bg-active); }
.table.sticky-first tbody tr.doctor-row-unassigned td:first-child { background: var(--warning-bg); }
.table .w-name { min-width: 150px; }
.table .w-code { min-width: 118px; }
.table .w-tag { min-width: 92px; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--brand-600); }
.th-sort .sort-ind { display: inline-block; width: 10px; margin-left: 3px; color: var(--n-400); font-size: 10px; }
.th-sort.is-sorted { color: var(--brand-600); }
.th-sort.is-sorted .sort-ind { color: var(--brand-600); }
.cell-link { border: 0; background: none; padding: 0; color: var(--text-link); font-weight: 500; font-size: inherit; text-align: left; }
.cell-link:hover { text-decoration: underline; }
.cell-name { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.cell-name strong { font-weight: 500; }
.cell-name small { font-size: 10.5px; color: var(--text-4); font-weight: 400; }
.cell-tags { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.cell-tags.left { justify-content: flex-start; }
.text-wrap { white-space: normal; }
.heat-pos { background: rgba(15, 122, 77, .07); }
.heat-neg { background: rgba(180, 35, 24, .06); }
.heat-neg-strong { background: rgba(180, 35, 24, .1); }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.table-summary { font-size: 11.5px; color: var(--text-4); }
.table-summary strong { color: var(--text-2); font-weight: 600; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-2); font-size: 11.5px; color: var(--text-4); }

.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 28px; height: 26px; padding: 0 7px;
  border: 1px solid var(--border-1); border-radius: var(--r-sm);
  background: var(--bg-card); color: var(--text-3); font-size: 11.5px;
}
.page-btn:hover { background: var(--bg-hover); }
.page-btn.is-active { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-600); font-weight: 600; }
.page-btn[disabled] { opacity: .45; cursor: default; }

/* ---------- 空态 ---------- */
.empty { padding: 40px 20px; text-align: center; }
.empty-icon {
  width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--bg-subtle); border: 1px solid var(--border-1);
  display: grid; place-items: center; color: var(--text-4);
}
.empty-icon svg { width: 18px; height: 18px; }
.empty-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.empty-hint { margin-top: 3px; font-size: 11.5px; color: var(--text-4); }
.empty .btn { margin-top: 12px; }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px; border: 1px solid var(--info-border); border-radius: var(--r-sm);
  background: var(--brand-50); color: var(--text-3); font-size: 11.5px; line-height: 1.55;
}
.notice svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--brand-600); }
.notice strong { color: var(--text-1); font-weight: 600; }
.notice-warn { background: var(--warning-bg); border-color: var(--warning-border); }
.notice-warn svg { color: var(--warning); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.notice-danger svg { color: var(--danger); }
.notice-success { background: var(--success-bg); border-color: var(--success-border); }
.notice-success svg { color: var(--success); }
.notice-plain { background: var(--bg-subtle); border-color: var(--border-1); color: var(--text-4); }
.notice-plain svg { color: var(--text-4); }

/* ---------- 图表 ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 10.5px; fill: var(--text-4); font-family: inherit; }
.chart .axis-line { stroke: var(--border-1); stroke-width: 1; }
.chart .grid-line { stroke: var(--border-2); stroke-width: 1; }
.chart .zero-line { stroke: var(--n-300); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .bar-label { font-size: 10px; font-weight: 600; }
.chart .point { transition: opacity .12s; }
.chart .point:hover { opacity: .78; }
.chart .quadrant-label { font-size: 10px; fill: var(--text-4); opacity: .9; }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-4); }
.chart-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.chart-legend .swatch.line { height: 2px; border-radius: 0; }
.chart-empty { padding: 40px 12px; text-align: center; color: var(--text-4); font-size: 12px; }

/* 排行条（HTML 发散条） */
.bar-list { display: flex; flex-direction: column; }
.bar-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 92px; align-items: center; gap: 10px;
  height: 34px; border-bottom: 1px solid var(--border-2); font-size: 12px;
}
.bar-row:last-child { border-bottom: 0; }
.bar-row.is-clickable { cursor: pointer; }
.bar-row.is-clickable:hover { background: var(--bg-subtle); }
.bar-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.bar-name .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-track { position: relative; height: 16px; background: var(--bg-subtle); border-radius: 2px; overflow: hidden; }
.bar-track::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--n-300); }
.bar-fill { position: absolute; top: 2px; bottom: 2px; border-radius: 1px; }
.bar-fill.pos { background: var(--success); }
.bar-fill.neg { background: var(--danger); }
.bar-value { text-align: right; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-sub { font-size: 10.5px; color: var(--text-4); font-weight: 400; margin-left: 3px; }

/* 构成条 */
.stack-bar { display: flex; height: 12px; border-radius: 2px; overflow: hidden; background: var(--n-100); }
.stack-seg { height: 100%; min-width: 1px; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.stack-legend .item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-4); }
.stack-legend .swatch { width: 8px; height: 8px; border-radius: 2px; }
.stack-legend strong { color: var(--text-2); font-weight: 600; }

/* ---------- 抽屉 ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .34);
  display: flex; justify-content: flex-end;
  animation: fade-in .16s ease-out;
}
.drawer {
  width: 660px; max-width: 94vw; height: 100%;
  background: var(--bg-card);
  box-shadow: var(--shadow-drawer);
  display: flex; flex-direction: column;
  animation: slide-in .18s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 20px 12px; border-bottom: 1px solid var(--border-1);
  flex: none;
}
.drawer-head-main { min-width: 0; }
.drawer-eyebrow { font-size: 10.5px; color: var(--text-4); letter-spacing: .04em; margin-bottom: 2px; }
.drawer-title { font-size: 16px; font-weight: 600; line-height: 1.35; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-4); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-close {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text-4);
}
.drawer-close:hover { background: var(--bg-hover); color: var(--text-1); }
.drawer-close svg { width: 16px; height: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px 24px; background: #f7f9fc; }
.drawer-body > * + * { margin-top: 12px; }
.drawer-section { background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--r-md); }
.drawer-section .sec-head { padding: 10px 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-section .sec-title { font-size: 12.5px; font-weight: 600; }
.drawer-section .sec-body { padding: 0 14px 12px; }
.drawer-section .sec-body.flush { padding: 0; }
.drawer-section .sec-body.pad { padding: 12px 14px; }
.drawer-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 20px; border-top: 1px solid var(--border-1); background: var(--bg-card); flex: none;
}
.drawer-foot .left { margin-right: auto; }
.kpi-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi-mini { border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 8px 10px; background: var(--bg-subtle); }
.kpi-mini .k { font-size: 10.5px; color: var(--text-4); }
.kpi-mini .v { margin-top: 2px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.kpi-mini .s { font-size: 10px; color: var(--text-4); margin-top: 1px; }

.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 10px; font-size: 12px; }
.kv dt { color: var(--text-4); }
.kv dd { margin: 0; color: var(--text-2); }
.kv dd strong { font-weight: 600; }

/* 关系链 */
.relation { display: grid; grid-template-columns: 1fr 26px 1.15fr 26px 1fr; align-items: stretch; gap: 6px; }
.rel-col { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.rel-node {
  border: 1px solid var(--border-1); background: var(--bg-subtle); border-radius: var(--r-sm);
  padding: 7px 9px; font-size: 11.5px; line-height: 1.45;
}
.rel-node .k { display: block; font-size: 10px; color: var(--text-4); margin-bottom: 1px; }
.rel-node strong { font-weight: 600; font-size: 12px; }
.rel-node.is-main { border-color: var(--brand-200); background: var(--brand-50); }
.rel-node .split { color: var(--text-4); font-size: 10.5px; }
.rel-arrow { display: flex; align-items: center; justify-content: center; color: var(--n-400); }
.rel-arrow svg { width: 14px; height: 14px; }

/* ---------- 反馈 ---------- */
.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  min-width: 220px; max-width: 380px; padding: 9px 13px;
  background: var(--n-900); color: #fff; border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop); font-size: 12px; line-height: 1.5;
  animation: toast-in .18s ease-out;
}
.toast .dot { width: 7px; height: 7px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 总览 ---------- */
.overview-actions .action-list { display: flex; flex-direction: column; }
.action-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--border-2);
}
.action-item:last-child { border-bottom: 0; }
.action-flag { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--text-4); }
.action-flag.red { background: var(--danger); }
.action-flag.amber { background: var(--warning); }
.action-flag.green { background: var(--success); }
.action-main { min-width: 0; flex: 1; }
.action-title { font-size: 12px; font-weight: 500; color: var(--text-1); line-height: 1.4; }
.action-title button { border: 0; background: none; padding: 0; font: inherit; color: var(--text-link); text-align: left; }
.action-title button:hover { text-decoration: underline; }
.action-desc { margin-top: 1px; font-size: 11px; color: var(--text-4); line-height: 1.45; }
.action-go { flex: none; }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.health-item { border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 8px 10px; background: var(--bg-subtle); }
.health-item .k { font-size: 10.5px; color: var(--text-4); display: flex; align-items: center; gap: 4px; }
.health-item .v { margin-top: 2px; font-size: 14px; font-weight: 600; }
.health-item .v small { font-size: 10.5px; font-weight: 400; color: var(--text-4); }
.pop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.pop-col { padding: 12px 14px; }
.pop-col + .pop-col { border-left: 1px solid var(--border-2); }
.pop-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pop-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 8px; }
.pop-kpi .k { font-size: 10.5px; color: var(--text-4); }
.pop-kpi .v { font-size: 15px; font-weight: 600; margin-top: 1px; }
.pop-kpi .s { font-size: 10px; color: var(--text-4); }

/* ---------- 多维分析 ---------- */
.pivot-level { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pivot-note { font-size: 11px; color: var(--text-4); }
.pivot-table th:first-child { width: 22%; }
.pivot-table th:nth-child(2) { width: 8%; }
.pivot-table th:nth-child(3) { width: 12%; }
.pivot-table th:nth-child(4), .pivot-table th:nth-child(5) { width: 14%; }
.pivot-table th:nth-child(6) { width: 12%; }
.pivot-table th:nth-child(7) { width: 9%; }
.pivot-table td.cell-profit { font-weight: 600; }

/* ---------- 科室与医生 ---------- */
.dept-layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 12px; align-items: start; }
.dept-list { position: sticky; top: calc(var(--h-topbar) + 12px); }
.dept-list .search-box { padding: 10px 12px; border-bottom: 1px solid var(--border-2); }
.dept-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border-2); cursor: pointer;
}
.dept-row:last-child { border-bottom: 0; }
.dept-row:hover { background: var(--bg-subtle); }
.dept-row.is-active { background: var(--bg-active); box-shadow: inset 2px 0 0 var(--brand-500); }
.dept-row .name { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.dept-row .profit { font-size: 12px; font-weight: 600; text-align: right; }
.dept-row .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-4); }
.dept-mini-bar { grid-column: 1 / -1; height: 4px; background: var(--bg-subtle); border-radius: 2px; overflow: hidden; display: flex; }
.dept-mini-bar .neg { background: var(--danger); height: 100%; }
.dept-mini-bar .pos { background: var(--success); height: 100%; }
.doctor-row-unassigned { background: var(--warning-bg); }

/* ---------- 病组 ---------- */
.drg-code { font-weight: 600; letter-spacing: .02em; }
.drg-name { color: var(--text-3); font-size: 11px; }
.drg-action-tag { display: inline-flex; align-items: center; gap: 4px; }
.quadrant-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--text-4); }
.quadrant-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.quadrant-legend .swatch { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border-1); }
.scenario-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; align-items: start; }
.slider-field { display: grid; grid-template-columns: 100px minmax(0, 1fr) 56px; align-items: center; gap: 8px; margin-bottom: 10px; }
.slider-field .name { font-size: 11.5px; color: var(--text-3); }
.slider-field output { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--brand-500); }
.scenario-result { border: 1px solid var(--brand-200); background: var(--brand-50); border-radius: var(--r-sm); padding: 11px 12px; }
.scenario-result .k { font-size: 10.5px; color: var(--text-4); }
.scenario-result .v { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 2px 0; }
.scenario-result .s { font-size: 10.5px; color: var(--text-4); }

/* ---------- 病例 ---------- */
.match-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.match-status .dot { width: 5px; height: 5px; }
.case-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.case-summary-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 7px; border-radius: 3px;
  background: var(--bg-subtle); border: 1px solid var(--border-1);
  font-size: 11px; color: var(--text-3);
}
.chip strong { font-weight: 600; color: var(--text-1); }

/* ---------- 导入 ---------- */
.month-rail { display: flex; gap: 8px; flex-wrap: wrap; }
.month-chip {
  min-width: 132px; border: 1px solid var(--border-1); border-radius: var(--r-sm);
  padding: 8px 10px; background: var(--bg-subtle); cursor: pointer;
}
.month-chip:hover { border-color: var(--brand-300); background: var(--brand-50); }
.month-chip.is-active { border-color: var(--brand-300); background: var(--brand-50); }
.month-chip .m { font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.month-chip .s { font-size: 10.5px; color: var(--text-4); margin-top: 2px; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step {
  border: 1px solid var(--border-1); border-radius: var(--r-sm); padding: 9px 10px;
  background: var(--bg-card); display: flex; gap: 8px; align-items: flex-start;
}
.step-no {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; border: 1px solid var(--border-strong);
  background: var(--bg-subtle); color: var(--text-4); font-size: 10.5px; font-weight: 600;
}
.step.is-active { border-color: var(--brand-300); background: var(--brand-50); }
.step.is-active .step-no { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.step.is-done { border-color: var(--success-border); background: var(--success-bg); }
.step.is-done .step-no { background: var(--success); border-color: var(--success); color: #fff; }
.step-title { font-size: 11.5px; font-weight: 600; line-height: 1.35; }
.step-desc { font-size: 10px; color: var(--text-4); margin-top: 1px; }
.import-body { min-height: 190px; }
.dropzones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dropzone {
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  background: var(--bg-subtle); padding: 16px; text-align: center;
}
.dropzone:hover { border-color: var(--brand-300); background: var(--brand-50); }
.dropzone .dz-icon { width: 32px; height: 32px; margin: 0 auto 8px; color: var(--brand-500); display: grid; place-items: center; }
.dropzone .dz-icon svg { width: 22px; height: 22px; }
.dz-title { font-size: 12.5px; font-weight: 600; }
.dz-hint { font-size: 11px; color: var(--text-4); margin-top: 3px; }
.dz-file {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px; border-radius: 3px; background: var(--success-bg); border: 1px solid var(--success-border);
  color: var(--success); font-size: 10.5px;
}
.file-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--border-1); border-radius: var(--r-sm);
  background: var(--bg-subtle);
}
.file-strip .dz-file { margin-top: 0; }
.check-list { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-2); font-size: 11.5px; }
.check-item:last-child { border-bottom: 0; }
.check-icon { width: 16px; height: 16px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.check-icon svg { width: 14px; height: 14px; }
.check-item .t { font-weight: 500; }
.check-item .d { color: var(--text-4); font-size: 10.5px; }
.import-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.import-actions .hint { font-size: 11px; color: var(--text-4); }

/* ---------- 版本比对 ---------- */
.compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.ratio-ring { position: relative; width: 112px; height: 112px; margin: 0 auto; }
.ratio-ring svg { width: 112px; height: 112px; }
.ratio-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ratio-center strong { font-size: 20px; line-height: 1.2; }
.ratio-center span { font-size: 10.5px; color: var(--text-4); }
.impact-list { display: flex; flex-direction: column; }
.impact-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 100px; gap: 8px; align-items: center; height: 30px; font-size: 11.5px; }
.impact-row .track { display: block; height: 8px; background: var(--bg-subtle); border-radius: 2px; overflow: hidden; }
.impact-row .fill { display: block; height: 100%; background: var(--brand-400); }
.impact-row .val { text-align: right; font-weight: 600; }
.compare-versions { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: nowrap; }
.compare-versions .badge { flex: none; border: 1px solid var(--border-1); background: var(--bg-subtle); border-radius: var(--r-sm); padding: 5px 9px; }
.compare-versions .badge strong { font-weight: 600; }
.compare-versions .arrow { flex: none; display: flex; align-items: center; color: var(--n-400); }

/* ---------- 配置中心 ---------- */
.config-impact {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--brand-200); background: var(--brand-50);
  border-radius: var(--r-sm); font-size: 11.5px; color: var(--text-3);
}
.config-impact strong { color: var(--text-1); }
.history-row { display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 5px 0; border-bottom: 1px solid var(--border-2); }
.history-row:last-child { border-bottom: 0; }
.history-row .rev { font-weight: 600; color: var(--text-2); width: 34px; flex: none; }
.history-row .what { flex: 1; color: var(--text-3); }
.history-row .when { color: var(--text-4); white-space: nowrap; }

/* ---------- 数据口径 ---------- */
.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rule-card { border: 1px solid var(--border-1); border-radius: var(--r-md); background: var(--bg-card); padding: 12px 14px; }
.rule-card .rk { font-size: 10.5px; color: var(--text-4); letter-spacing: .03em; }
.rule-card .rv { margin-top: 3px; font-size: 13px; font-weight: 600; }
.rule-card .rd { margin-top: 6px; font-size: 11.5px; color: var(--text-4); line-height: 1.6; }
.table.def-table td:first-child { width: 160px; color: var(--text-2); font-weight: 500; }
.table.def-table td { text-align: left; height: auto; padding-top: 9px; padding-bottom: 9px; white-space: normal; line-height: 1.6; }
.flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.flow-node {
  flex: 1; min-width: 140px; border: 1px solid var(--border-1); border-radius: var(--r-sm);
  background: var(--bg-subtle); padding: 9px 10px; font-size: 11px; color: var(--text-3); line-height: 1.5;
}
.flow-node strong { display: block; font-size: 11.5px; color: var(--text-1); margin-bottom: 2px; }
.flow-node.brand { border-color: var(--brand-200); background: var(--brand-50); }
.flow-arrow { display: flex; align-items: center; color: var(--n-400); }
.flow-arrow svg { width: 14px; height: 14px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 86px 1px minmax(0, 1fr); gap: 10px; }
.tl-when { font-size: 11px; color: var(--text-4); text-align: right; padding-top: 1px; }
.tl-line { position: relative; background: var(--border-1); }
.tl-line::before {
  content: ""; position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500);
  box-shadow: 0 0 0 2px var(--bg-card);
}
.timeline-item + .timeline-item { margin-top: 12px; }
.tl-body { padding-bottom: 2px; }
.tl-title { font-size: 12px; font-weight: 600; }
.tl-desc { font-size: 11px; color: var(--text-4); margin-top: 2px; line-height: 1.55; }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--bg-subtle); }
.pending-no { width: 18px; height: 18px; border-radius: 50%; background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); font-size: 10px; font-weight: 600; display: grid; place-items: center; flex: none; }
.pending-main { flex: 1; }
.pending-title { font-size: 11.5px; font-weight: 500; }
.pending-desc { font-size: 10.5px; color: var(--text-4); margin-top: 1px; line-height: 1.5; }

/* ---------- 响应式（仅桌面宽度收敛，无手机端设计） ---------- */
@media (max-width: 1360px) {
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpi-value { font-size: 22px; }
  .g-2-1 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .view { padding: 18px 20px 44px; }
}
@media (max-width: 1220px) {
  :root { --w-sidebar: 196px; }
  .brand-name { font-size: 13px; }
  .user-copy { display: none; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dept-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .compare-grid { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
