:root {
  --bg: #060c17;
  --bg-glow: #0d2038;
  --panel: #0f1c2e;
  --panel-2: #0c1727;
  --line: #1d2f49;
  --text: #e8f0fb;
  --muted: #7e93b3;
  --green: #22c55e;
  --blue: #38bdf8;
  --red: #f05252;
  --amber: #f59e0b;
  --purple: #a78bfa;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 18% -10%, rgba(56, 189, 248, .16), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(34, 197, 94, .12), transparent 55%),
    var(--bg);
  font-size: 14px;
}

a { color: var(--blue); text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 28, .85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #0ea5e9);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #04121f;
  font-weight: 800;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.topnav a, .topnav button {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.topnav a:hover, .topnav button:hover { color: var(--text); background: #122136; }
.topnav .active { color: #071a10; background: var(--green); font-weight: 600; }
.topnav .active:hover { background: #2ee06c; color: #071a10; }

/* ---------- 概览 ---------- */
.hero {
  text-align: center;
  padding: 34px 20px 10px;
}

.hero-date { color: var(--muted); font-size: 13px; letter-spacing: 1px; }

.hero-clock {
  font-size: 46px;
  font-weight: 300;
  letter-spacing: 3px;
  margin: 4px 0 16px;
  font-variant-numeric: tabular-nums;
}

.hero-totals { display: flex; justify-content: center; gap: 70px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .label { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.hero-stat .value { font-size: 26px; font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.hero-stat.down .value { color: var(--green); }

/* ---------- 过滤栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 22px 8px;
  max-width: 1500px;
  margin: 0 auto;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.chip:hover { color: var(--text); }
.chip.on { background: #12304b; border-color: #2b5f86; color: #cfe9ff; }
.chip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.toolbar .spacer { flex: 1; }

.toolbar select, .toolbar input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  min-width: 110px;
}

.toolbar input { min-width: 200px; }
.toolbar select:focus, .toolbar input:focus { border-color: #2b5f86; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { border-color: #2b5f86; }
.btn.primary { background: var(--green); color: #05170d; border-color: var(--green); font-weight: 600; }
.btn.primary:hover { background: #2ee06c; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb4b4; border-color: #4a2028; }
.btn.danger:hover { background: #2a1218; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 节点卡片 ---------- */
.grid {
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px 22px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, #0d1b2c, #0a1422);
  border: 1px solid #1b2f47;
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, transform .15s;
}

.card:hover { border-color: #2b5f86; transform: translateY(-1px); }

.card-head { display: flex; align-items: center; gap: 8px; }
.card-name { font-size: 18px; font-weight: 700; letter-spacing: .3px; margin-right: 2px; }
.card-alias { color: var(--muted); font-size: 11px; margin-left: auto; }

.pill {
  font-size: 11px;
  line-height: 1;
  color: #b9cbe1;
  background: #0c1a2a;
  border: 1px solid #223a55;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}
.pill:hover { color: #fff; border-color: #2b5f86; }
.pill-green {
  margin-left: auto;
  color: #d8ffe9;
  background: linear-gradient(180deg, #1e7a4e, #17603d);
  border-color: #2f9d66;
}
.pill-green:hover { color: #fff; border-color: #43c085; }

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.card-meta .mono { font-family: ui-monospace, Menlo, Consolas, monospace; color: #9fb6d4; letter-spacing: .3px; }
.card-meta .sep { color: #3c5675; }
.card-meta .meta-host { color: #cfe0f5; }

.mini {
  font-size: 10px;
  color: #9fd4ff;
  background: #0e2137;
  border: 1px solid #1b3550;
  border-radius: 5px;
  padding: 1px 6px;
  cursor: pointer;
  font-family: inherit;
}
.mini:hover { border-color: #2b5f86; color: #fff; }

.card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-tags .badge { margin-left: auto; }
.tag-btn { cursor: pointer; font-family: inherit; padding: 4px 11px; border-radius: 999px; }
.tag-btn:hover { border-color: #2b5f86; color: #fff; }
.tag-btn.danger { color: #ffb4b4; border-color: #4a2028; background: #24101a; }
.tag-btn.danger:hover { background: #2a1218; }

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge.online { color: #8ef0b6; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); }
.badge.offline { color: #9fb0c8; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .3); }
.badge.error { color: #ffc9a8; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
.badge.pending { color: #c3b6ff; background: rgba(167, 139, 250, .12); border-color: rgba(167, 139, 250, .35); }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  color: #9fb6d4;
  background: #0e2137;
  border: 1px solid #1b3550;
  border-radius: 6px;
  padding: 2px 7px;
}

.tag.shell { color: #ffd08a; border-color: #4a3517; background: #2a1f10; }
.tag.ip { color: #a9d9ff; }

.rate-row { display: flex; gap: 10px; }
.rate-box {
  flex: 1;
  background: linear-gradient(180deg, #08131f, #0a1827);
  border: 1px solid #172a41;
  border-radius: 10px;
  padding: 8px 10px;
}
.rate-box .k { font-size: 11px; color: var(--muted); }
.rate-box .v {
  font-size: 18px;
  font-weight: 700;
  color: #f87171;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.rate-box .arrow { font-size: 13px; }
.rate-box.down .v { color: #34d399; }

.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tile { background: #08131f; border: 1px solid #16283d; border-radius: 9px; padding: 7px 9px; }
.tile-k { font-size: 10px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
.tile-v {
  font-size: 14px;
  font-weight: 700;
  color: #e8f0fb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.metric .line b { color: #cfe0f5; font-weight: 600; font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 4px; background: #142238; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #22c55e, #38bdf8); }
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #f05252); }

.card-actions { display: flex; gap: 7px; margin-top: 2px; }
.card-actions button {
  flex: 1;
  font-size: 12.5px;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid #223a55;
  background: #0b1929;
  color: #b9cbe1;
  cursor: pointer;
  font-family: inherit;
}
.card-actions button:hover { border-color: #2b5f86; color: #fff; }
.card-actions button.primary { color: #8ef0b6; border-color: #2f6b4a; background: #0c2419; }
.card-actions button.primary:hover { background: #103024; }
.card-actions button.warn { color: #ffb4b4; border-color: #4a2028; }
.card-actions button.warn:hover { background: #2a1218; }
.card-actions button:disabled { opacity: .4; cursor: not-allowed; }

.card-foot { font-size: 10px; color: #5f7695; text-align: right; }

/* ---------- 空状态 ---------- */
.empty {
  max-width: 620px;
  margin: 40px auto 80px;
  text-align: center;
  background: var(--panel-2);
  border: 1px dashed #24405e;
  border-radius: 14px;
  padding: 44px 30px;
}

.empty h3 { margin: 0 0 8px; font-size: 18px; }
.empty p { color: var(--muted); margin: 0 0 20px; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 15, .72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.mask.show { display: flex; }

/* ---------- 自定义对话框 ---------- */
.ui-dialog {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, #102033, #0b1626);
  border: 1px solid #24405e;
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

.ui-dialog h3 { margin: 0 0 8px; font-size: 15px; }
.ui-dialog p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.6; }

.ui-dialog .ui-input {
  width: 100%;
  box-sizing: border-box;
  margin: 2px 0 14px;
  background: #08131f;
  border: 1px solid #24405e;
  border-radius: 8px;
  padding: 9px 10px;
  color: #e8f0fb;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.ui-dialog .ui-input:focus { border-color: #38bdf8; }

.ui-actions { display: flex; justify-content: flex-end; gap: 8px; }

.ui-actions button {
  font-size: 12.5px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid #24405e;
  background: #0d1b2c;
  color: #b9cbe1;
  cursor: pointer;
  font-family: inherit;
}

.ui-actions button:hover { border-color: #2b5f86; color: #fff; }
.ui-actions .ui-ok { background: #1d4ed8; border-color: #2563eb; color: #fff; }
.ui-actions .ui-ok:hover { background: #2563eb; }
.ui-actions .ui-ok.danger { background: #b91c1c; border-color: #dc2626; }
.ui-actions .ui-ok.danger:hover { background: #dc2626; }

.dialog {
  width: min(760px, 100%);
  max-height: 84vh;
  overflow: auto;
  background: #0e1a2b;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}

.dialog h3 { margin: 0 0 4px; font-size: 17px; }
.dialog .sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.dialog table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dialog th, .dialog td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #16273c; }
.dialog th { color: var(--muted); font-weight: 500; }
.dialog .close { float: right; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 16px;
}

.auth-card {
  width: min(400px, 100%);
  background: rgba(15, 28, 46, .92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}

.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card .tip { color: var(--muted); font-size: 12px; margin: 0 0 22px; line-height: 1.6; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  background: #0a1524;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.field input:focus { border-color: #2b5f86; }

.auth-card .btn.primary { width: 100%; padding: 11px; font-size: 14px; margin-top: 6px; }
.auth-card .alt { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

.msg { font-size: 12px; min-height: 18px; margin: 4px 0 0; }
.msg.err { color: #ff9b9b; }
.msg.ok { color: #8ef0b6; }

/* ---------- 绑定页 ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 40px 22px 80px; }
.panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
}
.panel h2 { margin: 0 0 6px; font-size: 17px; }
.panel .desc { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0 0 18px; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel input {
  flex: 1;
  min-width: 200px;
  background: #0a1524;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.code {
  margin-top: 16px;
  background: #08111d;
  border: 1px solid #17304a;
  border-radius: 10px;
  padding: 14px 14px 14px 16px;
  font-family: Consolas, Menlo, monospace;
  font-size: 12.5px;
  color: #a9d9ff;
  word-break: break-all;
  line-height: 1.7;
}

.steps { color: var(--muted); font-size: 13px; line-height: 2; padding-left: 18px; margin: 0 0 16px; }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b1929;
  border: 1px solid #172a41;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px;
}

.foot { text-align: center; color: #4c6484; font-size: 12px; padding: 26px 0 40px; }

/* ---------- 告警铃铛 ---------- */
.bell-wrap { position: relative; }

.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bell-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.alert-panel {
  position: absolute;
  right: 0;
  top: 38px;
  width: 360px;
  max-height: 440px;
  overflow: auto;
  background: #0d1a2c;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .55);
  z-index: 60;
}

.alert-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.alert-head button {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.alert-head button:hover { color: var(--text); border-color: #2b5f86; }

.alert-list { display: flex; flex-direction: column; }

.alert-item {
  padding: 10px 14px;
  border-bottom: 1px solid #142539;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.alert-item:hover { background: #101f33; }
.alert-item.unread { border-left: 2px solid var(--amber); }
.alert-item.critical.unread { border-left-color: var(--red); }
.alert-item.resolved { opacity: .55; }
.alert-item .ai-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text); }
.alert-item .ai-top span { color: #5d7594; font-size: 11px; }
.alert-item .ai-msg { color: var(--muted); font-size: 12px; line-height: 1.5; }
.alert-item .ai-foot { display: flex; gap: 5px; flex-wrap: wrap; }
.alert-empty { padding: 26px 0; text-align: center; color: #5d7594; font-size: 12px; }

/* ---------- 详情弹窗扩展 ---------- */
.dialog.wide { width: min(1000px, 100%); }
.dialog h4 { margin: 18px 0 6px; font-size: 13px; color: #9fb6d4; font-weight: 600; }
.dialog .muted { color: #7e93b3; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.detail-stats > div {
  background: #0b1929;
  border: 1px solid #172a41;
  border-radius: 9px;
  padding: 9px 12px;
}
.detail-stats span { display: block; color: var(--muted); font-size: 11px; }
.detail-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }

.tchart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 6px 4px 0;
  border-bottom: 1px solid #16273c;
}
.tcol {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.tcol .tvals { font-size: 10px; color: #7e93b3; white-space: nowrap; }
.tcol .tbars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.tcol .tbars i { width: 42%; max-width: 22px; border-radius: 3px 3px 0 0; display: block; }
.tcol .tbars .tdown { background: linear-gradient(180deg, #34d399, #16a34a); }
.tcol .tbars .tup { background: linear-gradient(180deg, #60d5fb, #0ea5e9); }
.tcol .tday { font-size: 10.5px; color: #6d84a2; padding-bottom: 4px; }

.tlegend { display: flex; gap: 16px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 7px 2px 0; }
.tlegend .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.tlegend .muted { margin-left: auto; color: #566e8c; }

/* ---------- 管理后台 ---------- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.admin-stats .stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.admin-stats .stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.admin-stats .stat b { font-size: 24px; font-variant-numeric: tabular-nums; color: var(--blue); }
.admin-stats .stat.green b { color: var(--green); }
.admin-stats .stat.amber b { color: var(--amber); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid #16273c; }
.admin-table th { color: var(--muted); font-weight: 500; }

/* ---------- 资源趋势 ---------- */
.manage-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.manage-row .btn { padding: 5px 12px; font-size: 12px; }

.range-tabs { display: flex; gap: 6px; margin: 2px 0 8px; }
.range-tabs button {
  border: 1px solid var(--line);
  background: #0b1929;
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 11px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.range-tabs button:hover { color: var(--text); }
.range-tabs button.on { background: #12304b; border-color: #2b5f86; color: #cfe9ff; }

.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.trend-card { background: #0b1929; border: 1px solid #172a41; border-radius: 10px; padding: 9px 11px; }
.trend-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.trend-head b { color: #cfe0f5; font-variant-numeric: tabular-nums; }
.trend-svg { width: 100%; height: 86px; display: block; }
.trend-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: #566e8c; margin-top: 4px; }
.trend-empty { font-size: 12px; color: #566e8c; padding: 24px 0; text-align: center; }

/* ---------- 告警设置 ---------- */
.alert-head-actions { display: flex; gap: 6px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.settings-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.settings-grid input {
  background: #0a1524;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.settings-grid input:focus { border-color: #2b5f86; }

/* ---------- 管理后台操作 ---------- */
.admin-table .row-actions { display: flex; gap: 6px; }
.admin-table .mini {
  border: 1px solid var(--line);
  background: #0d1b2c;
  color: #b9cbe1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}
.admin-table .mini:hover { border-color: #2b5f86; color: #fff; }
.admin-table .mini.warn { color: #ffb4b4; border-color: #4a2028; }
.admin-table .mini.warn:hover { background: #2a1218; }
.badge.disabled { color: #9fb0c8; background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .35); }

/* ---------- 管理后台：侧边栏布局（深色，与控制台一致） ---------- */
.admin-body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 18% -10%, rgba(56, 189, 248, .16), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(34, 197, 94, .12), transparent 55%),
    var(--bg);
}
.admin-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.admin-side {
  width: 236px;
  flex: 0 0 236px;
  height: 100vh;
  position: sticky;
  top: 0;
  box-sizing: border-box;
  background: rgba(9, 18, 32, .92);
  border-right: 1px solid var(--line);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(10px);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--line);
}
.admin-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), #0ea5e9);
  color: #04121f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-brand-text b { font-size: 13.5px; color: var(--text); }
.admin-brand-text small { font-size: 11px; color: var(--muted); }

.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9fb3cf;
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.admin-nav button svg { width: 17px; height: 17px; flex: none; }
.nav-ico {
  width: 30px;
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(56, 189, 248, .12);
  color: var(--blue);
  transition: background .15s ease, color .15s ease;
}
.nav-ico.users { background: rgba(167, 139, 250, .15); color: var(--purple); }
.nav-ico.nodes { background: rgba(34, 197, 94, .14); color: var(--green); }
.nav-ico.alerts { background: rgba(245, 158, 11, .15); color: var(--amber); }
.nav-ico.audits { background: rgba(129, 140, 248, .15); color: #818cf8; }
.admin-nav button:hover { background: rgba(56, 189, 248, .08); color: var(--text); }
.admin-nav button.active {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #fff;
  box-shadow: 0 8px 20px rgba(14, 165, 233, .3);
}
.admin-nav button.active .nav-ico { background: rgba(255, 255, 255, .2); color: #fff; }

.admin-side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.admin-side-foot a,
.admin-side-foot button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d1b2c;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.admin-side-foot a:hover,
.admin-side-foot button:hover { color: var(--blue); border-color: #2b5f86; background: #102338; }

.admin-main { flex: 1; min-width: 0; padding: 24px 28px 44px; }
.admin-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-top h1 { margin: 0 0 4px; font-size: 22px; color: var(--text); }
.admin-top p { margin: 0; font-size: 12.5px; color: var(--muted); }
.admin-user {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(15, 28, 46, .9);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.admin-user b { color: var(--text); }

.admin-view { display: none; }
.admin-view.active { display: block; }

.admin-main .panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 8px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.admin-main .panel h2 { margin: 0 0 4px; font-size: 15px; color: var(--text); }
.admin-main .panel .desc { margin: 0 0 12px; font-size: 12px; color: var(--muted); }

.admin-main .admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-main .stat {
  background: linear-gradient(180deg, #10203a, var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.admin-main .stat span { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.admin-main .stat b { font-size: 26px; color: var(--text); }
.admin-main .stat.green b { color: var(--green); }
.admin-main .stat.amber b { color: var(--amber); }

.admin-main .admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: auto;
}
.admin-main .admin-table th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: rgba(13, 27, 44, .9);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-main .admin-table td {
  padding: 10px;
  color: #c9d8ec;
  border-bottom: 1px solid #16273d;
  vertical-align: middle;
}
.admin-main .admin-table tbody tr:hover td { background: rgba(56, 189, 248, .05); }
.admin-main .admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-main .badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
}
.admin-main .badge.online { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: rgba(34, 197, 94, .35); }
.admin-main .badge.offline { background: rgba(148, 163, 184, .12); color: #9fb0c8; border-color: rgba(148, 163, 184, .3); }
.admin-main .badge.error { background: rgba(240, 82, 82, .14); color: #ff9b9b; border-color: rgba(240, 82, 82, .35); }
.admin-main .badge.pending { background: rgba(245, 158, 11, .14); color: #fbbf24; border-color: rgba(245, 158, 11, .32); }
.admin-main .badge.disabled { background: rgba(148, 163, 184, .12); color: #9fb0c8; border-color: rgba(148, 163, 184, .3); }

.admin-main .row-actions { display: flex; gap: 6px; }
.admin-main .mini {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0d1b2c;
  color: #b9cbe1;
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.admin-main .mini:hover { color: #fff; border-color: #2b5f86; background: #102338; }
.admin-main .mini.warn { color: #ffb4b4; border-color: #4a2028; }
.admin-main .mini.warn:hover { background: #2a1218; }
.admin-main .btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #fff;
  font-size: 12.5px;
  text-decoration: none;
}

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-side {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 12px;
    gap: 12px;
  }
  .admin-brand { padding-bottom: 10px; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .admin-nav button { width: auto; white-space: nowrap; padding: 8px 12px; }
  .admin-side-foot { flex-direction: row; margin-top: 0; border-top: 0; padding-top: 0; }
  .admin-side-foot a, .admin-side-foot button { width: auto; flex: 1; }
  .admin-main { padding: 16px 14px 32px; }
  .admin-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-main .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
