/* ==========================================================================
   Neptune 控制台 · 样式
   ========================================================================== */

:root {
  --bg: #060a0f;
  --bg-soft: #0a1018;
  --panel: #0e1621;
  --panel-2: #111c28;
  --panel-3: #16232f;
  --border: #1c2b3a;
  --border-soft: #16222f;
  --text: #e8eef6;
  --text-dim: #b3c1d1;
  --muted: #8397ad;
  --faint: #5e7288;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --blue: #38bdf8;
  --gold: #f5c451;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.1);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(45, 212, 191, 0.09), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(56, 189, 248, 0.07), transparent 55%),
    var(--bg);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 22px; }
h3 { font-size: 15px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #223244; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c4056; }

/* --------------------------------------------------------------------------
   通用控件
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--panel-3);
  --btn-border: var(--border);
  --btn-color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: #1b2a3a; border-color: #2a3d51; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #04211d;
  font-weight: 650;
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.22);
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, #3ee0cb, var(--accent-strong)); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.04); }
.btn.danger { background: transparent; border-color: rgba(248, 113, 113, 0.35); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.xs { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: var(--text);
}
.btn.primary.loading::after { color: #04211d; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; color: var(--text-dim);
}
.menu-toggle { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 42%), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-dim); font-weight: 550; }
.field > small { color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #0a121b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field textarea { resize: vertical; min-height: 62px; font-family: var(--mono); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
  background: #0b1520;
}
.field input::placeholder, .field textarea::placeholder { color: #4c6076; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field.checkbox-field { flex-direction: row; align-items: center; gap: 9px; padding-top: 22px; }
.field.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.field.checkbox-field span { font-size: 13px; color: var(--text-dim); }

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { margin-top: 20px; }
.section-title { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.input-with-unit { display: flex; align-items: stretch; }
.input-with-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-with-unit .unit {
  display: inline-flex; align-items: center; padding: 0 11px;
  background: #0c1621; border: 1px solid var(--border); border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.form-error {
  padding: 9px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 12.5px;
  white-space: pre-wrap;
}
.hint { color: var(--faint); font-size: 11.5px; line-height: 1.6; }
.turnstile-slot { min-height: 1px; }
.turnstile-slot:empty { display: none; }

/* --------------------------------------------------------------------------
   登录
   -------------------------------------------------------------------------- */

.login-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border-soft);
  background:
    radial-gradient(700px 420px at 10% 8%, rgba(45, 212, 191, 0.13), transparent 62%),
    radial-gradient(600px 500px at 92% 88%, rgba(56, 189, 248, 0.1), transparent 60%),
    linear-gradient(160deg, #0a131c 0%, #060a0f 70%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(45, 212, 191, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(45, 212, 191, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 30% 40%, black 10%, transparent 72%);
  pointer-events: none;
}
.brand-top { display: flex; align-items: center; gap: 13px; margin-bottom: clamp(40px, 7vh, 70px); position: relative; z-index: 1; }
.brand-mark, .logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(45, 212, 191, 0.2), rgba(45, 212, 191, 0.04));
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--accent);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
  box-shadow: 0 0 32px rgba(45, 212, 191, 0.12);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.login-brand h1 {
  position: relative; z-index: 1;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #f2f8ff, #9db2c8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-lead { position: relative; z-index: 1; max-width: 440px; color: var(--text-dim); font-size: 14.5px; line-height: 1.75; }
.feature-list { position: relative; z-index: 1; margin-top: 34px; display: flex; flex-direction: column; gap: 13px; max-width: 430px; }
.feature-list li { display: flex; align-items: center; gap: 13px; color: var(--text-dim); font-size: 13px; }
.feature-list span {
  font-family: var(--mono); font-size: 10.5px; color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.25); background: rgba(45, 212, 191, 0.06);
  border-radius: 5px; padding: 2px 6px;
}
.brand-foot { position: absolute; left: clamp(36px, 6vw, 84px); bottom: 28px; color: var(--faint); font-size: 11px; letter-spacing: 0.04em; }

