/* ==========================================================================
   XinXSS 控制台 — 深色作战指挥台
   设计基调：近黑底 + 青绿主色 + 琥珀警示；高密度信息，细边框分层。
   ========================================================================== */

:root {
  --bg: #080b10;
  --bg-2: #0a0e14;
  --panel: #0d131b;
  --panel-2: #111823;
  --panel-3: #151d29;
  --line: #1d2634;
  --line-2: #26313f;
  --line-hot: #2f3d4e;

  --text: #dfe7f1;
  --text-2: #a7b4c4;
  --text-3: #74828f;
  --text-4: #55616d;

  --acc: #2ee6b0;
  --acc-2: #17b98a;
  --acc-dim: rgba(46, 230, 176, .12);
  --acc-line: rgba(46, 230, 176, .34);
  --amber: #f5b544;
  --amber-dim: rgba(245, 181, 68, .13);
  --red: #ff5f6d;
  --red-dim: rgba(255, 95, 109, .12);
  --blue: #4da3ff;
  --blue-dim: rgba(77, 163, 255, .13);
  --purple: #b084ff;
  --purple-dim: rgba(176, 132, 255, .13);
  --green: #46d67f;
  --green-dim: rgba(70, 214, 127, .12);
  --gray-dim: rgba(150, 165, 180, .13);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", sans-serif;

  --r: 10px;
  --r-sm: 7px;
  --r-lg: 16px;
  --sidebar-w: 232px;

  --shadow-1: 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-2: 0 18px 44px -22px rgba(0,0,0,.85);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(46,230,176,.075), transparent 62%),
    radial-gradient(760px 420px at 8% 108%, rgba(245,181,68,.055), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 13.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .28;
  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%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: rgba(46,230,176,.28); color: #fff; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-variant-ligatures: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------- 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #27313d transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #232d39; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #33404f; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- 侧栏 */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px 14px;
  background: linear-gradient(180deg, rgba(15,21,29,.96), rgba(9,13,19,.98));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px; color: var(--acc);
}
.brand-mark { display: grid; place-items: center; color: var(--acc); filter: drop-shadow(0 0 9px rgba(46,230,176,.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: .14em; color: #eafff8; font-weight: 650; }
.brand-text small { font-size: 10px; letter-spacing: .22em; color: var(--text-4); text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  padding: 14px 10px 6px; font-size: 10px; letter-spacing: .2em;
  color: var(--text-4); text-transform: uppercase;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .78; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item:active { transform: translateY(.5px); }
.nav-item.active {
  color: var(--acc); background: linear-gradient(90deg, var(--acc-dim), rgba(46,230,176,.03));
  border-color: var(--acc-line);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 2px; height: 18px; border-radius: 2px; background: var(--acc);
  box-shadow: 0 0 12px var(--acc);
}
.nav-item.active svg { opacity: 1; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.pill-live {
  display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-3);
  padding: 6px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
}
.pill-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); flex: none; }
.pill-live.ok { color: var(--acc); border-color: var(--acc-line); background: var(--acc-dim); }
.pill-live.ok i { background: var(--acc); box-shadow: 0 0 9px var(--acc); animation: pulse 2s infinite; }
.pill-live.bad { color: var(--amber); border-color: rgba(245,181,68,.3); background: var(--amber-dim); }
.pill-live.bad i { background: var(--amber); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.foot-note { font-size: 10px; color: var(--text-4); letter-spacing: .1em; padding-left: 6px; }

/* ---------------------------------------------------------- 主框架 */
.shell {
  position: relative; z-index: 1;
  min-height: 100vh; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 22px;
  background: rgba(10,14,20,.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
}
.burger { display: none; }

.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.crumbs .c-sep { color: var(--text-4); }
.crumbs strong { color: var(--text); font-weight: 600; }

.statusbar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sb-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
  padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
}
.sb-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.sb-item.ok { color: var(--acc); border-color: var(--acc-line); }
.sb-item.ok .dot { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.sb-item.bad { color: var(--amber); border-color: rgba(245,181,68,.3); }
.sb-item.bad .dot { background: var(--amber); }
.sb-sep { width: 1px; height: 16px; background: var(--line); }
#clock { font-size: 11px; color: var(--text-3); letter-spacing: .06em; }

.view {
  flex: 1; padding: 24px 26px 44px; max-width: 1400px; width: 100%;
  outline: none;
}
.bottombar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 26px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--text-4); letter-spacing: .06em;
  background: rgba(8,11,16,.7);
}

/* ---------------------------------------------------------- 按钮 */
.btn {
  --btn-bg: var(--panel-2); --btn-bd: var(--line-2); --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r-sm);
  font: 500 12.5px var(--sans); color: var(--btn-fg);
  background: var(--btn-bg); border: 1px solid var(--btn-bd);
  cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--panel-3); border-color: var(--line-hot); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--acc-line); outline-offset: 2px; }
