/* ==========================================================================
   晓柚监控 · 前端 Demo 样式
   依据《晓柚 CRM 运营端 · 界面设计规范（交付版）v1.4》
   - 品牌橙 #fd9026 / 操作蓝 #1677ff / 危险红 #f5222d
   - 控件 32px / 表头 48px 灰底 / 字号仅 10·12·14·16·18·20 / 圆角 2·4·8
   - 内容区底色 #f5f8fa / 卡片白底 4px 圆角 + shadow-sm
   ========================================================================== */

:root {
  --brand: #fd9026;
  --brand-1: #fd9b3a;
  --brand-2: #fda650;
  --brand-6: #fed3a7;
  --brand-9: #fff4e9;
  --brand-alpha: rgba(253, 144, 38, .1);

  --text: #333;
  --text-2: #666;
  --text-3: #999;
  --text-4: #c0c4cc;

  --bg-page: #f5f8fa;
  --bg-subtle: #fafafa;
  --bg-inset: #f9f9f9;
  --surface: #fff;

  --border: #dcdfe6;
  --border-light: #ebeef5;

  --head-bg: #2c2920;
  --head-h: 64px;
  --aside-w: 224px;

  --success: #52a41f;
  --success-soft: #f0f9eb;
  --warning: #d98b12;
  --warning-soft: #fdf6ec;
  --danger: #f5222d;
  --danger-soft: #fef0f0;
  --info: #6b7280;
  --info-soft: #f4f5f7;
  --link: #1677ff;
  --link-soft: #e8f3ff;

  --r-sm: 2px;
  --r: 4px;
  --r-lg: 8px;
  --shadow-sm: 0 0 10px #f0f2f7;
  --shadow-md: 0 2px 10px rgba(0, 0, 0, .12);

  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;

  --ease: cubic-bezier(.645, .045, .355, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; font-size: 14px; }
a { color: var(--link); text-decoration: none; }
code, .mono { font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; }
.hidden { display: none !important; }

/* ── 登录 ───────────────────────────────────────────── */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 480px at 50% -120px, #fff1e2 0%, rgba(255, 241, 226, 0) 70%),
    var(--bg-page);
  padding: 32px 16px;
}

.login-card {
  width: 400px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.login-brand { display: flex; align-items: center; gap: 12px; }
.login-mark {
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--brand); color: #fff;
  font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 18px; line-height: 24px; font-weight: 600; }
.login-sub { font-size: 12px; line-height: 18px; color: var(--text-3); margin-top: 2px; }
.login-form { margin-top: 24px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; line-height: 18px; color: var(--text-2); margin-bottom: 6px; }
.login-field input { width: 100%; }
.login-field input.is-error { border-color: var(--danger); }
.login-error {
  margin-top: 4px;
  font-size: 12px;
  line-height: 18px;
  color: var(--danger);
  min-height: 0;
}
.login-error:empty { display: none; }
.login-btn { width: 100%; height: 36px; margin-top: 8px; }
.login-switch {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.login-switch-title { font-size: 12px; line-height: 18px; color: var(--text-3); margin-bottom: 8px; }
.login-acc {
  padding: 8px 10px; border-radius: var(--r); cursor: pointer;
  transition: background .2s var(--ease);
}
.login-acc:hover { background: var(--bg-subtle); }
.login-acc + .login-acc { margin-top: 2px; }
.la-top { display: flex; align-items: center; gap: 8px; }
.la-top b { font-weight: 500; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.la-role {
  height: 18px; line-height: 18px; padding: 0 6px; border-radius: var(--r-sm);
  background: var(--brand-9); color: var(--brand); font-size: 12px;
}
.la-fill { margin-left: auto; font-size: 12px; color: var(--link); opacity: 0; transition: opacity .2s var(--ease); }
.login-acc:hover .la-fill { opacity: 1; }
.la-note { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.login-tip {
  margin-top: 16px; padding: 8px 12px;
  background: var(--bg-inset); border-radius: var(--r);
  font-size: 12px; line-height: 18px; color: var(--text-3);
}
.login-foot { margin-top: 16px; text-align: center; font-size: 10px; color: var(--text-4); letter-spacing: .2px; }

/* ── 顶栏 ───────────────────────────────────────────── */
.app-view { min-height: 100vh; background: var(--bg-page); }

.topbar {
  height: var(--head-h);
  background: var(--head-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
}
.brand-text { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: .3px; }
.brand-sub {
  font-size: 12px; line-height: 18px; color: rgba(255, 255, 255, .55);
  padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .18);
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.pulse-chip {
  display: flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px; color: rgba(255, 255, 255, .78);
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #67c23a; box-shadow: 0 0 0 3px rgba(103, 194, 58, .18); }
.topbar-divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .14); }
.account-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(255, 255, 255, .85); }
.account-chip .acc-phone { font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.role-pill {
  height: 20px; line-height: 20px; padding: 0 8px; border-radius: var(--r-sm);
  background: rgba(253, 144, 38, .18); color: #ffc78f; font-size: 12px;
}
.topbar-logout {
  color: rgba(255, 255, 255, .6); cursor: pointer; padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .14); transition: color .2s var(--ease);
}
.topbar-logout:hover { color: #fff; }

/* ── 侧边 ───────────────────────────────────────────── */
.shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--head-h)); }

