/* ═══════════════════════════════════════════════════════════════════
   base.css · 后台原型的结构层（三版共用）
   
   设计原则：**这一层只管结构与尺寸，不管气质。**
   颜色 / 圆角 / 阴影 / 字体 / 密度全部走 CSS 变量，由 theme-*.css 覆盖。
   这样三版原型的 DOM 完全一致 —— 信息架构严格可比，
   且将来接真 API 时只改 app.js 里的数据来源，三版一起受益。
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

/* 数字统一用等宽字体：表格里对不齐的数字是最显眼的粗糙感 */
.num, table td.n, .stat-value, .mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }

a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }

/* ───────────────────────────── 布局 ───────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  transition: grid-template-columns .22s cubic-bezier(.4,0,.2,1);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ── 侧栏 ── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 20;
}
.brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-mark {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: var(--radius-sm);
  background: var(--brand-bg);
  display: grid; place-items: center;
  color: var(--brand-fg);
  font-weight: 700; font-size: 13px;
  letter-spacing: -.5px;
}
.brand-text { min-width: 0; }
.brand-name { font-weight: 650; font-size: 14px; white-space: nowrap; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

.nav { flex: 1 1 auto; overflow-y: auto; padding: 10px 8px 20px; min-height: 0; }
.nav-group-label {
  font-size: 11px; color: var(--text-dim);
  padding: 14px 10px 6px; letter-spacing: .6px;
  text-transform: uppercase; font-weight: 600;
}
.app.collapsed .nav-group-label { opacity: 0; height: 8px; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
  color: var(--text-2);
  white-space: nowrap;
  position: relative;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--nav-hover); color: var(--text); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-fg); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: var(--nav-indicator-w); height: 18px; border-radius: 0 3px 3px 0;
  background: var(--nav-indicator);
}
.app.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.app.collapsed .nav-item span, .app.collapsed .nav-badge, .app.collapsed .brand-text { display: none; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; display: grid; place-items: center; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-item span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: var(--badge-bg); color: var(--badge-fg); flex: 0 0 auto;
}
.nav-badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.nav-item.soon { opacity: .42; cursor: not-allowed; }
.nav-item.soon:hover { background: transparent; }

.sidebar-foot {
  flex: 0 0 auto; padding: 10px var(--pad-x);
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim);
  display: flex; flex-direction: column; gap: 2px;
}
.app.collapsed .sidebar-foot { display: none; }

/* ── 主区 ── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.header {
  height: var(--header-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  backdrop-filter: var(--header-blur);
  z-index: 15;
}
.collapse-btn, .icon-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; color: var(--text-2);
  transition: background .12s, color .12s, border-color .12s;
  position: relative;
}
.icon-btn:hover, .collapse-btn:hover { background: var(--nav-hover); color: var(--text); border-color: var(--border); }
.icon-btn svg, .collapse-btn svg { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 99px; background: var(--danger); border: 1.5px solid var(--bg-header);
}

.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.crumbs .sep { color: var(--text-dim); }
.crumbs .cur { font-weight: 600; }
.crumbs .dim { color: var(--text-dim); }

.header-spacer { flex: 1 1 auto; }

.search {
  position: relative; width: 240px; flex: 0 1 240px;
}
.search input {
  width: 100%; height: 30px; padding: 0 10px 0 30px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); font-size: 12.5px;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-dim); pointer-events: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 9px 4px 4px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--input-bg);
  cursor: pointer; flex: 0 0 auto;
}
.user-chip:hover { border-color: var(--border-strong); }
.avatar {
  width: 24px; height: 24px; border-radius: 99px;
  background: var(--brand-bg); color: var(--brand-fg);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.user-chip .u-name { font-size: 12.5px; font-weight: 600; }
.user-chip .u-role { font-size: 10.5px; color: var(--text-dim); line-height: 1.1; }

/* ── 内容滚动区 ── */
.content { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.page { padding: var(--page-pad); max-width: var(--content-max); margin: 0 auto; }
.page-head { margin-bottom: 18px; display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-title); font-weight: 680; letter-spacing: -.3px; margin: 0 0 3px; }
.page-desc { font-size: 12.5px; color: var(--text-dim); margin: 0; max-width: 680px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ───────────────────────────── 通用组件 ───────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  backdrop-filter: var(--card-blur);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: var(--card-pad-y) var(--card-pad-x);
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13.5px; font-weight: 650; margin: 0; }
.card-sub { font-size: 11.5px; color: var(--text-dim); margin: 1px 0 0; }
.card-head-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.card-body { padding: var(--card-pad-y) var(--card-pad-x); }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: var(--gap); }
.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-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1400px) { .g-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1150px) { .g-3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }

