:root {
  --bg: #05080f;
  --bg-soft: #0a101c;
  --panel: rgba(13, 20, 34, 0.78);
  --panel-solid: #0d1422;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #e8eef9;
  --muted: #8fa0b8;
  --muted-2: #64748b;
  --accent: #5eead4;
  --accent-2: #8b7cf6;
  --accent-ink: #04120f;
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #34d399;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
code, pre { font-family: var(--mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- background */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-a {
  width: 620px;
  height: 620px;
  top: -240px;
  left: -160px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.16), transparent 65%);
}
.bg-glow-b {
  width: 720px;
  height: 720px;
  right: -260px;
  bottom: -360px;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.18), transparent 65%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

/* ---------------------------------------------------------------- auth */
.auth-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(16, 24, 40, 0.96), rgba(8, 13, 23, 0.98));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  padding: 28px;
  animation: rise 0.45s ease both;
}
.auth-brand { margin-bottom: 22px; }
.auth-brand .brand-mark { width: 42px; height: 42px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(2, 6, 14, 0.55);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px;
  border-radius: 9px;
  font-size: 13px;
}
.auth-tab.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.14), rgba(94, 234, 212, 0.06));
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2);
}
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-note { margin: 2px 0 0; font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.auth-msg { margin: 14px 0 0; min-height: 18px; font-size: 12.5px; color: var(--danger); line-height: 1.6; }
.auth-msg.ok { color: var(--ok); }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(13, 20, 34, 0.6);
  max-width: 260px;
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.user-email {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .link-btn { font-size: 11.5px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  animation: rise 0.5s ease both;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 46px;
  height: 46px;
  color: var(--accent);
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(94, 234, 212, 0.14), rgba(139, 124, 246, 0.1));
  border: 1px solid rgba(94, 234, 212, 0.25);
  box-shadow: inset 0 0 22px rgba(94, 234, 212, 0.08), 0 0 30px rgba(94, 234, 212, 0.08);
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-text h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.02em;
  font-weight: 650;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
  font-size: 12.5px;
  color: #a7f3d0;
  white-space: nowrap;
}
.status-pill.offline {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}
.status-pill.offline .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12); }

.addr-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  background: rgba(13, 20, 34, 0.6);
  padding: 7px 11px 7px 13px;
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}
.addr-chip:hover { border-color: rgba(94, 234, 212, 0.4); background: rgba(94, 234, 212, 0.06); }
.addr-label { font-size: 11.5px; color: var(--muted); }
.addr-chip code { font-size: 12px; color: var(--accent); }
.icon-sm { width: 14px; height: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- offline banner */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(251, 113, 133, 0.32);
  background: linear-gradient(120deg, rgba(251, 113, 133, 0.12), rgba(251, 191, 36, 0.06));
  animation: rise 0.35s ease both;
}
.offline-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.offline-icon {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(251, 113, 133, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3;
  font-weight: 800;
}
.offline-banner strong { font-size: 13px; color: #fecdd3; }
.offline-banner p { margin: 2px 0 0; font-size: 12px; color: #e7b6bd; word-break: break-word; }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 408px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 22px;
  animation: rise 0.55s ease both;
}

.card-head h2, .section-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.card-head p, .section-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.login-card { position: sticky; top: 22px; }

.channel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 18px 0 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(2, 6, 14, 0.55);
  border: 1px solid var(--border);
}
.channel-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 6px;
  border-radius: 10px;
  font-size: 13px;
  transition: color 0.2s, background 0.2s;
}
.channel-tab:hover { color: var(--text); }
.channel-tab.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.14), rgba(94, 234, 212, 0.06));
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2);
}

.mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mode-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
}
.mode-tab:hover { color: var(--text); background: rgba(148, 163, 184, 0.06); }
.mode-tab.active {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.25);
  background: rgba(94, 234, 212, 0.07);
}

