:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --text: #172033;
  --muted: #667085;
  --line: #dbe3ef;
  --primary: #1f7aec;
  --primary-dark: #145fc0;
  --success: #0f9f6e;
  --danger: #d92d20;
  --shadow: 0 20px 60px rgba(20, 38, 71, 0.12);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 440px;
  gap: 48px;
  align-items: center;
  padding: 56px clamp(24px, 8vw, 120px);
  background:
    radial-gradient(circle at 12% 14%, rgba(31, 122, 236, 0.18), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(15, 159, 110, 0.14), transparent 24%),
    #f7f9fc;
}
.auth-brand h1 {
  margin: 24px 0 16px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}
.auth-brand p {
  max-width: 650px;
  font-size: 20px;
  color: var(--muted);
  line-height: 1.75;
}
.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, #1f7aec, #18a06f);
  box-shadow: var(--shadow);
}
.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
}
.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.auth-points span, .chips button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 10px 14px;
  color: #344054;
}
.auth-panel {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(219, 227, 239, .9);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  border: 0;
  border-radius: 6px;
  padding: 12px;
  background: transparent;
  color: var(--muted);
}
.tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 4px 18px rgba(16,24,40,.08);
}
.form, .dialog-form {
  display: grid;
  gap: 16px;
}
.verify-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: end;
  gap: 10px;
}
label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--text);
}
input:focus {
  outline: 3px solid rgba(31,122,236,.15);
  border-color: var(--primary);
}
.primary, .ghost {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
}
.primary {
  background: var(--primary);
  color: white;
}
.primary:hover { background: var(--primary-dark); }
.primary.small { min-height: 36px; }
.ghost {
  border: 1px solid var(--line);
  background: white;
  color: #344054;
}
.ghost.danger { color: var(--danger); }
.oauth-button {
  border: 1px solid #c7d7f2;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: #f7fbff;
  color: #145fc0;
  font-weight: 800;
}
.oauth-button.qq::before {
  content: "Q";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: #12b7f5;
  color: white;
  font-size: 14px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  min-height: 28px;
  padding: 0;
  font-weight: 800;
  text-align: center;
}
.auth-note, .muted {
  color: var(--muted);
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  min-height: 100vh;
  background: #111827;
  color: white;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.side-brand span {
  display: block;
  margin-top: 3px;
  color: #a7b0c0;
  font-size: 13px;
}
nav {
  display: grid;
  gap: 8px;
}
.nav {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  text-align: left;
  background: transparent;
  color: #d4dbe8;
}
.nav.active, .nav:hover {
  background: rgba(255,255,255,.11);
  color: white;
}
.sidebar .ghost {
  margin-top: auto;
  background: rgba(255,255,255,.06);
  color: #ffd1cc;
  border-color: rgba(255,255,255,.15);
}
.main { padding: 28px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-weight: 800;
}
h2, h3 { margin: 0; letter-spacing: 0; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 9px 14px;
}
.user-chip span { color: var(--muted); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(16,24,40,.05);
}
.stat {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.stat span, .stat small { color: var(--muted); }
.stat strong {
  font-size: 30px;
  letter-spacing: 0;
}
.panel { padding: 18px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.copy-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}
code, pre {
  font-family: "Cascadia Code", Consolas, monospace;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e7eefc;
  border-radius: 8px;
  padding: 18px;
  overflow: auto;
}
.table {
  width: 100%;
  overflow-x: auto;
}
.table table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  color: var(--muted);
  font-size: 13px;
  background: #fbfdff;
}
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #ecfdf3;
  color: #027a48;
}
.status.bad {
  background: #fff1f0;
  color: var(--danger);
}
.list-empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.method-grid, .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.method {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}
.method.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,122,236,.12);
}
.pay-result {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}
.pay-result img {
  max-width: 180px;
  display: block;
  margin-top: 12px;
}
.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 50;
  background: #111827;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
dialog {
  border: 0;
  border-radius: 8px;
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(17,24,39,.45); }
menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin: 8px 0 0;
}

@media (max-width: 980px) {
  .auth-shell, .app-shell, .two-col { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    min-height: auto;
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .auth-shell { padding: 28px 16px; }
  .main { padding: 18px; }
  .topbar, .user-chip { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
  .verify-row { grid-template-columns: 1fr; }
}