.btn svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn-primary {
  --btn-bg: linear-gradient(180deg, #34f0ba, #17b98a);
  --btn-bd: #38eab6; --btn-fg: #04170f; font-weight: 650;
  box-shadow: 0 6px 18px -10px rgba(46,230,176,.9);
}
.btn-primary:hover { --btn-bg: linear-gradient(180deg, #48f8c6, #1fce9b); }
.btn-ghost { --btn-bg: transparent; --btn-bd: var(--line-2); --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-fg: var(--text); }
.btn-danger { --btn-bg: var(--red-dim); --btn-bd: rgba(255,95,109,.35); --btn-fg: #ff9aa3; }
.btn-danger:hover { --btn-bg: rgba(255,95,109,.2); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 6px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); border-color: var(--line-hot); }
.icon-btn:active { transform: translateY(1px); }

/* ---------------------------------------------------------- 页头 */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head .ph-main { min-width: 0; }
.page-head h1 {
  margin: 0; font-size: 22px; font-weight: 640; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 10px;
}
.page-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--text-3); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 8px;
}
.eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--acc-line); }

/* ---------------------------------------------------------- 卡片 */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-1);
}
.card-pad { padding: 16px 18px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px 18px; }

.grid { display: grid; gap: 12px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid-projects { grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); }

/* 统计卡 */
.stat {
  position: relative; overflow: hidden;
  padding: 15px 16px 14px; border-radius: var(--r);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
}
.stat::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, var(--acc), transparent 88%);
  opacity: .5;
}
.stat .s-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); }
.stat .s-val { font: 640 28px/1.15 var(--mono); margin-top: 10px; letter-spacing: -.02em; }
.stat .s-sub { margin-top: 6px; font-size: 11px; color: var(--text-4); }
.stat.amber::after { background: linear-gradient(90deg, var(--amber), transparent 88%); }
.stat.amber .s-val { color: var(--amber); }
.stat.blue::after { background: linear-gradient(90deg, var(--blue), transparent 88%); }
.stat.blue .s-val { color: var(--blue); }
.stat.purple::after { background: linear-gradient(90deg, var(--purple), transparent 88%); }
.stat.purple .s-val { color: var(--purple); }
.stat.acc .s-val { color: var(--acc); }

/* ---------------------------------------------------------- 项目卡 */
.pcard {
  display: flex; flex-direction: column; gap: 12px;
  padding: 15px 16px; border-radius: var(--r);
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 70%);
  border: 1px solid var(--line); cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.pcard:hover {
  border-color: var(--acc-line); transform: translateY(-2px);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(46,230,176,.08);
}
.pcard:focus-visible { outline: 2px solid var(--acc-line); outline-offset: 2px; }
.pcard-top { display: flex; align-items: flex-start; gap: 10px; }
.pcard-name { font-size: 14.5px; font-weight: 620; letter-spacing: -.005em; }
.pcard-target { font: 11px var(--mono); color: var(--text-4); }
.pcard-metrics { display: flex; gap: 14px; font-size: 11px; color: var(--text-3); }
.pcard-metrics b { color: var(--text-2); font: 600 12px var(--mono); }
.pcard-metrics .hot b { color: var(--acc); }
.pcard-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--text-4); }
.pcard-foot .go { margin-left: auto; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.pcard:hover .go { color: var(--acc); }

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font: 700 13px var(--mono); color: var(--acc);
  background: var(--acc-dim); border: 1px solid var(--acc-line);
}