/* ---------------------------------------------------------------- forms */
.login-form { display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.field > span em { font-style: normal; color: var(--muted-2); font-size: 11px; }

.field input, .json-input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.6);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field input::placeholder, .json-input::placeholder { color: #4b5a70; }
.field input:focus, .json-input:focus {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
  background: rgba(2, 6, 14, 0.85);
}

.form-note { margin: 0; font-size: 11.5px; color: var(--muted-2); }

.guest-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 18px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(94, 234, 212, 0.25);
  background: radial-gradient(circle at 50% 0%, rgba(94, 234, 212, 0.08), transparent 70%);
}
.guest-icon { font-size: 26px; color: var(--accent); }
.guest-box p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s, filter 0.2s, border-color 0.2s, background 0.2s;
  min-height: 42px;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), #7dd3fc);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgba(94, 234, 212, 0.16);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: rgba(148, 163, 184, 0.06);
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--border-strong); background: rgba(148, 163, 184, 0.1); }
.btn.small { padding: 7px 12px; min-height: 34px; font-size: 12.5px; }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.25); }

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(4, 18, 15, 0.25);
  border-top-color: currentColor;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.75; }
.btn.loading { pointer-events: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.3s;
}
.icon-btn:hover { color: var(--accent); border-color: rgba(94, 234, 212, 0.35); }
.icon-btn.spinning svg { animation: spin 0.8s linear infinite; }
.icon-btn svg { width: 17px; height: 17px; }

.link-btn {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  padding: 2px 0;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- captcha */
.captcha-box, .slider-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(94, 234, 212, 0.04);
}
.captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--accent);
}
.captcha-body { display: flex; gap: 10px; align-items: center; }
.captcha-body img {
  height: 46px;
  min-width: 120px;
  max-width: 180px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  cursor: pointer;
}
.captcha-body input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.6);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
  font-size: 13px;
}
.captcha-body input:focus { border-color: rgba(94, 234, 212, 0.5); }
.captcha-hint { margin: 9px 0 0; font-size: 11.5px; color: var(--muted); }

.slider-box img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 9px;
  background: #0b1220;
  margin: 8px 0 12px;
}
.slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.slider-row span { font-family: var(--mono); font-size: 12px; color: var(--accent); min-width: 64px; text-align: right; }

.sms-tip {
  border-radius: 11px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.07);
  padding: 11px 13px;
  font-size: 12.5px;
  color: #fde68a;
  line-height: 1.6;
}
.sms-tip code { color: #fff7d6; word-break: break-all; }

/* ---------------------------------------------------------------- accounts */
.accounts-section { min-width: 0; animation: rise 0.6s ease both; }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.2);
  vertical-align: 2px;
}

.account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.account {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(170deg, rgba(16, 24, 40, 0.88), rgba(9, 14, 25, 0.9));
  padding: 15px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.35s ease both;
}
.account::after {
  content: "";
  position: absolute;
  inset: -1px auto auto -1px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 0 0, rgba(94, 234, 212, 0.09), transparent 70%);
  pointer-events: none;
}
.account:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(94, 234, 212, 0.06);
}

.acc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.18);
  white-space: nowrap;
}
.badge.netease { color: #c4b5fd; background: rgba(139, 124, 246, 0.1); border-color: rgba(139, 124, 246, 0.22); }
.badge.phone { color: #93c5fd; background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.22); }
.badge.join { color: #fcd34d; background: rgba(251, 191, 36, 0.09); border-color: rgba(251, 191, 36, 0.22); margin-left: auto; }

.acc-time { margin-left: auto; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.acc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-sub { margin: 3px 0 11px; font-size: 11.5px; color: var(--muted); }

.token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.55);
  border-radius: 9px;
  padding: 7px 8px 7px 10px;
  margin-bottom: 12px;
}
.token-row code {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: #9fb3cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.token-row button {
  border: 0;
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
}
.token-row button:hover { background: rgba(94, 234, 212, 0.18); }

.acc-actions { display: flex; gap: 7px; }
.acc-actions button {
  flex: 1;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 11.5px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.acc-actions button:hover { color: var(--text); border-color: var(--border-strong); background: rgba(148, 163, 184, 0.08); }
.acc-actions button.danger:hover { color: var(--danger); border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.07); }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(13, 20, 34, 0.35);
}
.empty-icon { font-size: 34px; color: rgba(94, 234, 212, 0.5); margin-bottom: 8px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); font-weight: 600; }
.empty-state p { margin: 0; font-size: 12.5px; line-height: 1.7; }