/* ── 统计卡 ── */
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: var(--stat-pad); position: relative; overflow: hidden;
  backdrop-filter: var(--card-blur);
}
.stat-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.stat-label { font-size: 12px; color: var(--text-dim); font-weight: 550; }
.stat-icon { width: 24px; height: 24px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: 0 0 24px; }
.stat-icon svg { width: 13px; height: 13px; }
.stat-icon.a1 { background: var(--c1-bg); color: var(--c1-fg); }
.stat-icon.a2 { background: var(--c2-bg); color: var(--c2-fg); }
.stat-icon.a3 { background: var(--c3-bg); color: var(--c3-fg); }
.stat-icon.a4 { background: var(--c4-bg); color: var(--c4-fg); }
.stat-icon.a5 { background: var(--c5-bg); color: var(--c5-fg); }
.stat-value { font-size: var(--fs-stat); font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.stat-value .unit { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-left: 3px; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--text-dim); flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 11.5px; }
.delta svg { width: 11px; height: 11px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--text-dim); }
.stat-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 30px; opacity: var(--spark-opacity); pointer-events: none; }
.stat-spark svg { width: 100%; height: 100%; display: block; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--btn-h); padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--text);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--btn-hover); border-color: var(--border-focus); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: var(--accent-shadow); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.btn.danger:hover { background: var(--danger-bg-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--nav-hover); color: var(--text); border-color: transparent; }
.btn.sm { height: calc(var(--btn-h) - 4px); padding: 0 9px; font-size: 12px; }
.btn.sm svg { width: 12.5px; height: 12.5px; }
.btn.xs { height: calc(var(--btn-h) - 7px); padding: 0 7px; font-size: 11.5px; }
.btn.xs svg { width: 11.5px; height: 11.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); z-index: 1; }

/* ── 表单 ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11px; color: var(--text-dim); }
.input, .select, textarea.input {
  height: var(--btn-h); padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text);
  font-size: 12.5px; font-family: inherit; outline: none; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 68px; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; }
.toolbar .grow { flex: 1 1 auto; }

.switch { position: relative; width: 36px; height: 20px; flex: 0 0 36px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--switch-off); transition: background .16s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: transform .16s; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(16px); }

/* ── 标签 / 徽章 ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 7px; border-radius: var(--badge-radius);
  font-size: 11px; font-weight: 650; white-space: nowrap;
  background: var(--badge-bg); color: var(--badge-fg);
}
.badge .bdot { width: 5px; height: 5px; border-radius: 99px; background: currentColor; flex: 0 0 5px; }
.badge.ok      { background: var(--ok-bg);    color: var(--ok-fg); }
.badge.warn    { background: var(--warn-bg);  color: var(--warn-fg); }
.badge.danger  { background: var(--danger-bg-2); color: var(--danger-fg); }
.badge.info    { background: var(--info-bg);  color: var(--info-fg); }
.badge.muted   { background: var(--muted-bg); color: var(--muted-fg); }
.badge.accent  { background: var(--accent-soft); color: var(--accent); }

.tag {
  display: inline-flex; align-items: center; padding: 1px 6px;
  border-radius: var(--radius-xs); font-size: 10.5px; font-weight: 600;
  background: var(--muted-bg); color: var(--muted-fg); border: 1px solid var(--border);
}
.tag.src-rule { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text-dim);
  padding: var(--th-pad); background: var(--th-bg);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--text); }
table.tbl th .sort-ind { display: inline-block; margin-left: 3px; opacity: .35; font-size: 9px; }
table.tbl th.sorted .sort-ind { opacity: 1; color: var(--accent); }
table.tbl td { padding: var(--td-pad); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--row-hover); }
table.tbl tbody tr.selected { background: var(--row-selected); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl .row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
table.tbl tbody tr:hover .row-actions { opacity: 1; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 11px; color: var(--text-dim); }
.code-cell { font-family: var(--font-num); font-size: 12px; letter-spacing: .2px; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.checkbox { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }

/* ── 分页 ── */
.pager { display: flex; align-items: center; gap: 7px; padding: 11px var(--card-pad-x); border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .info { font-size: 11.5px; color: var(--text-dim); }
.pager .spacer { flex: 1 1 auto; }
.pager .pbtn {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--btn-bg); color: var(--text-2);
  font-size: 12px; cursor: pointer; font-family: var(--font-num);
}
.pager .pbtn:hover { border-color: var(--border-focus); color: var(--text); }
.pager .pbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 700; }
.pager .pbtn[disabled] { opacity: .4; cursor: not-allowed; }

/* ── 批量操作条 ── */
.bulkbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--card-pad-x); background: var(--accent-soft);
  border-bottom: 1px solid var(--border); font-size: 12.5px;
  animation: slideDown .18s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bulkbar .n { font-weight: 700; color: var(--accent); }