/* ---------------------------------------------------------- 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 7px; border-radius: 5px;
  font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.blue   { color: var(--blue);   background: var(--blue-dim);   border-color: rgba(77,163,255,.26); }
.badge.green  { color: var(--green);  background: var(--green-dim);  border-color: rgba(70,214,127,.26); }
.badge.purple { color: var(--purple); background: var(--purple-dim); border-color: rgba(176,132,255,.26); }
.badge.amber  { color: var(--amber);  background: var(--amber-dim);  border-color: rgba(245,181,68,.28); }
.badge.red    { color: #ff8a93;       background: var(--red-dim);    border-color: rgba(255,95,109,.3); }
.badge.gray   { color: var(--text-3); background: var(--gray-dim);   border-color: var(--line-2); }
.badge.teal   { color: var(--acc);    background: var(--acc-dim);    border-color: var(--acc-line); }

.tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; background: var(--panel-3); border: 1px solid var(--line-2); font: 11px var(--mono); color: var(--text-2); }

/* ---------------------------------------------------------- 空状态 */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 54px 22px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.012) 0 10px, transparent 10px 20px);
}
.empty .e-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: var(--text-3); background: var(--panel-2); border: 1px solid var(--line-2);
}
.empty .e-icon svg { width: 22px; height: 22px; }
.empty h3 { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; }
.empty p { margin: 0; font-size: 12px; color: var(--text-4); max-width: 380px; }
.empty .actions { margin-top: 6px; display: flex; gap: 8px; }
.empty.error { border-color: rgba(245,181,68,.3); background: rgba(245,181,68,.03); }
.empty.error .e-icon { color: var(--amber); border-color: rgba(245,181,68,.3); background: var(--amber-dim); }

/* 骨架 */
.skel { border-radius: 6px; background: linear-gradient(90deg, #121a24, #1a2431, #121a24); background-size: 200% 100%; animation: shim 1.3s infinite; }
@keyframes shim { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.skel-line { height: 11px; margin: 8px 0; }
.skel-block { height: 84px; }

/* ---------------------------------------------------------- 表格 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl thead th {
  text-align: left; padding: 9px 12px; white-space: nowrap;
  font: 600 10px var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-4); background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 9px 12px; border-bottom: 1px solid rgba(29,38,52,.6); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .13s; }
.tbl tbody tr:hover { background: rgba(46,230,176,.045); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.tbl .cell-max { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .row-go { color: var(--text-4); text-align: right; width: 34px; }
.tbl tr:hover .row-go { color: var(--acc); }

/* ---------------------------------------------------------- 列表 / 事件 */
.evlist { display: flex; flex-direction: column; }
.ev {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid rgba(29,38,52,.55);
  cursor: pointer; transition: background .13s;
}
.ev:hover { background: rgba(46,230,176,.045); }
.ev:last-child { border-bottom: 0; }
.ev.has-data.open { background: var(--panel-2); }
.ev time { font: 11px var(--mono); color: var(--text-4); }
.ev .ev-main { min-width: 0; display: flex; align-items: center; gap: 8px; }
.ev .ev-sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.ev .ev-meta { display: flex; align-items: center; gap: 8px; color: var(--text-4); font: 10.5px var(--mono); }
.ev-detail { grid-column: 1 / -1; padding: 2px 0 6px; }
pre.json {
  margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto;
  background: #070a0f; border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 11.5px/1.6 var(--mono); color: #c7d5e4; white-space: pre; tab-size: 2;
}
pre.json .k { color: var(--acc); }
pre.json .s { color: #ffd08a; }
pre.json .n { color: var(--blue); }
pre.json .b { color: var(--purple); }
pre.json .z { color: var(--text-4); }
pre.code {
  margin: 0; padding: 13px 15px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  background: #070a0f; border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 11.5px/1.7 var(--mono); color: #bfe9d8;
  max-height: 260px;
}

/* ---------------------------------------------------------- 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.field .hint { font-size: 11px; color: var(--text-4); }
.input, .textarea, .select {
  width: 100%; padding: 8px 11px; border-radius: var(--r-sm);
  background: #070b10; color: var(--text); border: 1px solid var(--line-2);
  font: 12.5px var(--sans); transition: border-color .15s, box-shadow .15s;
}
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 12px; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--acc-line); box-shadow: 0 0 0 3px rgba(46,230,176,.1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { appearance: none; cursor: pointer; }

/* 开关 */
.switch { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.switch:hover { border-color: var(--line-hot); }
.switch.on { border-color: var(--acc-line); background: rgba(46,230,176,.05); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; flex: none; width: 34px; height: 19px; border-radius: 99px;
  background: #202a36; border: 1px solid var(--line-2); margin-top: 1px;
  transition: background .18s, border-color .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #8796a5; transition: transform .18s var(--ease), background .18s;
}
.switch.on .track { background: var(--acc-dim); border-color: var(--acc-line); }
.switch.on .track::after { transform: translateX(15px); background: var(--acc); }
.switch .sw-text { display: flex; flex-direction: column; gap: 2px; }
.switch .sw-text b { font-size: 12.5px; font-weight: 560; }
.switch .sw-text small { font-size: 11px; color: var(--text-4); }

/* ---------------------------------------------------------- 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  position: relative; padding: 9px 13px 10px; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font: 520 12.5px var(--sans); white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.025); }
.tab.active { color: var(--acc); }
.tab.active::after { content: ""; position: absolute; inset: auto 8px -1px 8px; height: 2px; background: var(--acc); border-radius: 2px; box-shadow: 0 0 10px var(--acc); }
.tab .cnt { margin-left: 6px; font: 10px var(--mono); color: var(--text-4); padding: 1px 5px; border-radius: 4px; background: var(--panel-3); }
.tab.active .cnt { color: var(--acc); background: var(--acc-dim); }

/* 筛选条 */
.filterbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip {
  padding: 4px 9px; border-radius: 99px; cursor: pointer;
  font: 11px var(--mono); color: var(--text-3);
  background: var(--panel); border: 1px solid var(--line);
  transition: color .14s, border-color .14s, background .14s;
}
.chip:hover { color: var(--text); border-color: var(--line-hot); }
.chip.active { color: var(--acc); background: var(--acc-dim); border-color: var(--acc-line); }
.chip .n { opacity: .6; margin-left: 5px; }

/* ---------------------------------------------------------- 模态 */
.modal-root:empty { display: none; }
.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: rgba(4,7,10,.72); backdrop-filter: blur(5px);
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0 } }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -30px #000; animation: rise .2s var(--ease);
}
@keyframes rise { from { transform: translateY(10px) scale(.99); opacity: 0 } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14.5px; font-weight: 640; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }

/* ---------------------------------------------------------- 吐司 */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--panel-3); border: 1px solid var(--line-2); border-left: 2px solid var(--text-3);
  box-shadow: var(--shadow-2); font-size: 12px; color: var(--text-2);
  animation: toastIn .22s var(--ease);
}
@keyframes toastIn { from { transform: translateX(14px); opacity: 0 } }
.toast.ok { border-left-color: var(--acc); }
.toast.warn { border-left-color: var(--amber); }
.toast.err { border-left-color: var(--red); }
.toast .t-body { min-width: 0; word-break: break-word; }
.toast b { display: block; color: var(--text); font-weight: 600; margin-bottom: 1px; }

