@font-face {
  font-family: 'SanJiNengLiangHei';
  src: url('fonts/SanJiNengLiangHei.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --navy: #0b1220;
  --navy-2: #0f172a;
  --accent: #2563eb;
  --accent-2: #38bdf8;
  --violet: #7c3aed;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --bg: #eef2f7;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'SanJiNengLiangHei', var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--mono); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ 登录页 ============ */
.login-body {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 8% -10%, #16264a 0%, transparent 55%),
              radial-gradient(900px 600px at 100% 0%, #0b3a52 0%, transparent 50%),
              linear-gradient(160deg, #0b1220 0%, #0a1526 55%, #081020 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  overflow-x: hidden;
}
.login-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.login-bg .glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.login-bg .g1 { width: 520px; height: 520px; left: -140px; top: -120px; background: #1d4ed8; }
.login-bg .g2 { width: 460px; height: 460px; right: -120px; bottom: -160px; background: #0891b2; opacity: .35; }
.login-bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,163,184,.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148,163,184,.08) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 72%);
}
.login-wrap { position: relative; width: 100%; max-width: 430px; animation: rise .6s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-left: 4px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff; font-weight: 800; font-size: 21px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(37,99,235,.4);
}
.brand-name { color: #f8fafc; font-weight: 800; letter-spacing: .04em; font-size: 17px; }
.brand-sub { color: #7dd3fc; font-size: 9.5px; letter-spacing: .22em; margin-top: 2px; }

.login-card {
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 24px;
  padding: 34px 32px 24px;
  box-shadow: 0 30px 80px rgba(2,6,23,.55), 0 2px 0 rgba(255,255,255,.6) inset;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.login-eyebrow { font-size: 10.5px; letter-spacing: .22em; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.login-card h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
.login-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
.lfield { display: block; margin-bottom: 14px; }
.lfield span { display: block; font-size: 12.5px; font-weight: 700; color: #334155; margin-bottom: 7px; }
.lfield input {
  width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 14px; font-size: 15px; font-family: inherit; color: var(--text);
  background: #f8fafc; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.lfield input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.login-err {
  display: none; font-size: 12.5px; color: #b91c1c; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 9px; padding: 9px 12px; margin-bottom: 12px;
}
.login-err.show { display: block; }
.login-btn {
  width: 100%; height: 48px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #0ea5e9);
  color: #fff; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 24px rgba(37,99,235,.32);
  transition: transform .2s var(--ease), box-shadow .2s, opacity .2s;
}
.login-btn svg { width: 18px; height: 18px; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(37,99,235,.4); }
.login-btn:active { transform: scale(.99); }
.login-btn[disabled] { opacity: .65; cursor: wait; }
.login-btn.loading::after {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-foot {
  display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #f1f5f9; font-size: 11.5px; color: #94a3b8;
}
.login-meta { text-align: center; margin-top: 18px; font-size: 11.5px; color: #64748b; letter-spacing: .03em; }
form.shake { animation: shake .38s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ============ 应用框架 ============ */
.app-body { background: var(--bg); min-height: 100vh; }
.app-body.modal-open { overflow: hidden; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11,18,32,.93);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(148,163,184,.14);
  box-shadow: 0 10px 30px rgba(2,6,23,.18);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; height: 66px; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.tb-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tb-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.tb-name { color: #f1f5f9; font-size: 15.5px; font-weight: 800; letter-spacing: .01em; }
.tb-sub { color: #64748b; font-size: 9px; letter-spacing: .2em; margin-top: 2px; }
.tb-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  color: #86efac; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25);
  padding: 4px 10px; border-radius: 999px;
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: ping 2s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.tb-clock { font-family: var(--mono); font-size: 12.5px; color: #94a3b8; letter-spacing: .04em; }
.tb-user {
  display: inline-flex; align-items: center; gap: 7px; color: #e2e8f0; font-size: 12.5px; font-weight: 600;
  background: rgba(148,163,184,.1); border: 1px solid rgba(148,163,184,.16);
  border-radius: 999px; padding: 4px 12px 4px 5px;
}
.tb-user i {
  width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: 9px; border: 1px solid rgba(148,163,184,.2);
  background: rgba(148,163,184,.08); color: #cbd5e1;
  font-size: 12.5px; font-weight: 600; transition: background .2s, color .2s, border-color .2s;
}
.tb-btn svg { width: 14px; height: 14px; }
.tb-btn:hover { background: rgba(148,163,184,.16); color: #f8fafc; }
.tb-btn.ghost { background: transparent; }
.tb-btn.spinning svg { animation: spin .8s linear; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 22px 46px; }

.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .2em; color: var(--accent); margin-bottom: 7px; }
.eyebrow.light { color: #60a5fa; }

/* 概览 */
.hero {
  background: #fff; border: 1px solid var(--border); border-radius: 22px;
  padding: 26px; box-shadow: 0 12px 34px rgba(15,23,42,.06);
  animation: rise .55s var(--spring) both;
}
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h1 { font-size: 29px; letter-spacing: -.02em; margin-bottom: 7px; }
.hero-head p { font-size: 13.5px; color: var(--muted); }
.hero-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding-top: 6px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: ping 2s infinite; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stat {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(180deg, #f8fafc, #f4f7fb);
  border: 1px solid #e8eef6; border-radius: 15px; padding: 15px 16px;
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.blue { background: #e0edff; color: #2563eb; }
.stat-icon.violet { background: #efe8ff; color: #7c3aed; }
.stat-icon.emerald { background: #dcfce7; color: #15803d; }
.stat-icon.amber { background: #fef3c7; color: #b45309; }
.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-num { font-size: 23px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.stat-label { font-size: 11.5px; color: var(--muted); }

/* 拓扑 */
.topology {
  margin-top: 22px; border-radius: 22px; padding: 24px 26px 12px;
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(37,99,235,.22), transparent 60%),
    radial-gradient(700px 400px at 95% 100%, rgba(8,145,178,.16), transparent 55%),
    linear-gradient(150deg, #0b1220 0%, #0e1a2e 55%, #0a1424 100%);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 18px 50px rgba(2,6,23,.35);
  color: #e2e8f0;
  animation: rise .65s var(--spring) both;
}
.tp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tp-head h2 { font-size: 21px; margin-bottom: 6px; color: #f8fafc; }
.tp-head p { font-size: 12.5px; color: #94a3b8; max-width: 720px; line-height: 1.6; }
.tp-legend { display: flex; gap: 14px; font-size: 11.5px; color: #94a3b8; padding-top: 4px; }
.tp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.lg.green { background: #22c55e; }
.lg.amber { background: #f59e0b; }
.lg.red { background: #ef4444; }
.lg.grey { background: #64748b; }
.tp-canvas { margin-top: 8px; }
.tp-canvas svg { width: 100%; height: auto; display: block; }
.tp-lines path {
  fill: none; stroke: rgba(96,165,250,.5); stroke-width: 1.6;
  stroke-dasharray: 6 7; animation: flow 18s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -260; } }
.tp-node rect { fill: rgba(148,163,184,.05); stroke: rgba(148,163,184,.22); stroke-width: 1.1; }
.tp-node.core rect { fill: rgba(37,99,235,.13); stroke: rgba(96,165,250,.55); stroke-width: 1.4; filter: url(#tpGlow); }
.tp-node.cf rect { fill: rgba(245,158,11,.07); stroke: rgba(245,158,11,.32); }
.tp-t1 { fill: #e2e8f0; font-size: 13.5px; font-weight: 700; }
.tp-t2 { fill: #93a4c3; font-size: 10.5px; }
.tp-t3 { fill: #64748b; font-size: 9.8px; }
.tp-sep { stroke: rgba(148,163,184,.16); stroke-width: 1; }
.tp-dot { fill: #64748b; }
.tp-dot.green { fill: #22c55e; animation: dotPulse 2.2s infinite; }
.tp-dot.amber { fill: #f59e0b; }
.tp-dot.red { fill: #ef4444; }
.tp-dot.grey { fill: #64748b; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* 区块 */
.section { margin-top: 28px; animation: rise .7s var(--spring) both; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 15px; }
.sec-head h2 { font-size: 22px; letter-spacing: -.01em; margin-bottom: 5px; }
.sec-head p { font-size: 12.5px; color: var(--muted); }
.sec-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }

/* 服务器卡片 */
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.srv {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 20px; box-shadow: 0 10px 28px rgba(15,23,42,.06);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.srv:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.1); border-color: #d7e2ef; }
.srv.offline { background: #fbfcfe; }
.srv.offline .srv-avatar { filter: grayscale(.65); opacity: .75; }
.srv-top { display: flex; align-items: flex-start; gap: 12px; }
.srv-avatar {
  width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13.5px; font-weight: 800; letter-spacing: .03em;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
}
.srv-avatar.blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.srv-avatar svg { width: 24px; height: 24px; display: block; }
.srv-avatar.violet { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.srv-avatar.emerald { background: linear-gradient(135deg, #059669, #34d399); }
.srv-avatar.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.srv-id { flex: 1; min-width: 0; }
.srv-id h3 { font-size: 17px; letter-spacing: -.01em; margin-bottom: 3px; }
.srv-id p { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: #f1f5f9; color: #64748b;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { background: #dcfce7; color: #15803d; }
.status.warn { background: #fef3c7; color: #b45309; }
.status.off { background: #fee2e2; color: #b91c1c; }
.srv-role { font-size: 12px; color: #475569; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 9px; padding: 7px 11px; }

.gauges { display: flex; justify-content: space-around; gap: 6px; padding: 2px 0; }
.gauge-box { position: relative; width: 88px; height: 88px; }
.gauge { width: 88px; height: 88px; transform: rotate(-90deg); }
.g-bg { fill: none; stroke: #eef2f7; stroke-width: 7; }
.g-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); }
.g-fg.cpu { stroke: #2563eb; }
.g-fg.mem { stroke: #7c3aed; }
.g-fg.disk { stroke: #f59e0b; }
.gauge-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.gauge-txt b { font-size: 18px; letter-spacing: -.02em; }
.gauge-txt span { font-size: 10.5px; color: var(--muted); }

.spark-wrap { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 9px 12px 8px; }
.spark { width: 100%; height: 42px; display: block; }
.spark-line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: rgba(37,99,235,.1); stroke: none; }
.spark-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.spark-meta b { color: #334155; font-family: var(--mono); font-weight: 600; font-size: 11px; }
.spark-meta b.loss.ok { color: #059669; }
.spark-meta b.loss.warn { color: #b45309; }
.spark-meta b.loss.bad { color: #dc2626; }

.srv-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; border-top: 1px dashed #e8eef6; padding-top: 13px; }
.srv-specs div { min-width: 0; }
.srv-specs dt { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.srv-specs dd { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.svc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.svc {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: #15803d;
  background: #f0fdf4; border: 1px solid #dcfce7; border-radius: 7px; padding: 3px 8px;
}
.svc i { width: 5px; height: 5px; border-radius: 50%; background: #22c55e; }
.svc.off { color: #94a3b8; background: #f8fafc; border-color: #eef2f7; }
.svc.off i { background: #cbd5e1; }
.svc.none { color: #94a3b8; background: #f8fafc; border-color: #eef2f7; }

.srv-actions { display: flex; gap: 8px; margin-top: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 9px; height: 36px; padding: 0 13px; font-size: 12.5px; font-weight: 600;
  transition: background .2s, border-color .2s, transform .15s, color .2s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: #f8fafc; border-color: #d7e2ef; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #16233b; border-color: #16233b; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f1f5f9; color: var(--text); }
.btn.ghost.active { background: #e2e8f0; color: var(--text); }
.srv-actions .btn:nth-child(2) { flex: 1; }

/* 站点 */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: #475569;
  border-radius: 999px; height: 32px; padding: 0 14px; font-size: 12.5px; font-weight: 600;
  transition: all .2s var(--ease);
}
.chip:hover { border-color: #cbd5e1; background: #f8fafc; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(11,18,32,.18); }
.chip span { opacity: .65; margin-left: 4px; font-family: var(--mono); font-size: 11px; }

.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.site {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 20px;
  box-shadow: 0 10px 28px rgba(15,23,42,.055);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.site:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.09); border-color: #d7e2ef; }
.site[hidden] { display: none; }
.site-head { display: flex; align-items: center; gap: 12px; }
.site-icon {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
}
.site-icon svg { width: 24px; height: 24px; display: block; }
.site-icon.blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.site-icon.violet { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.site-icon.emerald { background: linear-gradient(135deg, #059669, #34d399); }
.site-icon.rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.site-icon.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.site-icon.indigo { background: linear-gradient(135deg, #4338ca, #818cf8); }
.site-icon.cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.site-icon.sky { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.site-icon.teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.site-icon.orange { background: linear-gradient(135deg, #ea580c, #fb923c); }
.site-icon.slate { background: linear-gradient(135deg, #475569, #94a3b8); }
.site-icon.red { background: linear-gradient(135deg, #b91c1c, #f87171); }
.site-name { min-width: 0; flex: 1; }
.site-name h3 { font-size: 16px; letter-spacing: -.01em; margin-bottom: 3px; }
.site-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); font-weight: 600; max-width: 100%; }
.site-link:hover { text-decoration: underline; }
.site-link svg { width: 11px; height: 11px; flex: 0 0 auto; }
.site-desc { font-size: 12.5px; color: #475569; line-height: 1.65; }
.site-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 10px; font-weight: 600; color: #64748b; background: #f1f5f9;
  border: 1px solid #e8eef6; border-radius: 6px; padding: 2px 7px;
}
.tag.type { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
.tag.alias { font-family: var(--mono); font-size: 9.5px; }
.cred-list { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 3px 11px; }
.cred-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #e6edf6; min-height: 34px; }
.cred-row:last-child { border-bottom: none; }
.cred-k { width: 34px; flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.cred-v { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-v a { color: var(--accent); font-weight: 600; }
.cred-v a:hover { text-decoration: underline; }
.cred-v.mono, .cred-val { font-family: var(--mono); font-size: 12px; }
.cred-v.muted { color: #94a3b8; }
.cred-val { transition: filter .2s; }
.mini {
  width: 26px; height: 26px; flex: 0 0 auto; border: none; background: transparent;
  border-radius: 6px; color: #94a3b8; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.mini svg { width: 14px; height: 14px; }
.mini:hover { background: #e8eef6; color: #334155; }
.cred-row.masked .cred-val { filter: blur(6px); }
.cred-row.masked .cred-val:hover { filter: none; }
body.creds-hidden .cred-val { filter: blur(6px); }
body.creds-hidden .cred-val:hover { filter: none; }
.site-path { font-family: var(--mono); font-size: 10.5px; color: #94a3b8; word-break: break-all; }
.site-note {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 11.5px; color: #b45309; background: #fffbeb; border: 1px solid #fef3c7;
  border-radius: 9px; padding: 8px 10px; line-height: 1.55;
}
.site-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

/* 提示 & 页脚 */
.notice {
  margin-top: 28px; display: flex; gap: 13px; align-items: flex-start;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 16px; padding: 16px 18px;
}
.notice-icon { width: 34px; height: 34px; border-radius: 10px; background: #fef3c7; color: #b45309; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.notice-icon svg { width: 18px; height: 18px; }
.notice strong { font-size: 13px; display: block; margin-bottom: 3px; color: #92400e; }
.notice p { font-size: 12px; color: #a16207; line-height: 1.6; }
.footer {
  max-width: 1240px; margin: 0 auto; padding: 0 22px 26px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: #94a3b8;
}

/* ============ 模态框 ============ */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: rgba(2,6,23,.68);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal.show { display: flex; animation: fadeIn .22s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.term-shell {
  width: min(1120px, 96vw); height: 82vh;
  background: #0b1220; border: 1px solid rgba(148,163,184,.2); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
  animation: popIn .3s var(--spring) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(10px); } to { opacity: 1; transform: none; } }
.term-head {
  height: 46px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: #0f1a2c; border-bottom: 1px solid rgba(148,163,184,.16);
}
.term-title { display: flex; align-items: center; gap: 10px; color: #e2e8f0; font-size: 12.5px; min-width: 0; }
.term-title strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-dots { display: inline-flex; gap: 5px; }
.term-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.term-dots i:nth-child(2) { background: #f59e0b; }
.term-dots i:nth-child(3) { background: #22c55e; }
.term-hint { color: #64748b; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-close {
  border: 1px solid rgba(148,163,184,.22); background: transparent; color: #cbd5e1;
  border-radius: 7px; height: 28px; padding: 0 11px; font-size: 11.5px;
}
.term-close:hover { background: rgba(148,163,184,.14); }
#termFrame { flex: 1; width: 100%; border: 0; background: #0b1220; }

.detail-shell {
  width: min(900px, 96vw); max-height: 88vh; background: #fff;
  border-radius: 20px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.45);
  animation: popIn .3s var(--spring) both;
}
.detail-shell.narrow { width: min(620px, 96vw); }
.detail-head {
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, #fbfdff, #fff);
}
.detail-head h2 { font-size: 21px; letter-spacing: -.01em; margin-bottom: 4px; }
.detail-head p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-close {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: #64748b; font-size: 19px; line-height: 1; flex: 0 0 auto;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.detail-body { padding: 20px 24px 26px; overflow-y: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.dcell { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 9px 12px; min-width: 0; }
.dcell span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.dcell b { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.detail-sec { margin-top: 20px; }
.detail-sec h3 { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 10px; }
.detail-sec h3 svg { width: 16px; height: 16px; color: var(--accent); }
.ssh-box { background: #0b1220; border-radius: 12px; padding: 10px 13px; }
.ssh-line { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid rgba(148,163,184,.12); }
.ssh-line:last-child { border-bottom: none; }
.ssh-line .k { width: 38px; flex: 0 0 auto; font-size: 10.5px; color: #64748b; }
.ssh-line code { flex: 1; min-width: 0; font-size: 12px; color: #e2e8f0; overflow-x: auto; white-space: nowrap; }
.ssh-box .mini { color: #94a3b8; }
.ssh-box .mini:hover { background: rgba(148,163,184,.18); color: #f8fafc; }
.ssh-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.ssh-note { font-size: 11.5px; color: #94a3b8; line-height: 1.6; margin-top: 10px; }
.dempty { display: flex; align-items: center; gap: 9px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: 13px 14px; font-size: 12.5px; }
.dempty svg { width: 17px; height: 17px; flex: 0 0 auto; }
.ver-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ver { font-family: var(--mono); font-size: 10.5px; color: #475569; background: #f1f5f9; border: 1px solid #e8eef6; border-radius: 6px; padding: 3px 8px; }
.net-box { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e8eef6; font-size: 12px; }
.net-box:last-child { border-bottom: none; }
.net-box span { color: var(--muted); flex: 0 0 auto; }
.net-box b { font-family: var(--mono); font-weight: 600; text-align: right; word-break: break-all; }
.nas-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #b45309; background: #fffbeb; border: 1px solid #fef3c7; border-radius: 10px; padding: 11px 12px; line-height: 1.6; margin-bottom: 13px; }
.nas-tip svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.nas-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.nas-meter div { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 12px; }
.nas-meter span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.nas-meter b { font-size: 12px; }
.mono { font-family: var(--mono); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 14px);
  background: #0b1220; color: #f8fafc; font-size: 12.5px; font-weight: 600;
  padding: 9px 18px; border-radius: 999px; box-shadow: 0 14px 34px rgba(2,6,23,.35);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 响应式 ============ */
@media (max-width: 1040px) {
  .server-grid, .site-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .tb-clock, .live-pill { display: none; }
  .wrap { padding: 18px 14px 40px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-num { font-size: 20px; }
  .topology { padding: 20px 16px 8px; }
  .tp-canvas { overflow-x: auto; }
  .tp-canvas svg { min-width: 860px; }
  .sec-head h2 { font-size: 19px; }
  .sec-actions { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .nas-meter { grid-template-columns: 1fr; }
  .term-shell { height: 88vh; border-radius: 12px; }
  .term-hint { display: none; }
  .modal { padding: 10px; }
  .footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 460px) {
  .login-card { padding: 26px 22px 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .gauges { justify-content: space-between; }
  .gauge-box, .gauge { width: 78px; height: 78px; }
  .srv-actions { flex-wrap: wrap; }
  .srv-actions .btn { flex: 1; }
  .cred-v { font-size: 12px; }
}
