/* account.css — Qingtian 会员系统共享样式 (与 index.html 设计系统一致) */
:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef2ff;
  --brand-glow: rgba(79, 70, 229, 0.18);
  --accent: #0891b2;
  --accent-soft: #ecfeff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px 0 rgba(15,23,42,0.04);
  --shadow-sm: 0 2px 4px -1px rgba(15,23,42,0.04), 0 1px 2px 0 rgba(15,23,42,0.03);
  --shadow-md: 0 8px 24px -8px rgba(15,23,42,0.10), 0 2px 6px -2px rgba(15,23,42,0.04);
  --shadow-lg: 0 24px 48px -16px rgba(15,23,42,0.12);
}
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; background: var(--bg-soft); color: var(--text); font-family: 'Inter', -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.55; font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }

.topnav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255, 255, 255, 0.88); border-bottom: 1px solid rgba(15,23,42,0.06);
}
.topnav .row { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1200px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; color: var(--text); }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 13px; box-shadow: 0 2px 6px rgba(79,70,229,0.3); }
.topnav .links { display: flex; gap: 24px; align-items: center; }
.topnav .links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.topnav .links a:hover { color: var(--brand); text-decoration: none; }
.topnav .me-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--text-2); }
.topnav .me-chip .av { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; user-select: none; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; text-decoration: none; }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 1px 2px rgba(79,70,229,0.4), 0 4px 12px -2px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); color: white; text-decoration: none; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: white; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--line-strong); text-decoration: none; }
.btn-danger { background: white; color: var(--danger); border: 1px solid var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: #fecaca; text-decoration: none; }
.btn-xl { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* === auth pages (login/signup) === */
.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg-soft) radial-gradient(720px 360px at 50% -10%, rgba(79,70,229,0.10), transparent 70%); }
.auth-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 40px 36px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }
.auth-card .logo-lg { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 24px; box-shadow: 0 6px 18px var(--brand-glow); margin: 0 auto 18px; }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; text-align: center; }
.auth-card .sub { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 28px; }
.auth-card .switch { color: var(--muted); font-size: 13.5px; text-align: center; margin: 22px 0 0; }
.auth-card .switch a { font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; font-size: 14.5px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: white; color: var(--text); font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; }
.alert.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.alert.ok { background: var(--success-soft); color: var(--success); border: 1px solid #a7f3d0; }
.alert.info { background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(79,70,229,0.18); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }

/* === dashboard layout === */
.dash-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 28px; max-width: 1200px; margin: 0 auto; padding: 36px 24px 80px; }
.dash-side { position: sticky; top: 90px; align-self: start; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; box-shadow: var(--shadow-xs); }
.dash-side .item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; }
.dash-side .item:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.dash-side .item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.dash-side .item svg { width: 18px; height: 18px; flex-shrink: 0; }
.dash-side .item .badge { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: white; font-weight: 700; }
.dash-side hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }

.dash-main h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.dash-main .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 28px; }