/* ── 进度条 ── */
.bar { height: var(--bar-h); border-radius: 99px; background: var(--bar-track); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s cubic-bezier(.4,0,.2,1); }
.bar.ok > i { background: var(--up); }
.bar.warn > i { background: var(--warn-solid); }
.bar.danger > i { background: var(--danger); }
.bar-row { display: flex; align-items: center; gap: 9px; }
.bar-row .bar { flex: 1 1 auto; }
.bar-row .bar-val { font-size: 11.5px; font-weight: 650; min-width: 64px; text-align: right; color: var(--text-2); }

/* ── 图表 ── */
.chart { width: 100%; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2px; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 40;
  background: var(--tip-bg); color: var(--tip-fg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
  padding: 6px 9px; font-size: 11.5px; box-shadow: var(--shadow-2);
  white-space: nowrap; transform: translate(-50%, -120%);
  opacity: 0; transition: opacity .1s;
}
.chart-tip.on { opacity: 1; }
.chart-tip .tt { font-weight: 700; margin-bottom: 3px; font-family: var(--font-num); }
.chart-tip .tr { display: flex; align-items: center; gap: 6px; font-family: var(--font-num); }
.chart-tip .tr .sw { width: 7px; height: 7px; border-radius: 2px; }
.chart-host { position: relative; }

/* ── 模态 / 抽屉 ── */
.overlay {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: grid; place-items: center; padding: 24px;
  animation: fade .14s ease;
}
.overlay.right { place-items: stretch; justify-content: flex-end; padding: 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-modal); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-modal);
  width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2,.9,.3,1.1);
  backdrop-filter: var(--card-blur);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(820px, 100%); }
.drawer {
  background: var(--bg-modal); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-modal); width: min(600px, 100%);
  height: 100%; display: flex; flex-direction: column;
  animation: slideIn .2s cubic-bezier(.2,.9,.3,1);
  backdrop-filter: var(--card-blur);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head, .drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--card-pad-x); border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.modal-head h3, .drawer-head h3 { margin: 0; font-size: 14.5px; font-weight: 670; }
.modal-head .sub { font-size: 11.5px; color: var(--text-dim); margin: 1px 0 0; }
.modal-body, .drawer-body { padding: var(--card-pad-x); overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot, .drawer-foot {
  padding: 12px var(--card-pad-x); border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex: 0 0 auto; background: var(--bg-modal-foot);
}
.close-x { margin-left: auto; }

/* ── 描述列表 ── */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 12.5px; align-items: baseline; }
.dl dt { color: var(--text-dim); white-space: nowrap; }
.dl dd { margin: 0; font-weight: 550; word-break: break-all; }
.dl.wide { grid-template-columns: 132px 1fr; }
.dl .full { grid-column: 1 / -1; }

/* ── 提示条 ── */
.notice {
  display: flex; gap: 9px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.6;
  background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border);
}
.notice svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.notice.danger { background: var(--danger-bg-2); color: var(--danger-text); border-color: var(--danger-border); }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }

/* ── 空状态 ── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); }
.empty svg { width: 38px; height: 38px; opacity: .4; margin-bottom: 10px; }
.empty .t { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.empty .d { font-size: 12px; }

/* ── 骨架屏 ── */
.skel { background: var(--skel); border-radius: var(--radius-xs); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ── Toast ── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: var(--bg-modal); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-modal);
  padding: 10px 13px; font-size: 12.5px; min-width: 220px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .2s cubic-bezier(.2,.9,.3,1.1); pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .16s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
.toast .ti { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.toast.ok .ti { color: var(--up); }
.toast.err .ti { color: var(--danger); }
.toast.info .ti { color: var(--accent); }
.toast .tt { font-weight: 650; margin-bottom: 1px; }
.toast .td { color: var(--text-dim); font-size: 11.5px; }

/* ── 抽屉内的 tab ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 var(--card-pad-x); flex: 0 0 auto; overflow-x: auto; }
.tab {
  padding: 9px 11px; font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ── 时间线 ── */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px;
  border-radius: 99px; background: var(--bg-card); border: 2px solid var(--border-strong);
}
.tl-item.ok::before { border-color: var(--up); }
.tl-item.err::before { border-color: var(--danger); }
.tl-item.warn::before { border-color: var(--warn-solid); }
.tl-time { font-size: 11px; color: var(--text-dim); font-family: var(--font-num); }
.tl-title { font-size: 12.5px; font-weight: 600; }
.tl-desc { font-size: 11.5px; color: var(--text-dim); }

/* ── 工具类 ── */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.center { justify-content: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; } .mb-6 { margin-bottom: 6px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; } .mb-18 { margin-bottom: 18px; }
.dim { color: var(--text-dim); }
.dim2 { color: var(--text-2); }
.sm { font-size: 11.5px; }
.xs { font-size: 11px; }
.bold { font-weight: 650; }
.nowrap { white-space: nowrap; }
.flex1 { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

/* 原型水印：明确告知这是仿真数据，避免误当真实后台 */
.proto-flag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  background: var(--warn-bg); color: var(--warn-fg); letter-spacing: .3px;
}
