/* =============================================================================
 * 医保网络安全审计一张图 · 设计系统
 * 主题：深空蓝（大屏可视化）+ 指挥中心风格
 * ========================================================================== */

/* ---------------- Design Tokens ---------------- */
:root {
  --bg-0: #040d1d;
  --bg-1: #071830;
  --bg-2: #0a2038;
  --panel: linear-gradient(160deg, rgba(19, 52, 92, .88), rgba(10, 28, 54, .90));
  --panel-solid: #0d2545;
  --line: #1d4d7a;
  --line-2: #275c8d;
  --grid: rgba(76, 201, 240, .08);

  --cyan: #4cc9f0;
  --cyan-dim: #7fb6d9;
  --teal: #2ec4b6;
  --amber: #ffd166;
  --red: #ef476f;
  --blue: #4361ee;
  --purple: #9b5de5;
  --green: #06d6a0;

  --text: #eaf6ff;
  --text-2: #a8c8e6;
  --text-3: #8fb3d9;
  --text-4: #6d8fb3;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
  --glow: 0 0 18px rgba(76, 201, 240, .45);

  --header-h: 64px;
  --nav-h: 44px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------------- Reset ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1400px 800px at 50% -12%, #0c2a4d 0%, #071830 46%, #040d1d 100%) fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(8, 24, 48, .6); }
::-webkit-scrollbar-thumb { background: #275c8d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a7cb8; }

/* ---------------- 布局容器 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(7, 24, 48, .98), rgba(7, 24, 48, .86));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(150deg, #0f6d9c, #4cc9f0 70%, #2ec4b6);
  display: grid; place-items: center; box-shadow: var(--glow);
  flex: 0 0 auto;
}
.brand .mark svg { width: 22px; height: 22px; }
.brand .txt b { display: block; font-size: 17px; letter-spacing: 2px; color: var(--text); line-height: 1.2; }
.brand .txt small { display: block; font-size: 10.5px; letter-spacing: 2.5px; color: var(--text-4); }

.topnav { display: flex; align-items: center; gap: 2px; margin-left: 8px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 8px 11px; border-radius: var(--radius-sm); font-size: 13.5px;
  color: var(--text-3); white-space: nowrap; transition: .18s;
  display: flex; align-items: center; gap: 5px; flex: 0 0 auto;
}
.topnav a:hover { background: rgba(76, 201, 240, .10); color: var(--text); text-decoration: none; }
.topnav a.on { background: linear-gradient(180deg, #164a7a, #0f3a63); color: #eaf6ff; box-shadow: inset 0 -2px 0 var(--cyan); }

.topbar .right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; font-size: 13px; color: var(--text-3); }
.clock { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.clock .date { color: var(--text-4); margin-right: 6px; }
@media (max-width: 1879px) {
  .clock .date { display: none; }
  .brand .txt small { display: none; }
  .topnav a { padding: 7px 8px; font-size: 13px; gap: 4px; }
}
@media (max-width: 1480px) {
  .topnav a { padding: 7px 6px; font-size: 12.5px; gap: 3px; }
  .topnav a > span { display: none; }
  .brand .txt b { font-size: 15px; letter-spacing: 1px; }
  #btn-fullscreen { display: none; }
}
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 时间窗切换 */
.tabs { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tabs button {
  padding: 5px 13px; background: transparent; border: 0; color: var(--text-3); font-size: 13px; transition: .15s;
}
.tabs button:hover { background: rgba(76, 201, 240, .10); color: var(--text); }
.tabs button.on { background: #164a7a; color: var(--text); }

/* 页面主体 */
.main { flex: 1; padding: 16px 20px 24px; max-width: 1920px; width: 100%; margin: 0 auto; }

/* 页头 */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead h1 { font-size: 23px; letter-spacing: 1.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.pagehead h1::before { content: ""; width: 4px; height: 21px; border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--teal)); }
.pagehead .desc { color: var(--text-3); font-size: 13px; margin-top: 5px; }
.pagehead .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- 面板 ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
}
.panel > h3, .panel > .phead {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; letter-spacing: .5px; flex: 0 0 auto;
}
.panel > h3::before, .panel > .phead::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--teal)); margin-right: -4px;
}
.phead .t { display: flex; align-items: center; gap: 8px; }
.phead .t::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--teal)); }
.panel .more { font-size: 12px; color: var(--text-4); font-weight: 400; letter-spacing: 0; }
.panel .more:hover { color: var(--cyan); }
.panel-accent { border-color: var(--line-2); box-shadow: inset 0 1px 0 rgba(76, 201, 240, .15); }