/* ---------------------------------------------------------------- guide */
.guide-card { grid-column: 1 / -1; }
.steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.steps li {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  background: rgba(2, 6, 14, 0.35);
}
.step-no {
  flex: 0 0 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.steps h4 { margin: 2px 0 6px; font-size: 13.5px; }
.steps p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.steps code, .callout code { font-size: 11.5px; color: #a5f3e5; background: rgba(94, 234, 212, 0.08); padding: 1px 5px; border-radius: 5px; }
.mini-code {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: #050b14;
  border: 1px solid var(--border);
  font-size: 11px;
  color: #9fb3cc;
  overflow-x: auto;
  white-space: pre;
}
.js-addr { color: var(--accent); }

.callout {
  margin-top: 16px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.05);
  border-radius: 13px;
  padding: 13px 16px;
}
.callout strong { font-size: 12.5px; color: #fcd34d; }
.callout p { margin: 5px 0 0; font-size: 12px; color: #cbb98a; line-height: 1.7; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.footer code { color: var(--muted); }
.footer-sep { opacity: 0.5; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade 0.2s ease both;
}
.modal {
  position: relative;
  width: min(780px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: linear-gradient(165deg, #101827, #0a111d);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  padding: 24px;
  animation: pop 0.25s ease both;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-head h2 { margin: 8px 0 4px; font-size: 19px; }
.modal-head p { margin: 0; font-size: 12px; color: var(--muted); }

.modal-tabs {
  display: flex;
  gap: 5px;
  margin: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.modal-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--accent); background: rgba(94, 234, 212, 0.08); border-color: rgba(94, 234, 212, 0.2); }

.token-block {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: rgba(94, 234, 212, 0.05);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.token-label { font-size: 11px; color: var(--accent); white-space: nowrap; }
.token-block code {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #d1fae5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.pre-actions { display: flex; gap: 12px; }
.json-view {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #050b14;
  padding: 14px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #a9c1d9;
  white-space: pre-wrap;
  word-break: break-all;
}
.json-input {
  min-height: 190px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
.panel-desc { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.panel-desc code { font-size: 11.5px; color: #a5f3e5; }
.modal-panel .field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- admin */
.admin-modal { width: min(900px, 100%); }
.admin-create {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr auto;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-create input, .admin-create select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.6);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
  outline: none;
}
.admin-create input:focus, .admin-create select:focus { border-color: rgba(94, 234, 212, 0.5); }
.admin-create select { cursor: pointer; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(2, 6, 14, 0.35);
}
.admin-user.banned { border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.05); }
.admin-user-main { min-width: 0; }
.admin-user-main strong { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; }
.admin-user-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.admin-user-actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.admin-user-actions button {
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
}
.admin-user-actions button:hover { color: var(--text); border-color: var(--border-strong); }
.admin-user-actions button.danger:hover { color: var(--danger); border-color: rgba(251, 113, 133, 0.3); }
.admin-user-actions button.ok:hover { color: var(--ok); border-color: rgba(52, 211, 153, 0.3); }

.admin-accounts {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(2, 6, 14, 0.35);
}
.admin-accounts h4 { margin: 0 0 8px; font-size: 12.5px; }
.admin-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.admin-account-row:first-of-type { border-top: 0; }
.admin-account-row code { margin-left: auto; font-size: 10.5px; color: var(--muted); }

.admin-log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.admin-log-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; }
.admin-log {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  background: rgba(2, 6, 14, 0.35);
  font-size: 12px;
}
.admin-log-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.admin-log-action { color: var(--accent); font-weight: 600; }
.admin-log-detail { margin-top: 3px; color: #b8c7da; font-size: 11.5px; word-break: break-all; }

/* ---------------------------------------------------------------- toasts */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  background: rgba(13, 20, 34, 0.96);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s ease both;
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.leaving { animation: toast-out 0.22s ease both; }

/* ---------------------------------------------------------------- animation */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(14px); }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .login-card { position: static; }
  .steps { grid-template-columns: 1fr; }
  .guide-card { grid-column: auto; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); padding-top: 18px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-right { width: 100%; }
  .addr-chip { flex: 1; justify-content: center; }
  .account-list { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 17px; }
  .modal { padding: 18px; border-radius: 18px; }
  .token-block { flex-wrap: wrap; }
  .modal-footer { flex-direction: column-reverse; }
  .admin-create { grid-template-columns: 1fr 1fr; }
  .admin-create .btn { grid-column: 1 / -1; }
  .admin-user { flex-direction: column; align-items: flex-start; }
  .admin-user-actions { width: 100%; }
}
