:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #fbfcfe;
  --border: #e6ebf3;
  --border-strong: #d8e0ec;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8b98ab;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff5ff;
  --sev-critical: #dc2626;
  --sev-high: #ea580c;
  --sev-medium: #d97706;
  --sev-low: #0284c7;
  --sev-info: #94a3b8;
  --ok: #059669;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.app { display: flex; min-height: 100vh; }

/* ------------------------------------------------------------ 侧边栏 */
.sidebar {
  width: 222px;
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -.5px;
  flex: none;
}

.brand-mark.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; margin: 0 auto 14px; }

.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border: none;
  background: transparent;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background .14s, color .14s;
}

.nav-item:hover { background: #f5f8fc; color: var(--text); }

.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
}

.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item span { flex: 1; }

.nav-count {
  font-style: normal;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #eef2f7;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.nav-count.danger { background: #fef2f2; color: #b91c1c; }

.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.foot-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.foot-tip { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------ 顶栏 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 251, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}

.topbar-title h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.topbar-title p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 9px; }

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .06s;
  white-space: nowrap;
}

.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost { background: var(--panel); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { background: #f8fafc; color: var(--text); }

.btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn-ghost.danger { color: #b91c1c; }
.btn-ghost.danger:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------ 通用 SVG 图标 */
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ 内容区 */
.content { padding: 4px 28px 48px; flex: 1; }

.section { margin-bottom: 20px; animation: rise .34s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  gap: 12px;
}

.section-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.section-head .sub { font-size: 12px; color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card.flush { padding: 0; overflow: hidden; }

/* ------------------------------------------------------------ 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px 14px;
  position: relative;
  overflow: hidden;
  transition: border-color .16s, box-shadow .16s;
}

.stat:hover { border-color: var(--border-strong); box-shadow: 0 6px 20px rgba(15, 23, 42, .05); }

.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 29px; font-weight: 600; letter-spacing: -.025em; margin-top: 7px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.stat-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0 3px 3px 0; }

/* ------------------------------------------------------------ 两栏布局 */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 13px; align-items: start; }

/* ------------------------------------------------------------ 趋势图 */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 104px;
  margin-top: 14px;
  padding-bottom: 1px;
}

.spark i {
  flex: 1;
  background: #cfe0fb;
  border-radius: 3px 3px 2px 2px;
  min-height: 3px;
  position: relative;
  transition: background .14s;
  cursor: default;
}

.spark i:hover { background: var(--brand); }

.spark-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* ------------------------------------------------------------ 严重度条 */
.sev-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: #f1f5f9; margin: 16px 0 14px; }
.sev-bar span { height: 100%; transition: width .4s ease; }

.sev-list { display: flex; flex-direction: column; gap: 9px; }
.sev-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.sev-item .nm { color: var(--text-2); flex: 1; }
.sev-item .vl { font-variant-numeric: tabular-nums; font-weight: 500; }
.sev-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* ------------------------------------------------------------ 表格 */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td { padding: 12px 16px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafcff; }
tbody tr.clickable { cursor: pointer; }

.td-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.td-strong { font-weight: 500; }
.td-dim { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge.critical { background: #fef2f2; color: #b91c1c; }
.badge.high { background: #fff7ed; color: #c2410c; }
.badge.medium { background: #fffbeb; color: #a16207; }
.badge.low { background: #f0f9ff; color: #0369a1; }
.badge.info { background: #f1f5f9; color: #64748b; }
.badge.neutral { background: #f1f5f9; color: #475569; }
.badge.ok { background: #ecfdf5; color: #047857; }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }

/* ------------------------------------------------------------ 状态点 */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  flex: none;
}

.dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.dot.off { background: #cbd5e1; }

/* ------------------------------------------------------------ 告警列表 */
.inc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #f2f5fa;
  cursor: pointer;
  transition: background .12s;
}

.inc-row:last-child { border-bottom: none; }
.inc-row:hover { background: #fafcff; }

.inc-main { flex: 1; min-width: 0; }
.inc-title { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.inc-reason { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.55; }

/* ------------------------------------------------------------ 空状态 */
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.empty strong { display: block; color: var(--text-2); font-size: 13px; font-weight: 500; margin-bottom: 5px; }

/* ------------------------------------------------------------ 表单 */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

input, select, textarea {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}

textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.6; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

input::placeholder, textarea::placeholder { color: #b6c0ce; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { grid-template-columns: 1.7fr 1fr 1fr; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #f2f5fa;
}

.switch-row:last-child { border-bottom: none; }
.switch-row .lbl { font-size: 13px; }
.switch-row .desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  background: #c9d3e0;
  border-radius: 999px;
  transition: background .18s;
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .2);
  transition: transform .18s;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ------------------------------------------------------------ 代码块 */
pre.code {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #334155;
  overflow-x: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ------------------------------------------------------------ 漏斗 */
.pipe-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.pipe-row:last-child { margin-bottom: 0; }
.pipe-label { width: 88px; flex: none; font-size: 12px; color: var(--muted); }
.pipe-track { flex: 1; height: 24px; background: #f4f7fb; border-radius: 6px; overflow: hidden; }
.pipe-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  transition: width .5s ease;
}

/* ------------------------------------------------------------ 时间轴 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}
.tl-item { position: relative; padding: 0 0 15px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -18.5px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 1.6px solid var(--border-strong);
}
.tl-item.sev-critical::before { border-color: var(--sev-critical); }
.tl-item.sev-high::before { border-color: var(--sev-high); }
.tl-item.sev-medium::before { border-color: var(--sev-medium); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-time { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.tl-title { font-size: 12.5px; font-weight: 500; }
.tl-detail {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 3px;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
  line-height: 1.6;
}

/* ------------------------------------------------------------ 模态框 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(3px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade .18s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--panel);
  border-radius: 16px;
  width: 580px;
  max-width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
  animation: pop .2s ease both;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.98) translateY(6px); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-body { padding: 18px 22px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ 抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .24);
  z-index: 70;
  animation: fade .18s ease both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 640px;
  max-width: 94vw;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(15, 23, 42, .1);
  z-index: 71;
  display: flex;
  flex-direction: column;
  animation: slide .24s cubic-bezier(.22, .8, .3, 1) both;
}

@keyframes slide { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }

.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 13px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Toast */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
  animation: toastIn .22s ease both;
  max-width: 340px;
  line-height: 1.5;
}

.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }

@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ 登录 */
.login-mask {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 12% -10%, #e8effc 0%, rgba(232, 239, 252, 0) 62%),
    radial-gradient(780px 420px at 100% 108%, #eef2ff 0%, rgba(238, 242, 255, 0) 60%),
    var(--bg);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 30px 24px;
  width: 356px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  animation: rise .32s ease both;
}

.login-card h1 { margin: 12px 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.login-card p { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }
.login-form { text-align: left; }
.login-form.hidden { display: none; }

.lf-field { margin-bottom: 13px; }
.lf-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px !important; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-eye:hover { background: #f1f5f9; color: var(--text); }
.pw-eye::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1.6px solid currentColor;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.pw-eye::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 1.6px;
  background: currentColor;
  transform: rotate(45deg);
}
.pw-eye.on::after { display: none; }

.lf-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  margin: 2px 0 16px;
  cursor: pointer;
  user-select: none;
}
.lf-remember input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); }

.login-card .btn { width: 100%; justify-content: center; height: 38px; }
.login-err {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 10px;
  min-height: 15px;
  line-height: 1.5;
}
.login-foot {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}
.setup-note {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  line-height: 1.6;
  padding: 9px 11px;
  border-radius: 9px;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------ 侧边栏用户区 */
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.user-avatar {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-meta { min-width: 0; flex: 1; }
.user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.user-row .icon-btn { width: 24px; height: 24px; }
.user-row .icon-btn svg { width: 13px; height: 13px; }

body.readonly .admin-only { display: none !important; }

/* ------------------------------------------------------------ 部署步骤 */
.steps { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  line-height: 1.5;
}

.step .st-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: none; background: #cbd5e1; }
.step.ok .st-dot { background: #10b981; }
.step.bad .st-dot { background: #ef4444; }
.step.bad { background: #fef2f2; border-color: #fecaca; }
.step .st-name { font-weight: 500; white-space: nowrap; }
.step .st-detail { color: var(--muted); word-break: break-all; }

/* ------------------------------------------------------------ 大模型厂商选择 */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 9px;
  margin: 14px 0 10px;
}

.provider-chip {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .14s, background .14s, box-shadow .14s;
}

.provider-chip:hover { border-color: #b9c8e0; background: #fbfcff; }

.provider-chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.provider-chip .pc-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.provider-chip .pc-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-chip .pc-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--brand);
  background: #eff5ff;
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
}

.provider-chip .pc-host {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-note {
  font-size: 11.5px;
  color: var(--text-2);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 2px solid var(--brand);
  border-radius: 8px;
  padding: 9px 11px;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------ 抑制规则 */
.cand-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }

.cand-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfcfe;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}

.cand-item:hover { border-color: #b9c8e0; background: #fff; }
.cand-item input { width: auto; height: auto; margin: 0; flex: none; }
.cand-item .ci-main { flex: 1; min-width: 0; }
.cand-item .ci-val {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--text);
  word-break: break-all;
}
.cand-item .ci-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-item span, .nav-count, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding: 16px 0; }
  .nav-item { justify-content: center; padding: 0; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .drawer { width: 100vw; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------ 传输安全提示 */
.insecure-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 28px 4px; padding: 11px 14px;
  border: 1px solid #fcd9b6; border-radius: 12px;
  background: #fff8ef; color: #9a3412;
  font-size: 12.5px; line-height: 1.6;
}
.insecure-banner svg {
  width: 17px; height: 17px; flex: none; margin-top: 1px;
  fill: none; stroke: #ea580c; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.insecure-banner b { display: block; font-weight: 600; color: #7c2d12; }
.insecure-banner span { color: #a16207; }

.cred-note {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid #d6e6ff; border-radius: 10px;
  background: var(--brand-soft); color: #1e3a8a;
  font-size: 12.5px; line-height: 1.62;
}
.cred-note svg {
  width: 16px; height: 16px; flex: none; margin-top: 1px;
  fill: none; stroke: var(--brand); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.cred-note b { font-weight: 600; }

@media (max-width: 860px) {
  .insecure-banner { margin-left: 16px; margin-right: 16px; }
}

.login-insecure {
  margin-top: 12px; padding: 9px 11px;
  border: 1px solid #fcd9b6; border-radius: 9px;
  background: #fff8ef; color: #9a3412;
  font-size: 11.5px; line-height: 1.55;
}

.cred-warn {
  margin: 8px 0 4px; padding: 9px 11px;
  border: 1px solid #fcd9b6; border-radius: 9px;
  background: #fff8ef; color: #9a3412;
  font-size: 12px; line-height: 1.6;
}

/* ------------------------------------------------------------ 系统信息格 */
.kv-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.kv {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 13px; background: #fff; min-width: 0;
}
.kv span { font-size: 11.5px; color: var(--muted); }
.kv b {
  font-size: 12.5px; font-weight: 500; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-count.warn { background: #fff7ed; color: #c2410c; }

@media (max-width: 720px) {
  .kv-grid { grid-template-columns: 1fr; }
}
