/* =========================================================================
   svpanel 2 — design system "Soft Graphite"
   Warm paper surface · single vermilion accent · Sora / Manrope / JetBrains Mono
   Two themes via html[data-theme]. No purple gradients, no glassmorphism.
   ========================================================================= */

@import url("/fonts.css");

/* ---------- tokens ---------- */
html[data-theme="light"] {
  --bg: #f6f5f2;
  --bg-deep: #efece7;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --surface-3: #f2f0ec;
  --ink: #17161a;
  --ink-2: #5b5963;
  --ink-3: #8d8a96;
  --ink-4: #b4b1bb;
  --line: rgba(23, 22, 26, .085);
  --line-2: rgba(23, 22, 26, .15);
  --accent: #f0431f;
  --accent-2: #ff7a45;
  --accent-soft: rgba(240, 67, 31, .085);
  --accent-ink: #ffffff;
  --good: #0f7a52;
  --good-soft: rgba(15, 122, 82, .09);
  --warn: #a96700;
  --warn-soft: rgba(169, 103, 0, .1);
  --bad: #cf2626;
  --bad-soft: rgba(207, 38, 38, .09);
  --shadow-xs: 0 1px 2px rgba(23, 22, 26, .05);
  --shadow-sm: 0 1px 2px rgba(23, 22, 26, .05), 0 2px 8px -4px rgba(23, 22, 26, .1);
  --shadow-md: 0 2px 6px rgba(23, 22, 26, .05), 0 14px 32px -18px rgba(23, 22, 26, .3);
  --shadow-lg: 0 8px 24px rgba(23, 22, 26, .09), 0 40px 80px -40px rgba(23, 22, 26, .4);
  --ring-track: rgba(23, 22, 26, .09);
  --grain-opacity: .022;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-deep: #08080a;
  --surface: #131316;
  --surface-2: #17181c;
  --surface-3: #1d1e23;
  --ink: #f3f2ef;
  --ink-2: #a8a6b0;
  --ink-3: #6f6d78;
  --ink-4: #4a4852;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --accent: #ff5a35;
  --accent-2: #ff8a5c;
  --accent-soft: rgba(255, 90, 53, .12);
  --accent-ink: #14100f;
  --good: #3ddc97;
  --good-soft: rgba(61, 220, 151, .12);
  --warn: #f5b544;
  --warn-soft: rgba(245, 181, 68, .13);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .12);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 10px -6px rgba(0, 0, 0, .8);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .5), 0 18px 40px -24px rgba(0, 0, 0, .9);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6), 0 50px 90px -50px #000;
  --ring-track: rgba(255, 255, 255, .1);
  --grain-opacity: .045;
  color-scheme: dark;
}

:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Sora", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --side: 244px;
  --topbar: 76px;
  --pad: 28px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}
/* 极淡纸纹：只做质感 */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.022em; }
b, strong { font-weight: 600; }

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

/* ---------- 骨架 ---------- */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: var(--side) 1fr;
  height: 100vh; height: 100dvh;
}

/* ---------- 侧栏 ---------- */
.side {
  display: flex; flex-direction: column;
  padding: 18px 14px 14px; gap: 6px; min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--bg) 60%);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.mark {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  background: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow-xs);
}
.mark i { width: 11px; height: 11px; border-radius: 50%; border: 2.6px solid var(--accent); display: block; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 15.5px; letter-spacing: -.03em; color: var(--ink); }
.badge {
  margin-left: auto; font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .04em; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 7px;
}

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; padding: 2px 0 6px; margin: 0 -4px; }
.nav-group {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: var(--r-sm); min-height: 36px;
  font-size: 13.2px; font-weight: 500; color: var(--ink-2); position: relative;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .78; transition: opacity .16s, color .16s; }