/* 网格 */
.grid { display: grid; gap: 14px; }
.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-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mt { margin-top: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ---------------- KPI 卡片 ---------------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 13px; position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: block; color: inherit;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); text-decoration: none; }
.kpi .bar { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--cyan); border-radius: var(--radius) var(--radius) 0 0; }
.kpi .bar.teal { background: var(--teal); } .kpi .bar.amber { background: var(--amber); }
.kpi .bar.red { background: var(--red); } .kpi .bar.purple { background: var(--purple); } .kpi .bar.blue { background: var(--blue); }
.kpi .label { font-size: 14px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .num { font-size: 31px; font-weight: 700; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.5px; }
.kpi .num small { font-size: 14px; font-weight: 400; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi .sub { font-size: 12.5px; color: var(--cyan-dim); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub.ok { color: var(--teal); } .kpi .sub.warn { color: var(--amber); } .kpi .sub.bad { color: var(--red); }
.kpi .scope { font-size: 11px; color: var(--text-4); margin-top: 2px; }

/* 统计数字块 */
.stats { display: grid; gap: 10px; }
.stat { background: rgba(10, 32, 56, .55); border: 1px solid rgba(29, 77, 122, .6); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------------- 图表通用 ---------------- */
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.legend .item { display: flex; align-items: center; gap: 7px; }
.legend .item .v { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.ok, .dot.on { background: var(--teal); box-shadow: 0 0 6px var(--teal); }
.dot.off { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot.warn { background: var(--amber); }
.dot.idle { background: var(--text-4); }

/* 进度条 */
.bar-row { display: grid; grid-template-columns: 96px 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row .name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .cnt { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.bar-track { height: 8px; border-radius: 4px; background: rgba(76, 201, 240, .10); overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1b6fa8, var(--cyan)); transition: width .6s ease; }
.bar-fill.teal { background: linear-gradient(90deg, #127a72, var(--teal)); }
.bar-fill.amber { background: linear-gradient(90deg, #a87c1b, var(--amber)); }
.bar-fill.red { background: linear-gradient(90deg, #a82a4a, var(--red)); }
.bar-fill.purple { background: linear-gradient(90deg, #5a2a9c, var(--purple)); }

/* 迷你图 */
.sparkline { width: 100%; display: block; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut .center-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center-txt .n { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut .center-txt .l { font-size: 11.5px; color: var(--text-3); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; flex: 1; min-height: 0; max-height: 560px; width: 100%; }
table.tbl td, table.tbl th { overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
table.tbl td.wrap { white-space: normal; min-width: 200px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  position: sticky; top: 0; z-index: 1;
  background: #0e2c4f; color: var(--text-3); font-weight: 500;
  text-align: left; padding: 9px 10px; white-space: nowrap;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
table.tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(29, 77, 122, .45); color: var(--text-2); white-space: nowrap; }
table.tbl tbody tr { transition: background .15s; }
table.tbl tbody tr:hover { background: rgba(76, 201, 240, .07); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
table.tbl .strong { color: var(--text); font-weight: 600; }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.7;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.high { color: #ffd7e0; background: rgba(239, 71, 111, .18); border-color: rgba(239, 71, 111, .5); }
.badge.mid  { color: #ffeec2; background: rgba(255, 209, 102, .16); border-color: rgba(255, 209, 102, .45); }
.badge.low  { color: #cdefff; background: rgba(76, 201, 240, .16); border-color: rgba(76, 201, 240, .4); }
.badge.ok   { color: #c6ffee; background: rgba(46, 196, 182, .16); border-color: rgba(46, 196, 182, .45); }
.badge.warn { color: #ffeec2; background: rgba(255, 209, 102, .16); border-color: rgba(255, 209, 102, .45); }
.badge.off  { color: #ffd7e0; background: rgba(239, 71, 111, .18); border-color: rgba(239, 71, 111, .5); }
.badge.info { color: #d9e6ff; background: rgba(67, 97, 238, .2); border-color: rgba(67, 97, 238, .5); }
.badge.mute { color: var(--text-4); background: rgba(140, 170, 200, .12); border-color: rgba(140, 170, 200, .3); }

/* ---------------- 表单控件 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px;
  background: rgba(76, 201, 240, .12); color: var(--text); border: 1px solid var(--line-2);
  transition: .18s; white-space: nowrap;
}
.btn:hover { background: rgba(76, 201, 240, .22); border-color: var(--cyan); }
.btn.primary { background: linear-gradient(180deg, #1b7fc0, #15659b); border-color: #2589c9; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-3); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); background: rgba(76, 201, 240, .08); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.on { background: #164a7a; border-color: var(--cyan); color: var(--text); }

.field {
  display: flex; align-items: center; gap: 8px;
  background: rgba(8, 28, 52, .8); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 5px 11px; transition: border-color .18s;
}
.field:focus-within { border-color: var(--cyan); }
.field input, .field select {
  background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; min-width: 120px;
}
.field input::placeholder { color: var(--text-4); }
.field select { cursor: pointer; }
.field select option { background: #0d2545; color: var(--text); }
.field .ico { color: var(--text-4); font-size: 13px; }

/* 分段筛选 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 5px 12px; background: transparent; border: 0; color: var(--text-3); font-size: 12.5px; transition: .15s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: rgba(76, 201, 240, .1); color: var(--text); }
.seg button.on { background: #164a7a; color: var(--text); }

/* ---------------- 链路状态 ---------------- */
.link-group { margin-bottom: 10px; }
.link-group:last-child { margin-bottom: 0; }
.g-title {
  font-size: 12px; color: var(--cyan); letter-spacing: .5px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.g-title::before { content: ""; width: 12px; height: 1px; background: var(--cyan); opacity: .7; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
  transition: background .15s;
}
.link-row:hover { background: rgba(76, 201, 240, .08); }
.link-row .state { display: flex; gap: 12px; font-size: 12.5px; }
.link-row .state span { display: inline-flex; align-items: center; gap: 5px; }

/* 进度概览条 */
.meter { height: 6px; border-radius: 3px; background: rgba(76, 201, 240, .12); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--teal), var(--cyan)); transition: width .6s; }

/* ---------------- 提示 / 空状态 ---------------- */
.note {
  font-size: 12px; color: var(--text-3); line-height: 1.75;
  background: rgba(76, 201, 240, .06); border-left: 2px solid var(--cyan);
  padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note b { color: var(--text); font-weight: 600; }
.empty { padding: 26px; text-align: center; color: var(--text-4); font-size: 13px; }

/* 口径说明列表 */
.caliber { display: grid; gap: 6px; font-size: 12px; color: var(--text-3); }
.caliber div { display: flex; gap: 8px; }
.caliber .k { color: var(--cyan-dim); flex: 0 0 auto; }
.caliber .k::after { content: "："; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 500; display: none;
  background: rgba(2, 8, 18, .72); backdrop-filter: blur(4px);
  padding: 40px 20px; overflow: auto;
}
.modal-mask.show { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  width: min(980px, 100%); background: #0a1f3a; border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow); animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-14px); } }
.modal .mhead {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal .mhead h4 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.modal .mhead .x { background: transparent; border: 0; color: var(--text-3); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal .mhead .x:hover { background: rgba(239, 71, 111, .18); color: var(--red); }
.modal .mbody { padding: 18px; }
.modal .mfoot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; font-size: 13px; }
.kv > div { display: flex; gap: 8px; }
.kv .k { color: var(--text-3); flex: 0 0 92px; }
.kv .v { color: var(--text); }

/* 时间线（处置流程） */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline .ti { position: relative; padding: 0 0 14px; font-size: 13px; }
.timeline .ti:last-child { padding-bottom: 0; }
.timeline .ti::before {
  content: ""; position: absolute; left: -21px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 0 3px rgba(76, 201, 240, .18);
}
.timeline .ti b { color: var(--text); display: block; margin-bottom: 2px; }
.timeline .ti span { color: var(--text-3); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: #123a63; border: 1px solid var(--line-2); color: var(--text);
  padding: 9px 18px; border-radius: 999px; font-size: 13px; z-index: 900;
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 页脚 ---------------- */
.footer {
  margin-top: auto; padding: 14px 22px; font-size: 12px; color: var(--text-4);
  border-top: 1px solid rgba(29, 77, 122, .5);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
body.screen .footer, body.screen .footer * { display: none !important; }

/* ---------------- 大屏模式（1920×1080 无滚动） ---------------- */
body.screen {
  width: 1920px; height: 1080px; min-height: 1080px; overflow: hidden;
  transform-origin: top left;
}
body.screen .app { height: 1080px; display: block; }
body.screen .topbar { height: 58px; }
body.screen .main {
  height: calc(1080px - 58px); padding: 12px 20px 14px; max-width: none;
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
/* 关键：flex 纵向子项允许收缩，否则内容会撑破 1080px 大屏 */
body.screen .main > * { min-height: 0; flex-shrink: 1; }
body.screen .kpis { flex: 0 0 auto; }
body.screen .kpi { padding: 12px 15px 11px; }
body.screen .kpi .num { font-size: 30px; }
body.screen .panel { padding: 11px 14px; }
body.screen .panel > h3, body.screen .panel > .phead { margin-bottom: 9px; font-size: 14px; }
body.screen .stat { padding: 7px 10px; }
body.screen .stat .v { font-size: 21px; }
body.screen .note { font-size: 11.5px; padding: 6px 10px; line-height: 1.6; }
body.screen table.tbl { font-size: 12.5px; }
body.screen table.tbl th { padding: 6px 9px; }
body.screen table.tbl td { padding: 5px 9px; }
body.screen .bar-row { margin-bottom: 4px; font-size: 12px; line-height: 18px; }
body.screen .bar-row .name { font-size: 11.5px; }
body.screen .bar-track { height: 7px; }
body.screen .stat .k { font-size: 11.5px; }
body.screen .stats { gap: 8px; }
body.screen .legend { font-size: 12px; }
body.screen .footer { display: none; }

/* 大屏主栅格：左中右 + 底部 */
.screen-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; gap: 12px;
  grid-template-columns: 356px minmax(0, 1fr) 384px;
  grid-template-rows: minmax(0, 1fr) 216px;
}
.screen-grid .col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.screen-grid .col > .panel { flex: 1 1 0; min-height: 0; }
/* 中列内部两行 */
.screen-grid .col.mid > .split {
  flex: 1 1 0; min-height: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px;
}
.screen-grid .col.mid > .split > .panel { min-height: 0; }
.screen-grid .row-bottom { grid-column: 1 / -1; display: grid; grid-template-columns: 292px minmax(0, 1fr) minmax(0, 1.02fr); gap: 12px; min-height: 0; }
.screen-grid .row-bottom > .panel { min-height: 0; }
/* 面板内的滚动区必须可收缩（表头之前用 .table-wrap 包裹） */
.screen-grid .panel > div[id$="table"] { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.screen-grid .panel > div[id$="table"] > .table-wrap { flex: 1 1 0; min-height: 0; }

/* 滚动区域 */
.scroll-y { overflow-y: auto; min-height: 0; flex: 1; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1600px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .topnav { order: 3; width: 100%; flex: 1 1 100%; }
  .main { padding: 12px; }
  .kpis, .g-2, .g-3, .g-4, .g-6 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .donut-wrap { flex-direction: column; }
  .kv { grid-template-columns: minmax(0, 1fr); }
}

/* 打印 */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .footer, .tools { display: none; }
}
