/* ==========================================================================
   CloudPC 控制台样式
   ========================================================================== */
:root {
  --bg: #060a13;
  --bg-2: #080d19;
  --panel: #0d1526;
  --panel-2: #111b30;
  --panel-3: #16233c;
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e6edf7;
  --text-2: #aab9d0;
  --muted: #74869f;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --ok: #2dd4a7;
  --warn: #f5b544;
  --danger: #fb7185;
  --violet: #a78bfa;
  --radius: 18px;
  --shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(79, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(34, 211, 238, 0.06), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -0.2px; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--muted);
  text-transform: uppercase;
}
code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }

/* ==========================================================================
   通用控件
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { background: var(--panel-3); border-color: rgba(148, 163, 184, 0.35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, #5b95ff, #2f6bff);
  border-color: transparent;
  box-shadow: 0 12px 26px -14px rgba(79, 140, 255, 0.85);
}
.btn.primary:hover { background: linear-gradient(135deg, #6da1ff, #3d76ff); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: rgba(148, 163, 184, 0.08); }
.btn.danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); color: #ffb3bf; }
.btn.danger:hover { background: rgba(251, 113, 133, 0.2); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; height: 46px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 19, 0.65);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(79, 140, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.14);
}
.field small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { min-height: 18px; margin: 10px 0 0; color: #ff9aa8; font-size: 12.5px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.check div { display: flex; flex-direction: column; gap: 2px; }
.check strong { font-size: 13px; font-weight: 600; }
.check small { color: var(--muted); font-size: 11.5px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.online { color: #66f0cd; background: rgba(45, 212, 167, 0.10); border-color: rgba(45, 212, 167, 0.25); }
.pill.online .dot { box-shadow: 0 0 0 3px rgba(45, 212, 167, 0.14); animation: pulse 2.2s infinite; }
.pill.offline { color: #9fb0c8; }
.pill.provisioned { color: #8db4ff; background: rgba(79, 140, 255, 0.1); border-color: rgba(79, 140, 255, 0.24); }
.pill.quarantined { color: #ffd27a; background: rgba(245, 181, 68, 0.1); border-color: rgba(245, 181, 68, 0.28); }
.pill.wiped { color: #ff9aa8; background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.28); }
.pill.disabled { color: #8695ab; background: rgba(148, 163, 184, 0.06); }
.pill.lost { color: #ff9aa8; background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); }
.pill.violet { color: #c4b2ff; background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.24); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(45, 212, 167, 0.14); }
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 167, 0.03); }
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 100vh;
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 54px 64px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(900px 620px at 18% 12%, rgba(79, 140, 255, 0.24), transparent 62%),
    radial-gradient(760px 520px at 88% 88%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(160deg, #0a1020 0%, #060a13 68%);
}
.visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 34% 38%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 34% 38%, #000 0%, transparent 74%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.6px; margin-left: 6px; }
.brand-lg { font-size: 19px; position: relative; z-index: 2; }
.logo {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.22), rgba(34, 211, 238, 0.1));
  border: 1px solid rgba(79, 140, 255, 0.35);
  color: #7db0ff;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px -12px rgba(79, 140, 255, 0.8);
}
.logo svg { width: 24px; height: 24px; }

.visual-copy { position: relative; z-index: 2; max-width: 560px; }
.visual-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.18;
  letter-spacing: -1.2px;
  font-weight: 700;
}
.visual-copy h1 span {
  background: linear-gradient(100deg, #7db0ff, #4de3f7 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.visual-sub { margin: 0 0 26px; color: var(--text-2); font-size: 14.5px; line-height: 1.75; max-width: 470px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feature-list li { display: flex; align-items: center; gap: 11px; color: var(--text-2); font-size: 13.5px; }
.feature-list li i {
  width: 18px; height: 18px; border-radius: 6px; flex: none;
  background: rgba(45, 212, 167, 0.12);
  border: 1px solid rgba(45, 212, 167, 0.32);
  position: relative;
}
.feature-list li i::after {
  content: ""; position: absolute; left: 5px; top: 5px; width: 6px; height: 3px;
  border-left: 2px solid #5ef0c6; border-bottom: 2px solid #5ef0c6; transform: rotate(-45deg);
}
.visual-orbit {
  position: absolute;
  right: -170px;
  bottom: -190px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  border: 1px solid rgba(79, 140, 255, 0.16);
  pointer-events: none;
}
.visual-orbit::before, .visual-orbit::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(79, 140, 255, 0.10);
}
.visual-orbit::before { inset: 84px; }
.visual-orbit::after { inset: 176px; background: radial-gradient(circle, rgba(79, 140, 255, 0.10), transparent 70%); }
.visual-orbit .node {
  position: absolute;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(10, 16, 32, 0.78);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  color: #9fb6dd;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.9);
  animation: float 7s ease-in-out infinite;
}
.visual-orbit .n1 { left: 4%; top: 34%; color: #7db0ff; }
.visual-orbit .n2 { left: 38%; top: 9%; animation-delay: -2.4s; }
.visual-orbit .n3 { left: 52%; top: 54%; color: #5ef0c6; animation-delay: -4.2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.visual-foot { position: relative; z-index: 2; color: #5d6f8b; font-size: 11.5px; letter-spacing: 0.4px; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(180deg, rgba(8, 13, 25, 0.4), rgba(6, 10, 19, 0.9));
}
.login-card {
  width: min(392px, 100%);
  padding: 38px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.85), rgba(10, 16, 30, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}
.login-mark {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #4f8cff, #22d3ee);
  color: #04101f; font-weight: 800; letter-spacing: -1px; font-size: 17px;
  margin-bottom: 20px;
  box-shadow: 0 14px 30px -14px rgba(79, 140, 255, 0.9);
}
.login-card h2 { margin: 0 0 4px; font-size: 23px; letter-spacing: -0.4px; }
.login-card > p.muted { margin: 0 0 24px; font-size: 13px; }
.login-hint { margin: 18px 0 0; font-size: 11.5px; color: #5d6f8b; text-align: center; }
.login-hint code { font-size: 10.5px; padding: 1px 5px; }

/* ==========================================================================
   应用骨架
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 252px;
  flex: 0 0 252px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(7, 12, 23, 0.72);
  backdrop-filter: blur(20px);
  z-index: 20;
}
.sidebar .brand { padding: 0 8px 26px; }
.nav-label {
  padding: 0 12px;
  margin: 6px 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #53637c;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #93a5bf;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: 0.16s ease;
}
.nav-item .ico { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav-item .ico svg { width: 18px; height: 18px; display: block; }
.nav-item:hover { background: rgba(148, 163, 184, 0.07); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.16), rgba(79, 140, 255, 0.04));
  border-color: rgba(79, 140, 255, 0.22);
  color: #cfe0ff;
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #4f8cff, #22d3ee);
}
.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #9fb0c8;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-badge:empty { display: none; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.link-state {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.04);
  font-size: 11.5px;
  color: var(--muted);
}
.link-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.link-state.on { color: #6ee7c5; border-color: rgba(45, 212, 167, 0.22); background: rgba(45, 212, 167, 0.06); }
.link-state.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(45, 212, 167, 0.12); }
.link-state.off { color: #ff9aa8; border-color: rgba(251, 113, 133, 0.22); }
.link-state.off i { background: var(--danger); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 27, 48, 0.55);
}
.avatar {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.4), rgba(34, 211, 238, 0.25));
  border: 1px solid rgba(79, 140, 255, 0.3);
  font-size: 12px; font-weight: 700; color: #cfe0ff;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { font-size: 12.5px; }
.user-meta span { font-size: 10.5px; color: var(--muted); }
.user-chip .icon-btn { margin-left: auto; }
.version { text-align: center; font-size: 10px; color: #46566e; letter-spacing: 0.4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 19, 0.72);
  backdrop-filter: blur(18px);
}
.page-heading h1 { margin: 0; font-size: 21px; letter-spacing: -0.4px; }
.page-heading p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 4px; }
.view { padding: 28px 32px 72px; max-width: 1560px; width: 100%; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 60px 0; justify-content: center; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   卡片 / 概览
   ========================================================================== */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.72), rgba(10, 16, 30, 0.82));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 0;
}
.card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: -0.1px; }
.card-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.card-body { padding: 18px 22px 22px; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 28px 30px;
  margin-bottom: 20px;
  border: 1px solid rgba(79, 140, 255, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(700px 300px at 8% 0%, rgba(79, 140, 255, 0.2), transparent 60%),
    radial-gradient(600px 300px at 92% 100%, rgba(34, 211, 238, 0.1), transparent 60%),
    linear-gradient(120deg, rgba(17, 27, 48, 0.9), rgba(9, 15, 28, 0.92));
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 20% 20%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 20% 20%, #000, transparent 70%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -0.7px; }
.hero h2 b { color: #8ec1ff; font-weight: 700; }
.hero p { margin: 0; color: var(--text-2); font-size: 13px; max-width: 620px; }
.hero-chain { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex: none; }
.chain-node {
  min-width: 92px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 19, 0.6);
  text-align: center;
}
.chain-node small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.6px; }
.chain-node strong { display: block; font-size: 17px; margin-top: 2px; }
.chain-link { width: 26px; height: 1px; background: linear-gradient(90deg, rgba(79, 140, 255, 0.2), #4f8cff); position: relative; }
.chain-link::after { content: ""; position: absolute; right: 0; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: #4f8cff; box-shadow: 0 0 8px #4f8cff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  padding: 18px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 27, 48, 0.7), rgba(10, 16, 30, 0.75));
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 140, 255, 0.55), transparent);
  opacity: 0.55;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11.5px; }
.stat-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.2);
  color: #8db4ff;
}
.stat-ico svg { width: 15px; height: 15px; }
.stat-value { margin: 12px 0 2px; font-size: 32px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat-foot { font-size: 11.5px; color: var(--muted); }
.stat-foot b { color: var(--ok); font-weight: 600; }
.stat.warn .stat-ico { background: rgba(245, 181, 68, 0.1); border-color: rgba(245, 181, 68, 0.2); color: #ffd27a; }
.stat.danger .stat-ico { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.2); color: #ff9aa8; }
.stat.violet .stat-ico { background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.2); color: #c4b2ff; }

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
.grid.equal { grid-template-columns: 1fr 1fr; }
.section-gap { margin-top: 20px; }

/* 状态分布 */
.dist { display: flex; gap: 22px; align-items: center; padding: 6px 0 2px; }
.donut {
  width: 132px; height: 132px; border-radius: 50%; flex: none;
  position: relative;
  background: conic-gradient(#2dd4a7 0deg, #2dd4a7 var(--online, 0deg), #4f8cff var(--online, 0deg), #4f8cff calc(var(--online, 0deg) + var(--prov, 0deg)), #f5b544 calc(var(--online, 0deg) + var(--prov, 0deg)), #f5b544 calc(var(--online, 0deg) + var(--prov, 0deg) + var(--quar, 0deg)), #fb7185 calc(var(--online, 0deg) + var(--prov, 0deg) + var(--quar, 0deg)), #fb7185 360deg);
  mask: radial-gradient(circle, transparent 52%, #000 53%);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
}
.donut-wrap { position: relative; flex: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center strong { font-size: 24px; letter-spacing: -0.6px; }
.donut-center span { font-size: 10px; color: var(--muted); }
.dist-legend { display: grid; gap: 10px; flex: 1; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.legend-row i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-row b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 列表 */
.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.mini-row:first-child { border-top: none; }
.mini-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.mini-ico svg { width: 15px; height: 15px; }
.mini-main { min-width: 0; flex: 1; }
.mini-main strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-main span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-side { font-size: 11px; color: var(--muted); text-align: right; flex: none; }

/* 空状态 */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 44px 20px; color: var(--muted); text-align: center; }
.empty svg { width: 34px; height: 34px; opacity: 0.45; }
.empty strong { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.empty span { font-size: 12px; max-width: 320px; }

/* ==========================================================================
   表格
   ========================================================================== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search {
  position: relative;
  display: flex; align-items: center;
  min-width: 250px;
}
.search svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 19, 0.55);
  outline: none;
  font-size: 13px;
}
.search input:focus { border-color: rgba(79, 140, 255, 0.55); box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12); }
.select {
  height: 38px; padding: 0 30px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 19, 0.55);
  color: var(--text);
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #74869f 50%), linear-gradient(135deg, #74869f 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.table-card { padding: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
thead th {
  position: sticky; top: 0;
  padding: 13px 18px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #667891;
  background: rgba(9, 15, 28, 0.92);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
tbody tr { transition: background 0.14s ease; cursor: pointer; }
tbody tr:hover { background: rgba(79, 140, 255, 0.045); }
tbody tr:hover .row-name { color: #9ec4ff; }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.device-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79, 140, 255, 0.08);
  border: 1px solid rgba(79, 140, 255, 0.16);
  color: #8db4ff;
}
.device-ico svg { width: 16px; height: 16px; }
.row-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; transition: color 0.15s; }
.row-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  font-size: 11px; color: var(--text-2);
}
.tag.rdp { color: #8db4ff; background: rgba(79, 140, 255, 0.08); border-color: rgba(79, 140, 255, 0.18); }
.tag.vnc { color: #c4b2ff; background: rgba(167, 139, 250, 0.08); border-color: rgba(167, 139, 250, 0.18); }
.host-cell strong { display: block; font-size: 13px; font-weight: 600; }
.host-cell span { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.time-cell { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.time-cell small { display: block; color: #53637c; font-size: 10px; }
.muted-dash { color: #4a5a71; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn { opacity: 0.55; transition: opacity 0.15s; }
tbody tr:hover .row-actions .btn { opacity: 1; }

/* ==========================================================================
   抽屉
   ========================================================================== */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 6, 12, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(580px, 100vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a1120, #070c17);
  border-left: 1px solid var(--line-strong);
  box-shadow: -40px 0 80px -30px rgba(0, 0, 0, 0.9);
  transform: translateX(102%);
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 27, 48, 0.35);
}
.drawer-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.3px; }
.drawer-head .mono { color: var(--muted); margin-top: 3px; display: block; }
.drawer-head .icon-btn { margin-left: auto; flex: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.drawer-section { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17, 27, 48, 0.32); }
.drawer-section h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.2px; display: flex; align-items: center; gap: 8px; }
.drawer-section h3 span.count { font-size: 10px; color: var(--muted); font-weight: 500; }
.drawer-section h3 svg { width: 14px; height: 14px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 9px 14px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); word-break: break-all; }
.kv dd.mono { color: #b9c9e0; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.section-note { margin: 0 0 12px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.btn-line { display: flex; gap: 8px; flex-wrap: wrap; }
.cmd-item { padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.cmd-item:first-child { border-top: none; }
.cmd-top { display: flex; align-items: center; gap: 8px; }
.cmd-top strong { font-size: 12.5px; font-weight: 600; }
.cmd-top .pill { margin-left: auto; }
.cmd-meta { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.cmd-result { margin-top: 4px; color: #9fb0c8; font-family: var(--mono); font-size: 10.5px; word-break: break-all; }

/* ==========================================================================
   弹窗
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
.modal {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #101a2e, #0a1120);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  animation: rise 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.modal.wide { width: min(620px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.3px; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px 24px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 22px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.99); } }

.secret-box {
  margin: 14px 0;
  padding: 14px;
  border: 1px dashed rgba(79, 140, 255, 0.35);
  border-radius: 11px;
  background: rgba(79, 140, 255, 0.06);
}
.secret-box label { display: block; font-size: 10.5px; letter-spacing: 0.7px; text-transform: uppercase; color: #7f97ba; margin-bottom: 6px; }
.secret-value { display: flex; align-items: center; gap: 8px; }
.secret-value code {
  flex: 1; font-size: 11px; padding: 8px 10px; background: rgba(3, 7, 15, 0.65);
  border-color: var(--line); word-break: break-all; white-space: pre-wrap; line-height: 1.5;
}
.warn-box {
  display: flex; gap: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  border-radius: 10px;
  border: 1px solid rgba(245, 181, 68, 0.28);
  background: rgba(245, 181, 68, 0.07);
  color: #e8c98c;
  font-size: 12px;
  line-height: 1.6;
}
.warn-box svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.danger-box { border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.07); color: #ffb3bf; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  min-width: 260px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 22, 40, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9);
  font-size: 12.5px;
  animation: toastIn 0.25s cubic-bezier(0.22, 0.9, 0.3, 1);
  pointer-events: auto;
}
.toast i { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--ok); }
.toast.error i { background: var(--danger); }
.toast.warn i { background: var(--warn); }
.toast.out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) {
  .grid.two { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-chain { align-self: stretch; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .sidebar { width: 72px; flex-basis: 72px; padding: 18px 10px 14px; }
  .sidebar .brand { padding: 0 0 22px; justify-content: center; }
  .sidebar .brand > span:last-child, .nav-label, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .ico { width: 20px; height: 20px; }
  .nav-item .nav-badge { position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px; font-size: 9px; padding: 0 4px; }
  .user-meta, .user-chip .icon-btn, .version, .link-state span { display: none; }
  .link-state { justify-content: center; padding: 10px; }
  .user-chip { justify-content: center; }
  .sidebar-foot { align-items: center; }
  .topbar { padding: 14px 20px; min-height: 76px; }
  .view { padding: 20px 20px 60px; }
}
@media (max-width: 640px) {
  .top-actions .clock, .top-actions #refresh { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 22px; }
  .hero-chain { flex-wrap: wrap; }
  .drawer-body { padding: 16px 16px 40px; }
  .dist { flex-direction: column; align-items: flex-start; }
  .toolbar .search { min-width: 100%; }
}

/* 登录页：新设备安装命令 */
.install-box{margin-top:18px;padding:12px 14px;border:1px dashed var(--line);border-radius:12px;background:rgba(91,141,239,.05)}
.install-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.install-head span{font-size:11.5px;color:var(--muted);letter-spacing:.04em}
.install-box code{display:block;font-family:var(--mono);font-size:11.5px;line-height:1.6;color:var(--text);
  white-space:pre-wrap;word-break:break-all;background:rgba(0,0,0,.28);border:1px solid var(--line);border-radius:8px;padding:9px 10px}
.install-tip{margin:8px 0 0;font-size:11px;color:var(--muted);line-height:1.5}