.login-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.auth-card { width: min(430px, 100%); padding: 26px; box-shadow: var(--shadow); }
.auth-tabs { display: flex; gap: 4px; background: #0a121b; border: 1px solid var(--border); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 8px; background: transparent; border: none; border-radius: 7px;
  color: var(--muted); font-size: 13px; cursor: pointer; transition: 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.demo-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; padding: 11px 13px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: var(--accent-soft); border-radius: 10px;
}
.demo-entry-text { display: flex; flex-direction: column; gap: 2px; }
.demo-entry-text strong { font-size: 12.5px; color: var(--accent); }
.demo-entry-text span { font-size: 11px; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .hint { margin-top: -2px; }
.login-modes {
  display: flex; gap: 4px;
  background: #0a121b; border: 1px solid var(--border);
  padding: 4px; border-radius: 9px;
}
.login-modes button {
  flex: 1; padding: 7px 10px; border: none; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer;
  transition: 0.15s;
}
.login-modes button:hover { color: var(--text); }
.login-modes button.active { background: var(--panel-3); color: var(--text); }
.login-modes + #account-login-fields, .login-modes + #card-login-fields { margin-top: 0; }
.login-foot { margin-top: 18px; color: var(--faint); font-size: 11px; text-align: center; }

.conn-settings { margin-top: 20px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.conn-settings summary { cursor: pointer; color: var(--muted); font-size: 12.5px; user-select: none; }
.conn-settings summary:hover { color: var(--text); }
.conn-settings form { display: flex; flex-direction: column; gap: 13px; margin-top: 16px; }
.conn-settings .inline-actions { margin-top: 4px; }

/* --------------------------------------------------------------------------
   控制台框架
   -------------------------------------------------------------------------- */

.app-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  grid-template-rows: 62px minmax(0, 1fr);
  grid-template-areas: "topbar topbar" "sidebar main";
}

.topbar {
  grid-area: topbar;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 22px;
  background: rgba(7, 11, 16, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.logo-text { font-weight: 700; letter-spacing: 0.01em; }
.site-pill {
  font-size: 11px; color: var(--muted);
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 15px; }
.balance-box { display: flex; align-items: baseline; gap: 6px; }
.balance-label { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.balance-box strong { font-family: var(--mono); font-size: 18px; color: var(--gold); font-weight: 650; letter-spacing: -0.02em; }
.balance-unit { color: var(--faint); font-size: 11px; }
.peak-chip {
  font-size: 11px; color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.3);
  background: var(--warn-soft); padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.eta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.eta strong { color: var(--text-dim); font-weight: 550; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px;
  white-space: nowrap;
}
.ws-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px currentColor; }
.ws-chip.open i { background: var(--accent); }
.ws-chip.open { color: #7ee8d8; border-color: rgba(45, 212, 191, 0.3); }
.ws-chip.error i, .ws-chip.closed i { background: var(--danger); }
.ws-chip.error { color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); }
.top-email { font-size: 12px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar {
  grid-area: sidebar;
  position: sticky; top: 62px;
  height: calc(100dvh - 62px);
  border-right: 1px solid var(--border);
  padding: 18px 12px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: rgba(8, 13, 19, 0.55);
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 11px;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13px;
  cursor: pointer; text-align: left; transition: 0.15s;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); border-color: rgba(45, 212, 191, 0.18); }
.nav-item.active svg { opacity: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 10px; color: var(--faint); font-size: 11px; border-top: 1px solid var(--border-soft); }
.dot-sep { opacity: 0.5; }

.main { grid-area: main; width: 100%; max-width: 1520px; padding: 26px 30px 70px; }
.sidebar-backdrop { display: none; }
.mobile-only { display: none; }
.view { display: none; }
.view.active { display: block; animation: fade-in 0.22s ease; }

.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.view-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mode-badge {
  font-size: 11.5px; color: var(--text-dim);
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 5px 11px; white-space: nowrap;
}

.banners { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.banners:empty { display: none; }
.banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel-2); font-size: 12.5px;
  animation: fade-in 0.2s ease;
}
.banner strong { font-weight: 650; }
.banner.info { border-color: rgba(56, 189, 248, 0.28); background: rgba(56, 189, 248, 0.07); color: #bae6fd; }
.banner.warn { border-color: rgba(251, 191, 36, 0.28); background: var(--warn-soft); color: #fde68a; }
.banner.danger { border-color: rgba(248, 113, 113, 0.28); background: var(--danger-soft); color: #fecaca; }
.banner .banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.banner .banner-actions button { background: transparent; border: none; color: inherit; opacity: 0.75; cursor: pointer; font-size: 12px; text-decoration: underline; }
.banner .banner-actions button:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */

.table-card { padding: 0; overflow: hidden; }
.table-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.012);
}
.check-all { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check-all input, .row-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.selection-count { font-size: 12px; color: var(--muted); }
.toolbar-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left; padding: 9px 12px; color: var(--faint); font-weight: 550; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: #0a1119;
  position: sticky; top: 0; z-index: 2;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .col-check { width: 34px; }
.data-table .col-actions { text-align: right; width: 1%; white-space: nowrap; }
.data-table.compact td { padding: 8px 11px; }
.table-foot { padding: 9px 16px; color: var(--faint); font-size: 11.5px; border-top: 1px solid var(--border); }

.account-cell { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.account-cell b { font-weight: 600; font-size: 13px; }
.account-cell span { color: var(--muted); font-size: 11.5px; }
.status-cell { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 7px rgba(45, 212, 191, 0.6); }
.status-dot.busy { background: var(--blue); box-shadow: 0 0 7px rgba(56, 189, 248, 0.5); }
.status-dot.error { background: var(--danger); }
.status-dot.idle { background: var(--faint); }
.status-text { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 5px; justify-content: flex-end; }
.row-actions .btn { padding: 4px 8px; font-size: 11.5px; }

.batch-cell { min-width: 110px; }
.batch-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.progress { height: 4px; background: #16232f; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); border-radius: 999px; }
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10.5px;
  border: 1px solid var(--border); color: var(--muted); background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
.tag.gold { color: var(--gold); border-color: rgba(245, 196, 81, 0.28); background: rgba(245, 196, 81, 0.06); }
.tag.teal { color: var(--accent); border-color: rgba(45, 212, 191, 0.25); background: var(--accent-soft); }
.tag.red { color: var(--danger); border-color: rgba(248, 113, 113, 0.28); background: var(--danger-soft); }
.num { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.num.gold { color: var(--gold); }

.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-state.sm { padding: 26px 12px; }
.empty-icon { font-size: 28px; color: var(--faint); margin-bottom: 8px; }
.empty-state p { margin: 3px 0; }

/* --------------------------------------------------------------------------
   建房
   -------------------------------------------------------------------------- */

.mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding: 5px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: fit-content; }
.mode-tab {
  padding: 7px 15px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: 0.15s;
}
.mode-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.mode-tab.active { color: #04211d; background: var(--accent); font-weight: 650; }

.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.room-main { padding: 22px; }
.room-side { position: sticky; top: 82px; }
.room-side h3 { margin-bottom: 14px; }
.room-side .kv { margin-bottom: 16px; }

.account-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 7px;
  max-height: 210px; overflow-y: auto; padding: 2px;
}
.account-option {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #0a121b; cursor: pointer; font-size: 12px; color: var(--text-dim);
  transition: 0.12s;
}
.account-option:hover { border-color: #2b4054; }
.account-option.checked { border-color: rgba(45, 212, 191, 0.45); background: var(--accent-soft); color: var(--text); }
.account-option input { accent-color: var(--accent); }
.account-option .order {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  color: var(--accent); background: rgba(45, 212, 191, 0.1);
  border-radius: 4px; padding: 1px 5px;
}
.account-option .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.advanced { margin-top: 20px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.advanced summary { cursor: pointer; color: var(--text-dim); font-size: 12.5px; user-select: none; }
.advanced summary:hover { color: var(--accent); }
.advanced > div { padding-top: 16px; }
.advanced .group-title { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 18px 0 9px; }
.advanced .group-title:first-child { margin-top: 0; }

.submit-row { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.action-result { font-size: 12.5px; color: var(--muted); }
.action-result.ok { color: #86efac; }
.action-result.err { color: #fca5a5; }
.notice-box { padding: 11px 12px; border-radius: 8px; background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, 0.24); color: #fde68a; font-size: 12px; margin-bottom: 14px; }

.quick-actions-card { margin-top: 18px; }
.quick-extra { display: flex; flex-direction: column; justify-content: flex-end; }
.quick-extra > .hint { padding-bottom: 10px; }
.tools-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); }

.kv { display: flex; flex-direction: column; gap: 9px; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-dim); text-align: right; }
.tip-box { border: 1px dashed var(--border); border-radius: 10px; padding: 13px; background: rgba(255, 255, 255, 0.012); font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.tip-box strong { color: var(--text-dim); display: block; margin-bottom: 5px; font-size: 12px; }
.tip-box p + p { margin-top: 4px; }

/* --------------------------------------------------------------------------
   钓鱼 / 兑换通用
   -------------------------------------------------------------------------- */

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { white-space: nowrap; }
.callout { margin-bottom: 16px; padding: 11px 14px; border-radius: 9px; font-size: 12.5px; border: 1px solid var(--border); background: var(--panel); }
.callout.warn { border-color: rgba(251, 191, 36, 0.28); background: var(--warn-soft); color: #fde68a; }

.chip-options { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-option {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 11.5px; color: var(--muted); cursor: pointer; background: #0a121b;
  transition: 0.12s; user-select: none;
}
.chip-option:hover { border-color: #2b4054; color: var(--text-dim); }
.chip-option.checked { border-color: rgba(45, 212, 191, 0.45); color: var(--accent); background: var(--accent-soft); }
.chip-option input { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card span { color: var(--muted); font-size: 11.5px; }
.stat-card strong { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); }
.stat-card:nth-child(1) strong { color: var(--gold); }
.stat-card small { color: var(--faint); font-size: 11px; }

.billing-grid { grid-template-columns: 340px minmax(0, 1fr); }
.segmented { display: inline-flex; padding: 3px; background: #0a121b; border: 1px solid var(--border); border-radius: 8px; }
.segmented button { padding: 4px 10px; border: none; background: transparent; color: var(--muted); font-size: 11.5px; border-radius: 6px; cursor: pointer; }
.segmented button.active { background: var(--panel-3); color: var(--text); }

.usage-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 8px 0 0; border-bottom: 1px solid var(--border-soft); }
.usage-bar { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, rgba(45, 212, 191, 0.85), rgba(45, 212, 191, 0.18)); position: relative; min-height: 3px; transition: background 0.12s; }
.usage-bar:hover { background: linear-gradient(180deg, #7ff5e4, rgba(45, 212, 191, 0.35)); }
.usage-bar.empty { background: #16232f; }
.usage-x { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; margin-top: 5px; font-family: var(--mono); }
.usage-totals { display: flex; gap: 20px; margin-top: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.usage-totals strong { color: var(--text-dim); font-family: var(--mono); font-weight: 500; }
.revoke-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.revoke-row { font-size: 11px; color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 5px 9px; display: flex; justify-content: space-between; }

/* --------------------------------------------------------------------------
   设置 / 日志
   -------------------------------------------------------------------------- */

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 18px; align-items: start; }

.log-list { display: flex; flex-direction: column; gap: 5px; max-height: 65vh; overflow-y: auto; font-family: var(--mono); }
.log-row { display: flex; gap: 12px; padding: 7px 10px; border-radius: 6px; background: #0a121b; border: 1px solid var(--border-soft); font-size: 11.5px; }
.log-row .log-time { color: var(--faint); flex-shrink: 0; }
.log-row .log-type { color: var(--accent); flex-shrink: 0; min-width: 92px; }
.log-row .log-data { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-empty { color: var(--faint); font-size: 12px; padding: 30px; text-align: center; }

/* --------------------------------------------------------------------------
   模态框 / toast
   -------------------------------------------------------------------------- */

#modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 7, 11, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade-in 0.15s ease;
}
.modal {
  width: min(620px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.modal.wide { width: min(840px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; }
.modal-close { background: transparent; border: none; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body .form-stack { gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-body .kv { gap: 7px; }
.modal-body .kv > div { border-bottom: 1px dashed var(--border-soft); padding-bottom: 6px; }
.modal-body .kv > div:last-child { border-bottom: none; }
.modal-body h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 0 9px; }
.modal-body h4:first-child { margin-top: 0; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  padding: 11px 15px; border-radius: 10px; font-size: 12.5px;
  background: #101b26; border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.2s ease;
  overflow-wrap: anywhere;
}
.toast.ok { border-color: rgba(45, 212, 191, 0.35); }
.toast.err { border-color: rgba(248, 113, 113, 0.4); background: #1c1215; }
.toast.warn { border-color: rgba(251, 191, 36, 0.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .room-side { position: static; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .tools-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100dvh; }
  .app-view { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 62px; bottom: 0; z-index: 60;
    width: 232px; transform: translateX(-104%); transition: transform 0.2s ease;
    background: #081018; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.4);
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 62px 0 0; z-index: 55;
    background: rgba(3, 7, 11, 0.55); backdrop-filter: blur(2px);
  }
  .sidebar-backdrop[hidden] { display: none; }
  .main { padding: 20px 16px 60px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .top-email, .site-pill { display: none; }
  .balance-box strong { font-size: 16px; }
  .eta { display: none; }
  .two-col, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .table-toolbar { gap: 8px; }
  .toolbar-actions { margin-left: 0; }
  .view-head { margin-bottom: 16px; }
  .view-actions { width: 100%; }
  .mobile-only { display: block; }
  .accounts-table .col-batch,
  .accounts-table .col-members,
  .accounts-table .col-usage { display: none; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .peak-chip { display: none; }
  .ws-chip span { display: none; }
  .mode-tabs { width: 100%; overflow-x: auto; }
  .auth-card { padding: 20px; }
  .balance-label { display: none; }
  .logo-text { display: none; }
  .topbar-right { gap: 9px; }
  .topbar .btn.sm { padding: 6px 10px; }
}
