:root {
  --bg: #0b1220;
  --panel: #121b2f;
  --panel-2: #1a2742;
  --line: #24334f;
  --text: #e7eefb;
  --muted: #8fa3c2;
  --brand: #3b82f6;
  --brand-2: #22d3ee;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(34, 211, 238, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

a { color: var(--brand-2); text-decoration: none; }
button { font: inherit; }

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(26, 39, 66, .96), rgba(18, 27, 47, .96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 34px 30px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #061225;
  font-size: 20px;
}
.logo h1 { font-size: 19px; margin: 0; letter-spacing: .5px; }
.logo p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1628;
  color: var(--text);
  padding: 0 14px;
  outline: none;
  font-size: 14px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }

.btn {
  height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  transition: .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 6px; }

.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 14px; }
.error {
  display: none;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #fecaca;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.error.show { display: block; }

/* 控制台 */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, .8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.brand strong { font-size: 15px; letter-spacing: .3px; }
.brand span { color: var(--muted); font-size: 12px; margin-left: 4px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  color: var(--muted);
  font-size: 12px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #061225; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

main { max-width: 1280px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: .3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.stat {
  background: linear-gradient(180deg, rgba(26, 39, 66, .85), rgba(18, 27, 47, .85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

.panel {
  background: linear-gradient(180deg, rgba(26, 39, 66, .72), rgba(18, 27, 47, .85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head .muted { color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px; }

.token-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.token-value {
  flex: 1; min-width: 260px;
  font-family: "Cascadia Code", Consolas, monospace;
  background: #0d1628;
  border: 1px dashed var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 10px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: rgba(13, 22, 40, .55); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(59, 130, 246, .05); }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.online { color: #bbf7d0; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08); }
.badge.online::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }
.badge.offline { color: #fecaca; border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .07); }
.badge.offline::before { background: var(--danger); }

.actions { display: flex; gap: 8px; }
.empty { padding: 46px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 8px; font-size: 15px; }

.toast {
  position: fixed; right: 24px; bottom: 24px;
  background: #0f1b30; border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 10px; padding: 12px 16px;
  color: var(--text); font-size: 13px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(8px);
  transition: .2s ease; pointer-events: none;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 18px; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  th, td { padding: 10px 8px; }
  .hide-sm { display: none; }
}