.nav a .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .idx { display: none; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a:hover svg { opacity: 1; }
.nav a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.nav a.on svg { color: var(--accent); opacity: 1; }
.nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-foot { display: flex; gap: 6px; padding: 10px 2px 0; border-top: 1px solid var(--line); }

/* ---------- 主区 ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  height: var(--topbar); flex: none; padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  position: relative; z-index: 5;
}
.heading { min-width: 0; }
.heading h1 { font-size: 21px; font-weight: 600; letter-spacing: -.028em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heading p { margin: 2px 0 0; font-size: 12.2px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-chips, .node-chips { display: flex; gap: 6px; align-items: center; overflow: hidden; }

.content { flex: 1; overflow-y: auto; min-height: 0; padding: var(--pad); scroll-behavior: smooth; }
.content > .fade-in { max-width: 1500px; margin: 0 auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; cursor: pointer;
  font-family: var(--body); font-size: 12.8px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease),
              transform .12s var(--ease), box-shadow .15s var(--ease);
  white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: var(--ink-4); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: none; }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 1px 2px rgba(240, 67, 31, .25), 0 6px 16px -8px rgba(240, 67, 31, .55);
}
.btn.primary:hover { background: var(--accent-2); border-color: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-3); }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); box-shadow: none; }
.btn.sm { height: 27px; padding: 0 9px; font-size: 11.8px; border-radius: 7px; }
.btn.sm svg { width: 12px; height: 12px; }
.btn svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--ink-3); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- 卡片 ---------- */
.card {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card > header {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px 0;
  font-family: var(--display); font-size: 13.5px; font-weight: 600;
  letter-spacing: -.015em; color: var(--ink);
}
.card > header .sub { font-size: 11.6px; font-weight: 500; color: var(--ink-3); }
.card > header + .body, .card > header + .pad16, .card > header + .tight { padding-top: 12px; }
.card .body { padding: 0 18px 18px; }
.card .pad16 { padding: 14px 18px 18px; }
.card .tight { padding: 0 18px 14px; }

/* 布局工具 */
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.col { display: flex; flex-direction: column; min-width: 0; }
.gap6 { gap: 6px; } .gap10 { gap: 10px; } .gap14 { gap: 14px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tight { display: flex; flex-direction: column; }

/* 文本 */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .94em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mut { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.kbd {
  font-family: var(--mono); font-size: 10.5px; padding: 1.5px 5px; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface-2);
}

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 2px 8px; border-radius: 99px; color: var(--ink-2); background: var(--surface-3);
}
.tag.ok { color: var(--good); background: var(--good-soft); }
.tag.bad { color: var(--bad); background: var(--bad-soft); }
.tag.warn { color: var(--warn); background: var(--warn-soft); }
.tag.info { color: var(--ink); background: var(--accent-soft); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.6px; font-weight: 500; color: var(--ink-2);
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); box-shadow: var(--shadow-xs); white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.chip.warn b { color: var(--warn); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.chip.bad b { color: var(--bad); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; }
.dot.live { animation: pulse 2.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  height: 36px; padding: 0 11px; width: 100%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-family: var(--body); font-size: 13px; outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; min-height: 130px; padding: 11px; line-height: 1.6; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
select { cursor: pointer; appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8a96' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.switch {
  position: relative; width: 44px; height: 25px; flex: none; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 99px;
  transition: background .22s var(--ease), border-color .22s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .26s var(--ease-out);
}
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { transform: translateX(19px); background: #fff; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; }
.seg button {
  padding: 5px 12px; border: 0; border-radius: 7px; cursor: pointer; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type="search"], .toolbar input[type="text"] { width: 240px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--ink-3);
  font-size: 11px; font-weight: 700; letter-spacing: .045em;
  text-align: left; padding: 9px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .13s var(--ease); }
tbody tr:hover td { background: var(--surface-2); }
tbody td.num, tbody td.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 键值 ---------- */
.li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .k { color: var(--ink-3); font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.li .v {
  flex: 1; min-width: 0; text-align: right;
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 日志 / 终端 ---------- */
.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  color: var(--ink-2); max-height: 470px;
}
.log.tall { max-height: 68vh; }
.term {
  height: calc(100vh - 240px);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.62;
  padding: 14px 16px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.frow { display: flex; gap: 10px; align-items: center; }
.frow .prompt { font-family: var(--mono); color: var(--accent); font-size: 13px; font-weight: 600; }

/* ---------- 空态 / 骨架 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 16px; color: var(--ink-3); text-align: center; }
.empty svg { width: 28px; height: 28px; opacity: .45; }
.empty b { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.empty span { font-size: 12px; }
.skel {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 弹层 ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 22px;
  animation: fade-in .18s var(--ease);
}
.modal {
  width: min(660px, 100%); max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop-in .24s var(--ease-out);
}
.modal > header { padding: 18px 20px 14px; font-family: var(--display); font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .body { padding: 18px 20px; overflow: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 94vw); z-index: 210;
  display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: slide-in .26s var(--ease-out);
}
.drawer > header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 14.5px; font-weight: 600; }
.drawer .body { flex: 1; overflow: auto; padding: 18px 20px; }
@keyframes slide-in { from { transform: translateX(28px); opacity: .4; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: translateY(8px) scale(.985); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.8px; font-weight: 500; padding: 11px 15px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  animation: toast-in .26s var(--ease-out); max-width: 400px;
}
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.ok::before { background: var(--good); }
.toast.bad::before { background: var(--bad); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- 命令面板 ---------- */
.palette {
  width: min(580px, 100%); align-self: flex-start; margin-top: 11vh;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop-in .22s var(--ease-out);
}
.palette input { width: 100%; height: 52px; padding: 0 18px; font-size: 14.5px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.palette input:focus { box-shadow: none; }
.palette .list { max-height: 48vh; overflow: auto; padding: 7px; }
.palette .item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: 13.2px; border-radius: var(--r-sm); color: var(--ink-2); }
.palette .item svg { width: 15px; height: 15px; color: var(--ink-3); }
.palette .item.on, .palette .item:hover { background: var(--accent-soft); color: var(--ink); }
.palette .item.on svg, .palette .item:hover svg { color: var(--accent); }
.palette .item .idx { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); }

/* ---------- 环形仪表 ---------- */
.ring-wrap { position: relative; width: 84px; height: 84px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); display: block; }
.ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-val b { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.ring-val span { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.ring { display: flex; align-items: center; gap: 16px; }
.ring .lbl b { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.ring .lbl span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ---------- 进度条 ---------- */
.bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease-out); }
.bar.ok > i { background: var(--good); }
.bar.bad > i { background: var(--bad); }

/* ---------- 指标卡 ---------- */
.metric { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.metric .k { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.metric .v {
  font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -.045em; line-height: 1.05; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.metric .v.big { font-size: 34px; }
.metric .foot { font-size: 11.8px; color: var(--ink-3); }

/* ---------- 防护页 ---------- */
.hero-ic { width: 26px; height: 26px; color: var(--accent); flex: none; }
.hero-ic svg { width: 26px; height: 26px; }
.sec-hero .pad16 { display: flex; gap: 18px; align-items: flex-start; padding: 20px; flex-wrap: wrap; }
.shield { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; flex: 1; min-width: 260px; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }
.rule-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; }
.rule-row:last-child { border-bottom: 0; }
.rule-row .n { width: 20px; color: var(--ink-4); text-align: right; flex: none; }
.rule-row .hits, .rule-row .pk { width: 58px; flex: none; text-align: right; color: var(--ink-2); }
.rule-row .pk.hot { color: var(--accent); font-weight: 600; }
.rule-row .bar-mini { width: 62px; height: 4px; background: var(--surface-3); border-radius: 99px; flex: none; overflow: hidden; }
.rule-row .bar-mini > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rule-row .txt { flex: 1; min-width: 0; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.score-item:last-child { border-bottom: 0; }
.score-item .ip { font-family: var(--mono); font-size: 12px; width: 150px; flex: none; }
.score-item .sbar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.score-item .sbar > i { display: block; height: 100%; background: var(--bad); border-radius: 99px; }

/* ---------- 进入动画 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.fade-in > * { animation: rise .46s var(--ease-out) both; }
.fade-in > *:nth-child(1) { animation-delay: .02s; }
.fade-in > *:nth-child(2) { animation-delay: .07s; }
.fade-in > *:nth-child(3) { animation-delay: .12s; }
.fade-in > *:nth-child(4) { animation-delay: .17s; }
.fade-in > *:nth-child(5) { animation-delay: .22s; }
.fade-in > *:nth-child(6) { animation-delay: .27s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.aurora { display: none; }

/* =========================================================================
   响应式
   ========================================================================= */
@media (max-width: 1240px) {
  :root { --side: 68px; --pad: 22px; }
  .brand { justify-content: center; padding: 4px 0 16px; }
  .wordmark, .badge, .nav a .lbl, .nav-group { display: none; }
  .nav a { justify-content: center; padding: 9px 0; }
  .nav a svg { width: 18px; height: 18px; }
  .side-foot { flex-direction: column; align-items: center; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g-2-1 { grid-template-columns: 1fr; }
  .live-chips { display: none; }
}

@media (max-width: 900px) {
  .grid, .grid.g2, .grid.g4 { grid-template-columns: 1fr; }
  .heading p { display: none; }
  .topbar { height: 64px; }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  :root { --pad: 14px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 150;
    flex-direction: row; align-items: center; gap: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .5);
  }
  .brand { display: none; }
  .nav { flex-direction: row; gap: 0; padding: 0; flex: 1; overflow-x: auto; overflow-y: hidden; }
  .nav a { flex-direction: column; gap: 4px; min-width: 66px; padding: 8px 4px 7px; font-size: 9.8px; border-radius: 0; min-height: 56px; justify-content: center; }
  .nav a .lbl { display: block; font-size: 9.8px; font-weight: 500; }
  .nav a svg { width: 19px; height: 19px; }
  .nav a.on { background: transparent; box-shadow: none; color: var(--accent); }
  .nav a.on svg { color: var(--accent); }
  .nav a.on::before { display: none; }
  .side-foot { flex-direction: row; padding: 0 8px 0 0; border-top: 0; }
  .side-foot .icon-btn { width: 32px; height: 32px; }
  .main { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .topbar { height: 58px; gap: 10px; }
  .heading h1 { font-size: 17.5px; }
  .node-chips { display: none; }
  .content { padding: 14px 14px 20px; }
  .grid { gap: 12px; }
  .card > header { padding: 13px 14px 0; font-size: 13px; }
  .card .body { padding: 0 14px 14px; }
  .card .pad16 { padding: 12px 14px 14px; }
  .card .tight { padding: 0 14px 12px; }
  .ring-wrap, .ring-wrap svg { width: 64px; height: 64px; }
  .ring-val b { font-size: 16px; }
  .ring-val span { font-size: 8.5px; }
  .metric { padding: 14px; }
  .metric .v { font-size: 25px; }
  .toolbar input[type="search"], .toolbar input[type="text"] { width: 100%; }
  .drawer { width: 100vw; }
  .toasts { left: 14px; right: 14px; bottom: calc(66px + env(safe-area-inset-bottom)); align-items: stretch; }
  .term { height: calc(100vh - 300px); }
  .li { padding: 8px 0; }
  .li .k { font-size: 11.5px; }
  tbody td, thead th { padding: 8px 10px; }
  .modal { border-radius: var(--r-lg); }
}

/* ---------- 补充：仪表卡内容 / 列表容器 ---------- */
.spark { width: 100%; display: block; }
.mini-list { padding: 0 18px 16px; }
.splitchip { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: -.01em; }
#diskList .li, #topProc .li { padding-left: 0; padding-right: 0; }
@media (max-width: 720px) {
  .mini-list { padding: 0 14px 12px; }
}

/* ---------- 移动端 2.0（≤720） ---------- */
.only-mob { display: none; }
@media (max-width: 720px) {
  .only-mob { display: flex; align-items: center; gap: 2px; margin-left: 2px; }
  .side-foot { display: none; }
  .nav {
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 0 2px; mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: 0 0 auto; min-width: 62px; scroll-snap-align: center;
    padding: 8px 6px 7px;
  }
  .nav a .lbl { font-size: 9.5px; white-space: nowrap; }
  .side { padding: 0; }
  .side { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  /* 卡片标题不再被挤压换行 */
  .card > header { white-space: nowrap; overflow: hidden; flex-wrap: nowrap; }
  .card > header .sub { white-space: nowrap; }
  .card > header .spacer { flex: 1 1 auto; min-width: 4px; }
  .topbar { padding: 0 12px; }
  .topbar-right { gap: 2px; }
  .topbar-right .icon-btn { width: 34px; height: 34px; }
  .heading h1 { font-size: 18px; }
  /* 表格横向滚动更自然 */
  .card .body, .card .pad16 { overflow-x: auto; }
  /* 工具条按钮等宽换行 */
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; min-height: 38px; }
}