/* ---------------------------------------------------------- KV 明细 */
.kv { display: grid; grid-template-columns: minmax(96px, 168px) 1fr; gap: 0; font-size: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.kv > dt, .kv > dd { padding: 8px 12px; border-bottom: 1px solid rgba(29,38,52,.6); margin: 0; }
.kv > dt { color: var(--text-4); background: var(--panel-2); font-size: 11px; letter-spacing: .04em; }
.kv > dd { color: var(--text); word-break: break-word; }
.kv > dt:last-of-type, .kv > dd:last-of-type { border-bottom: 0; }
.kv dd.mono { font-family: var(--mono); font-size: 11.5px; }

/* ---------------------------------------------------------- 图表 */
.chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 52px; gap: 10px; align-items: center; font-size: 11.5px; }
.bar-row .lbl { display: flex; align-items: center; gap: 7px; color: var(--text-2); min-width: 0; }
.bar-row .lbl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc-2), var(--acc)); transition: width .5s var(--ease); }
.bar-row .num { text-align: right; font: 600 11.5px var(--mono); color: var(--text-2); }

/* ---------------------------------------------------------- 代码块工具条 */
.codebox { position: relative; }
.codebox .cb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.codebox .cb-head span { font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); }
.codebox .cb-head .btn { margin-left: auto; }

/* 布局小工具 */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 14px } .mt-3 { margin-top: 22px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 14px }
.muted { color: var(--text-3); }
.dim { color: var(--text-4); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .cols-2 { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 44px; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s var(--ease); box-shadow: 20px 0 50px -20px #000; }
  .sidebar.open { transform: none; }
  .shell { margin-left: 0; }
  .burger { display: inline-grid; }
  .view { padding: 18px 14px 36px; }
  .bottombar { padding: 9px 14px; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); }
  .topbar { padding: 0 14px; }
  #clock { display: none; }
  .grid-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .ev { grid-template-columns: 76px 1fr; }
  .ev .ev-meta { display: none; }
  .kv { grid-template-columns: minmax(84px, 120px) 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