.card { background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-xs); margin-bottom: 18px; }
.card h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
.card .card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.card.gradient { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); border-color: rgba(79,70,229,0.18); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 18px; font-size: 14px; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { color: var(--text); font-weight: 600; }
.kv .v code { background: var(--bg-soft); padding: 2px 7px; border-radius: 5px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--brand); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-c { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-xs); }
.stat-c .num { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; color: var(--brand); line-height: 1; margin: 4px 0; }
.stat-c .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat-c .delta { font-size: 11.5px; color: var(--success); margin-top: 4px; }
@media (max-width: 980px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

/* tables */
.tbl-wrap { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-xs); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 18px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--bg-soft); font-weight: 700; color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .pill { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tbl .pill.pending { background: var(--warn-soft); color: var(--warn); }
.tbl .pill.paid { background: var(--success-soft); color: var(--success); }
.tbl .pill.cancelled { background: var(--bg-soft); color: var(--muted); }
.tbl .pill.active { background: var(--success-soft); color: var(--success); }
.tbl .pill.revoked { background: var(--danger-soft); color: var(--danger); }
.tbl code { background: var(--bg-soft); padding: 1px 7px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--brand); }
.empty-state { padding: 50px 30px; text-align: center; color: var(--muted); }
.empty-state .ic { font-size: 36px; opacity: 0.4; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.empty-state p { font-size: 13.5px; margin: 0 0 16px; }

@media (max-width: 880px) {
  .dash-wrap { grid-template-columns: 1fr; }
  .dash-side { position: static; }
  .field-row { grid-template-columns: 1fr; }
}

/* === buy page === */
.buy-wrap { max-width: 1100px; margin: 0 auto; padding: 50px 24px 80px; }
.buy-wrap h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 8px; text-align: center; }
.buy-wrap .sub { color: var(--muted); font-size: 15px; text-align: center; margin: 0 0 40px; }
.steps-bar { display: flex; justify-content: center; gap: 0; margin-bottom: 36px; }
.steps-bar .step { display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--muted); font-size: 13px; font-weight: 600; position: relative; }
.steps-bar .step .num { width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.steps-bar .step.active { color: var(--brand); }
.steps-bar .step.active .num { background: var(--brand); }
.steps-bar .step.done { color: var(--success); }
.steps-bar .step.done .num { background: var(--success); }
.steps-bar .step + .step::before { content: ''; position: absolute; left: -16px; top: 12px; width: 16px; height: 2px; background: var(--line); }
.steps-bar .step.done + .step::before, .steps-bar .step.done::before { background: var(--success); }

.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.plan-pick .pp { background: white; border: 2px solid var(--line); border-radius: 14px; padding: 24px 22px; cursor: pointer; transition: all 0.15s; position: relative; }
.plan-pick .pp:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plan-pick .pp.on { border-color: var(--brand); background: linear-gradient(180deg, white, var(--brand-soft)); }
.plan-pick .pp h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.plan-pick .pp .pr { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; margin: 8px 0 4px; line-height: 1; }
.plan-pick .pp .pr small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-pick .pp .quota { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.plan-pick .pp.on::after { content: '✓'; position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
@media (max-width: 720px) { .plan-pick { grid-template-columns: 1fr; } }

.pay-info-card { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); border: 1px solid rgba(79,70,229,0.18); border-radius: 14px; padding: 24px; margin-bottom: 18px; }
.pay-info-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.pay-info-card .row { display: flex; gap: 18px; align-items: center; }
.pay-info-card .qr-box { width: 140px; height: 140px; background: white; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); flex-shrink: 0; border: 1px solid var(--line); }
.pay-info-card .info { flex: 1; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.pay-info-card .info b { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.pay-info-card .copy-btn { background: white; border: 1px solid var(--line); padding: 3px 10px; border-radius: 5px; font-size: 11.5px; font-weight: 600; cursor: pointer; margin-left: 6px; }

.upload-zone { background: white; border: 2px dashed var(--line-strong); border-radius: 12px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all 0.15s; }
.upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone .ic { font-size: 32px; opacity: 0.4; margin-bottom: 6px; }
.upload-zone p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.upload-zone .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.upload-preview { margin-top: 14px; }
.upload-preview img { max-width: 280px; max-height: 280px; border-radius: 10px; border: 1px solid var(--line); }

/* ====================================================================== */
/* v3 设计令牌 — Brand 渐变 + 暗色 + 现代化 (2026-06-01 升级)             */
/* ====================================================================== */
:root {
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --brand-glow: 0 8px 28px -8px rgba(99,102,241,0.45);
  --info-soft: #eff6ff;
  --info: #3b82f6;
  --r-sm: 6px;
  --r-pill: 999px;
  --transition: cubic-bezier(0.4,0,0.2,1) 0.18s;
}

/* 暗色模式 */
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #131a2d;
  --line: #2c3756;
  --line-strong: #3b4870;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --brand-soft: rgba(99,102,241,0.18);
  --brand-glow: rgba(99,102,241,0.4);
  --accent-soft: rgba(8,145,178,0.15);
  --success-soft: rgba(16,185,129,0.15);
  --warn-soft: rgba(217,119,6,0.15);
  --danger-soft: rgba(220,38,38,0.15);
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 56px rgba(0,0,0,0.7);
}
:root[data-theme="dark"] body { background: var(--bg-soft); }
:root[data-theme="dark"] .topnav { background: rgba(11,16,32,0.88); border-bottom-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .topnav .links a { color: var(--text-2); }
:root[data-theme="dark"] .me-chip { background: var(--bg); border-color: var(--line); color: var(--text-2); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .stat-c { background: var(--bg); border-color: var(--line); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea {
  background: var(--bg); border-color: var(--line); color: var(--text);
}
:root[data-theme="dark"] table { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] th { background: var(--bg-soft) !important; color: var(--text-2) !important; }
:root[data-theme="dark"] tr { border-color: var(--line) !important; }
:root[data-theme="dark"] td { color: var(--text-2); }
:root[data-theme="dark"] .dash-side { background: var(--bg); border-right-color: var(--line); }
:root[data-theme="dark"] .dash-side .item { color: var(--text-2); }
:root[data-theme="dark"] .dash-side .item:hover { background: var(--bg-soft); color: var(--text); }
:root[data-theme="dark"] .dash-side .item.active { background: linear-gradient(135deg, rgba(79,70,229,0.15), rgba(6,182,212,0.15)); color: #818cf8; }
:root[data-theme="dark"] .btn-ghost { background: var(--bg); color: var(--text-2); border-color: var(--line); }
:root[data-theme="dark"] .btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
:root[data-theme="dark"] hr { border-color: var(--line); }

/* Brand 渐变顶栏(原 indigo 实色 → 渐变升级)*/
.topnav .brand .logo { background: var(--brand-grad) !important; box-shadow: var(--brand-glow) !important; }
.btn-primary { background: var(--brand-grad) !important; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -4px rgba(99,102,241,0.55); }

/* 暗色切换按钮 */
.dark-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--line);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-2);
  transition: all var(--transition);
}
.dark-toggle:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
:root[data-theme="dark"] .dark-toggle { background: var(--bg); }

/* 卡片悬浮 */
.card { transition: transform var(--transition), box-shadow var(--transition); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-c { transition: transform var(--transition); }
.stat-c:hover { transform: translateY(-1px); }