.side {
  width: var(--aside-w);
  flex: 0 0 var(--aside-w);
  align-self: stretch;
  background: var(--surface);
  box-shadow: 1px 0 4px rgba(0, 0, 0, .05);
  padding: 12px 12px 32px;
  position: sticky;
  top: var(--head-h);
  height: calc(100vh - var(--head-h));
  overflow-y: auto;
  z-index: 99;
}
.side::-webkit-scrollbar { width: 0; height: 0; }
.side-group-title {
  font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-3);
  padding: 0 12px; margin: 16px 0 8px;
}
.side-group:first-child .side-group-title { margin-top: 4px; }
.side-item {
  height: 32px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 12px; margin-bottom: 2px;
  border-radius: var(--r); cursor: pointer; color: var(--text);
  transition: background .2s var(--ease), color .2s var(--ease);
  user-select: none;
}
.side-item:hover { background: var(--bg-subtle); color: var(--brand); }
.side-item.active { background: var(--brand-9); color: var(--brand); font-weight: 500; }
.side-item .ico { width: 16px; height: 16px; flex: none; opacity: .75; }
.side-item.active .ico { opacity: 1; }
.side-item-label { flex: 1; }
.side-badge {
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; text-align: center; font-weight: 500;
}
.side-item.active .side-badge { background: var(--danger); color: #fff; }
.side-foot {
  margin: 24px 12px 0; padding-top: 12px; border-top: 1px solid var(--border-light);
  font-size: 10px; line-height: 16px; color: var(--text-4);
}

.main {
  flex: 1;
  min-width: 1180px;
  padding: 16px;
  background: var(--bg-page);
}

/* ── 页面头 ─────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.page-head h1 { font-size: 20px; line-height: 28px; font-weight: 600; }
.page-head .sub { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.crumb { font-size: 12px; line-height: 18px; color: var(--text-3); margin-bottom: 4px; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--link); }

/* ── 卡片 ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-title { font-size: 14px; line-height: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .legend { font-weight: 400; font-size: 12px; color: var(--text-3); }
.card-extra { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.card-sub { margin-top: 8px; font-size: 12px; line-height: 18px; color: var(--text-3); }

.grid { display: grid; gap: 16px; align-items: start; }
.grid-8-4 { grid-template-columns: minmax(0, 1fr) 360px; }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ── 播报条 ─────────────────────────────────────────── */
.command-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-left: 3px solid var(--danger);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.command-bar.is-ok { border-left-color: var(--success); }
.command-bar.is-warn { border-left-color: var(--warning); }
.cb-tag {
  flex: none; height: 22px; line-height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 500;
}
.command-bar.is-ok .cb-tag { background: var(--success-soft); color: var(--success); }
.command-bar.is-warn .cb-tag { background: var(--warning-soft); color: var(--warning); }
.cb-text { flex: 1; min-width: 0; }
.cb-line1 { font-size: 14px; line-height: 20px; color: var(--text); }
.cb-line1 b { font-weight: 600; }
.cb-line1 .sep { color: #d9dde3; margin: 0 10px; }
.cb-line1 .dim { color: var(--text-2); font-weight: 400; }
.cb-line2 { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.cb-line2 b { color: var(--danger); font-weight: 500; }
.cb-link { flex: none; font-size: 12px; color: var(--link); cursor: pointer; white-space: nowrap; }
.cb-link:hover { text-decoration: underline; }

/* ── KPI ────────────────────────────────────────────── */
.kpi {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm);
  padding: 12px 16px; cursor: pointer; position: relative;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
  border: 1px solid transparent;
}
.kpi:hover { box-shadow: var(--shadow-md); }
.kpi.is-active { border-color: var(--brand-6); box-shadow: 0 0 0 1px var(--brand-6); }
.kpi-label { font-size: 12px; line-height: 18px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-val { margin-top: 4px; font-size: 20px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.kpi-foot { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.k-down .kpi-val { color: var(--danger); }
.kpi.k-deg .kpi-val { color: var(--warning); }
.kpi.k-blind .kpi-val { color: var(--info); }
.kpi.k-ok .kpi-val { color: var(--success); }

/* ── 状态标签 / 圆点 ─────────────────────────────────── */
.st {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px; border-radius: var(--r-sm);
  font-size: 12px; line-height: 20px; white-space: nowrap;
}
.st-down { background: var(--danger-soft); color: var(--danger); }
.st-degraded { background: var(--warning-soft); color: var(--warning); }
.st-blind { background: var(--info-soft); color: var(--info); }
.st-healthy { background: var(--success-soft); color: var(--success); }
.st-recovering { background: var(--link-soft); color: var(--link); }
.st-unknown { background: var(--info-soft); color: var(--text-3); }
.st-plain { background: var(--info-soft); color: var(--text-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot-down { background: var(--danger); box-shadow: 0 0 0 3px rgba(245, 34, 45, .12); }
.dot-degraded { background: var(--warning); box-shadow: 0 0 0 3px rgba(217, 139, 18, .12); }
.dot-blind { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, .14); }
.dot-healthy { background: var(--success); box-shadow: 0 0 0 3px rgba(82, 164, 31, .12); }
.dot-recovering { background: var(--link); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.dot-unknown { background: var(--text-4); }
.dot-sm { width: 6px; height: 6px; box-shadow: none !important; }

.level {
  display: inline-block; height: 18px; line-height: 18px; padding: 0 5px;
  border-radius: var(--r-sm); font-size: 10px; font-weight: 600; letter-spacing: .3px;
}
.level-p0 { background: #7a0916; color: #fff; }
.level-p1 { background: var(--danger-soft); color: var(--danger); }
.level-p2 { background: var(--warning-soft); color: var(--warning); }
.level-p3 { background: var(--info-soft); color: var(--info); }

/* ── 表格 ───────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th {
  height: 40px; padding: 0 12px; background: var(--bg-subtle);
  font-size: 12px; font-weight: 700; color: var(--text);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
}
.tbl th:first-child { border-top-left-radius: var(--r); }
.tbl th:last-child { border-top-right-radius: var(--r); }
.tbl td {
  height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; font-size: 14px; line-height: 20px;
  overflow: hidden; text-overflow: ellipsis;
}
.tbl.tbl-compact td { height: 40px; padding: 6px 10px; font-size: 12px; }
.tbl.tbl-log td { height: 62px; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.row-click { cursor: pointer; }
.tbl tbody tr.row-click:hover td { background: #fafcff; }
.tbl tr.row-down td { background: #fffafa; }
.tbl tr.row-down:hover td { background: #fff5f5; }
.tbl tr.row-degraded td { background: #fffdf7; }
.tbl tr.row-blind td { background: #fbfbfc; }
.tbl .c { text-align: center; }
.tbl .r { text-align: right; }
.tbl-empty { text-align: center; color: var(--text-3); padding: 40px 0 !important; }

.cell-node .n1 { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-node .n2 { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); display: flex; gap: 8px; white-space: nowrap; overflow: hidden; }
.cell-node .n2 span { overflow: hidden; text-overflow: ellipsis; }
.cell-node .n2 .node-id { color: var(--text-3); flex: none; }
.cell-node .n2 .endpoint { color: var(--text-3); font-family: "SFMono-Regular", Menlo, monospace; }

.cell-root .r1 { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-root .r2 { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); font-family: "SFMono-Regular", Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-root .r1.is-bad { color: var(--danger); }
.cell-root .r1.is-warn { color: var(--warning); }

.dur { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dur.is-bad { color: var(--danger); }
.dur.is-warn { color: var(--warning); }
.dur.is-mute { color: var(--text-3); font-weight: 400; }

.tiny { font-size: 12px; line-height: 18px; color: var(--text-3); }
.tiny-bad { font-size: 12px; line-height: 18px; color: var(--danger); }
.num { font-variant-numeric: tabular-nums; }

.op-link {
  color: var(--link); cursor: pointer; font-size: 12px; white-space: nowrap;
}
.op-link:hover { text-decoration: underline; }
.op-link + .op-link { margin-left: 12px; }
.op-link.is-danger { color: var(--danger); }
.op-link.is-muted { color: var(--text-3); cursor: default; }
.op-link .arrow { font-size: 10px; margin-left: 1px; }

/* 分段筛选 */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--bg-inset); border-radius: var(--r); }
.seg button {
  height: 26px; padding: 0 10px; border: none; background: none; border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.seg button:hover { color: var(--brand); }
.seg button.on { background: #fff; color: var(--brand); font-weight: 500; box-shadow: 0 0 4px rgba(0, 0, 0, .06); }

/* 24h 条带 */
.spark { display: flex; align-items: flex-end; gap: 1px; height: 18px; }
.spark i {
  display: block; flex: none; width: 3px; height: 14px; border-radius: 1px; background: #cdebc0;
}
.spark i.ok { background: #a8dc8a; }
.spark i.warn { background: #f0c37c; }
.spark i.fail { background: #f79a9e; }
.spark i.none { background: #e5e7eb; }
.spark i.current { height: 18px; }

/* 依赖 chips */
.dep-rule {
  margin-top: 10px; padding: 8px 10px; border-radius: var(--r);
  background: var(--bg-inset); border: 1px solid var(--border-light);
  font-size: 12px; line-height: 18px; color: var(--text-2);
}
.dep-rule b { font-weight: 600; color: var(--text); }
.dep-alert {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  background: #fffafa; border: 1px solid #fbd4d6; border-radius: var(--r);
  padding: 8px 10px; margin-bottom: 10px;
}
.dep-alert-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 18px; color: var(--text-2); cursor: pointer;
  padding-right: 12px; border-right: 1px solid #f4dedf;
}
.dep-alert-item:last-child { border-right: none; padding-right: 0; }
.dep-alert-item b { font-weight: 500; color: var(--text); }
.dep-alert-item .mono { color: var(--text-3); font-size: 11px; }
.dep-alert-item:hover b { color: var(--danger); }
.dep-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.dep-row:last-child { border-bottom: none; }
.dep-node { width: 186px; flex: none; }
.dep-node .dn { font-size: 12px; line-height: 18px; color: var(--text-2); }
.dep-node .dc { font-weight: 500; }
.dep-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.dep-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px; border-radius: var(--r);
  border: 1px solid var(--border-light); background: var(--bg-inset);
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
.dep-chip:hover { border-color: var(--border); background: #fff; }
.dep-chip .dc-name { color: var(--text); }
.dep-chip .dc-meta { color: var(--text-3); font-family: "SFMono-Regular", Menlo, monospace; }
.dep-chip.is-fail { background: var(--danger-soft); border-color: #fbd4d6; color: var(--danger); }
.dep-chip.is-fail .dc-name { color: var(--danger); }
.dep-chip.is-fail .dc-meta { color: #e8636b; }
.dep-chip.is-warn { background: var(--warning-soft); border-color: #f6e3c6; }
.dep-chip.is-warn .dc-name { color: var(--warning); }
.dep-chip.is-skip { background: var(--bg-inset); color: var(--text-3); }

/* ── 事件列表 ───────────────────────────────────────── */
.ev-list { display: flex; flex-direction: column; }
.ev {
  padding: 10px 0 12px; border-bottom: 1px dashed var(--border-light); cursor: pointer;
}
.ev:last-child { border-bottom: none; padding-bottom: 0; }
.ev:first-child { padding-top: 0; }
.ev-top { display: flex; align-items: center; gap: 8px; }
.ev-title { flex: 1; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:hover .ev-title { color: var(--brand); }
.ev-dur { flex: none; font-size: 12px; font-weight: 600; color: var(--danger); font-variant-numeric: tabular-nums; }
.ev-dur.is-warn { color: var(--warning); }
.ev-dur.is-mute { color: var(--text-3); font-weight: 400; }
.ev-meta { margin-top: 4px; display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.ev-meta .no { font-family: "SFMono-Regular", Menlo, monospace; }
.ev-root { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-2); }
.ev-foot { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; }
.ev-sub-title { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 12px 0 4px; }

/* ── 通道 ───────────────────────────────────────────── */
.chan { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.chan:last-child { border-bottom: none; padding-bottom: 0; }
.chan:first-of-type { padding-top: 0; }
.chan:hover .chan-name { color: var(--brand); }
.chan-main { flex: 1; min-width: 0; }
.chan-name { font-size: 14px; line-height: 20px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.chan-meta { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.chan-meta .mono { color: var(--text-2); }
.chan-right { flex: none; text-align: right; font-size: 12px; line-height: 18px; color: var(--text-3); }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; font-size: 12px; line-height: 18px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }
.kv dd .mono { color: var(--text-2); }

/* ── 客户维度 ───────────────────────────────────────── */
.cust-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.cust-row:last-child { border-bottom: none; }
.cust-name { width: 150px; flex: none; font-weight: 500; }
.cust-tier { width: 48px; flex: none; }
.cust-meter { flex: 1; }
.meter { height: 6px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--success); }
.meter > i.warn { background: var(--warning); }
.meter > i.bad { background: var(--danger); }
.cust-rate { width: 74px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.cust-bad { width: 84px; flex: none; text-align: right; font-size: 12px; color: var(--text-3); }

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  height: 32px; padding: 0 15px; border-radius: var(--r);
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: all .2s var(--ease); white-space: nowrap;
}
.btn:hover { color: var(--brand); border-color: var(--brand-6); }
.btn:disabled { color: var(--text-4); border-color: var(--border-light); cursor: not-allowed; background: var(--bg-subtle); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
.btn-primary:disabled { background: var(--brand-6); border-color: var(--brand-6); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f7c5c7; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.btn-text { border: none; background: none; color: var(--link); padding: 0 4px; }
.btn-text:hover { color: var(--brand); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 36px; }

/* ── 表单 ───────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--r); font-family: inherit; font-size: 14px; color: var(--text);
  background: #fff; outline: none; transition: border-color .2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input:disabled, select:disabled { background: var(--bg-subtle); color: var(--text-3); cursor: not-allowed; }
select { padding-right: 24px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
textarea { height: auto; min-height: 64px; padding: 6px 10px; line-height: 20px; resize: vertical; }

.search-box { position: relative; width: 240px; }
.search-box input { width: 100%; padding-left: 30px; }
.search-box .sb-icon { position: absolute; left: 9px; top: 7px; width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.toolbar-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-count { font-size: 12px; color: var(--text-3); margin-left: 4px; }

.form-item { margin-bottom: 16px; }
.form-item > input, .form-item > select, .form-item > textarea { width: 100%; }
.form-label { display: block; font-size: 12px; line-height: 18px; color: var(--text-2); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-right: 2px; }
.form-hint { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.form-hint.err { color: var(--danger); }
.form-hint.ok { color: var(--success); }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; min-width: 0; }
.radio-line { display: flex; align-items: center; gap: 16px; height: 32px; }
.radio-line label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }

.acc-note {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r);
  background: var(--bg-inset); border: 1px solid var(--border-light);
  font-size: 12px; line-height: 18px; color: var(--text-3);
}
.acc-note b { color: var(--text-2); font-weight: 500; }

/* ── 分页 ───────────────────────────────────────────── */
.pager-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; }
.pg-info { font-size: 12px; color: var(--text-3); }
.pager { display: flex; align-items: center; gap: 8px; }
.pg-btn {
  height: 28px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 12px; cursor: pointer;
}
.pg-btn:hover:not(:disabled) { color: var(--brand); border-color: var(--brand-6); }
.pg-btn:disabled { color: var(--text-4); border-color: var(--border-light); background: var(--bg-subtle); cursor: not-allowed; }
.pg-num { font-size: 12px; color: var(--text-2); padding: 0 4px; }

/* ── 提示条 ─────────────────────────────────────────── */
.tip {
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: var(--r); padding: 8px 12px;
  font-size: 12px; line-height: 18px; color: var(--text-2);
}
.tip b { font-weight: 500; }
.tip-info { background: #f4f9ff; border-color: #d8e9ff; color: #33557d; }

/* ── 抽屉 / 弹窗 ─────────────────────────────────────── */
.drawer-mask, .modal-mask { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .45); }
.drawer-mask { display: flex; justify-content: flex-end; }
.drawer {
  width: 760px; max-width: 92vw; height: 100%; background: var(--surface);
  box-shadow: var(--shadow-md); display: flex; flex-direction: column;
  animation: drawerIn .3s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head {
  flex: none; padding: 16px 20px 12px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-title { font-size: 16px; line-height: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-sub { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.drawer-close {
  flex: none; width: 28px; height: 28px; border: none; background: none;
  color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 28px; border-radius: var(--r);
}
.drawer-close:hover { background: var(--bg-subtle); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot {
  flex: none; padding: 12px 20px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff;
}
.drawer-section { margin-bottom: 20px; }
.drawer-section:last-child { margin-bottom: 0; }
.ds-title {
  font-size: 12px; line-height: 18px; font-weight: 600; color: var(--text-3);
  letter-spacing: .3px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between;
}
.ds-title .right { font-weight: 400; }

.verdict {
  border-left: 3px solid var(--danger); background: var(--danger-soft);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 16px;
}
.verdict.is-warn { border-left-color: var(--warning); background: var(--warning-soft); }
.verdict.is-ok { border-left-color: var(--success); background: var(--success-soft); }
.verdict-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--danger); }
.verdict.is-warn .verdict-title { color: var(--warning); }
.verdict.is-ok .verdict-title { color: var(--success); }
.verdict-desc { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-2); }

.layer-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border-light); }
.layer-row:last-child { border-bottom: none; }
.layer-name { width: 92px; flex: none; font-size: 12px; color: var(--text-2); font-weight: 500; }
.layer-detail { flex: 1; font-size: 12px; line-height: 18px; color: var(--text-2); }
.layer-time { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.timing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.timing-cell { background: var(--bg-inset); border-radius: var(--r); padding: 8px 10px; }
.timing-label { font-size: 12px; color: var(--text-3); }
.timing-value { margin-top: 2px; font-size: 16px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timing-value.is-bad { color: var(--danger); }
.timing-value.is-warn { color: var(--warning); }
.timing-value small { font-size: 10px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

.logs { background: #1f1f1f; border-radius: var(--r); padding: 10px 12px; overflow-x: auto; }
.logs div { font-family: "SFMono-Regular", Menlo, monospace; font-size: 12px; line-height: 18px; color: #c9d1d9; white-space: pre; }
.logs .lt { color: #6e7681; }
.logs .le { color: #ff7b72; }
.logs .lw { color: #d29922; }

.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--border-light); }
.tl-item { position: relative; padding: 0 0 12px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -16px; top: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--border); border: 2px solid #fff;
}
.tl-item.is-bad::before { background: var(--danger); }
.tl-item.is-ok::before { background: var(--success); }
.tl-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-text { font-size: 12px; line-height: 18px; color: var(--text-2); margin-top: 1px; }
.tl-text b { font-weight: 500; color: var(--text); }

.modal { width: 560px; max-width: 92vw; max-height: 88vh; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-md); margin: auto; display: flex; flex-direction: column; animation: modalIn .3s var(--ease); }
@keyframes modalIn { from { transform: translateY(-8px); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-mask { display: flex; padding: 32px 16px; }
.modal-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; line-height: 22px; font-weight: 600; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; }

.toast-root { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(44, 41, 32, .92); color: #fff; font-size: 12px; line-height: 18px;
  padding: 8px 14px; border-radius: var(--r); box-shadow: var(--shadow-md);
  animation: toastIn .2s var(--ease);
}
.toast.is-error { background: rgba(214, 20, 30, .95); }
.toast.is-ok { background: rgba(60, 130, 20, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── 其它 ───────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.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; }
.flex { display: flex; } .aic { align-items: center; } .jcb { justify-content: space-between; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.text-3 { color: var(--text-3); } .text-2 { color: var(--text-2); } .fs12 { font-size: 12px; line-height: 18px; }
.nowrap { white-space: nowrap; }
.w100 { width: 100%; }
.link-plain { color: var(--link); cursor: pointer; }
.link-plain:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5dae1; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }


/* ── 窄屏提示 ───────────────────────────────────────── */
.mobile-tip { display: none; }
@media (max-width: 1200px) {
  .mobile-tip {
    display: block; margin: 8px 16px 0; padding: 8px 12px;
    background: var(--brand-9); border: 1px solid var(--brand-6); border-radius: var(--r);
    color: #a15c11; font-size: 12px; line-height: 18px;
  }
}
