:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #080918;
  color: #f8f8ff;
  --panel: rgba(20, 22, 45, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --muted: #a8abc1;
  --orange: #ff9f37;
  --orange-2: #ff7b26;
  --purple: #8b7dff;
  --success: #5de6a7;
  --danger: #ff7f8f;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 78% -15%, rgba(108, 85, 255, .22), transparent 32%), radial-gradient(circle at 5% 20%, rgba(255, 139, 46, .11), transparent 30%), #080918; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; padding: 14px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(8, 9, 24, .88); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 16px; font-size: 22px; font-weight: 800; }
.brand img { width: 142px; max-height: 46px; object-fit: contain; object-position: left center; }
.brand span { padding-left: 16px; border-left: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.session-name { color: var(--muted); margin-right: 8px; }
.button { display: inline-flex; min-height: 42px; padding: 0 18px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; color: #fff; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--orange), var(--orange-2)); box-shadow: 0 10px 30px rgba(255, 128, 37, .18); }
.button-ghost { background: rgba(255,255,255,.04); border-color: var(--line); }
.button-wide { width: 100%; margin-top: 8px; }

.auth-shell { width: min(1160px, calc(100% - 40px)); min-height: calc(100vh - 76px); margin: auto; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(40px, 7vw, 100px); padding: 70px 0; }
.auth-intro, .auth-card { min-width: 0; }
.auth-intro h1 { max-width: 700px; margin: 12px 0 18px; font-size: clamp(40px, 5vw, 68px); line-height: 1.08; }
.auth-intro > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.scope-note { display: inline-flex; margin-top: 24px; padding: 12px 16px; border: 1px solid rgba(255,159,55,.28); border-radius: 12px; color: #ffc989; background: rgba(255,159,55,.07); }
.eyebrow { margin: 0; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.auth-card, .panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 24px 70px rgba(0,0,0,.25); backdrop-filter: blur(16px); }
.auth-card { padding: 34px; border-radius: 24px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; margin-bottom: 28px; background: rgba(255,255,255,.04); border-radius: 12px; }
.auth-tab { height: 42px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tab.active { color: #fff; background: rgba(255,255,255,.09); }
.auth-form { display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 8px; color: #d8d9e7; font-size: 14px; }
.field-label { display: inline-flex; align-items: baseline; gap: 4px; }
.auth-form input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: #fff; background: rgba(0,0,0,.18); }
.auth-form input:focus { border-color: rgba(255,159,55,.72); box-shadow: 0 0 0 3px rgba(255,159,55,.1); }
.required-mark { color: var(--danger); }
.sms-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.sms-code-row .button { min-width: 108px; padding: 0 12px; white-space: nowrap; }
.field-message { min-height: 18px; margin-top: -2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.field-message.error { color: var(--danger); }
.agreement-consent { display: flex !important; align-items: flex-start; gap: 9px !important; line-height: 1.55; }
.agreement-consent > span { min-width: 0; }
.auth-form .agreement-consent input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 18px; width: 18px !important; min-width: 18px; height: 18px !important; min-height: 18px; margin: 2px 0 0; padding: 0; border: 1px solid #d7d9e4; border-radius: 4px; background: #fff; box-shadow: none; cursor: pointer; }
.auth-form .agreement-consent input[type="checkbox"]:checked { position: relative; border-color: #20b86a; background: #fff; }
.auth-form .agreement-consent input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #16a05a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.auth-form .agreement-consent input[type="checkbox"]:focus-visible { outline: 3px solid rgba(32, 184, 106, .24); outline-offset: 2px; }
.agreement-consent a, .auth-link { color: #ffc476; }
.agreement-consent a:hover, .auth-link:hover { text-decoration: underline; }
.auth-switch { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.auth-link { padding: 0; border: 0; background: transparent; cursor: pointer; }
.form-message { min-height: 22px; color: var(--muted); }
.form-message.error { color: var(--danger); }

.member-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); width: min(1500px, calc(100% - 40px)); margin: 34px auto 70px; gap: 28px; }
.sidebar { position: sticky; top: 110px; height: fit-content; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,17,36,.78); }
.nav-item { min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px; color: var(--muted); text-align: left; background: transparent; cursor: pointer; }
.nav-item.active { color: #fff; background: linear-gradient(135deg, rgba(255,159,55,.2), rgba(139,125,255,.14)); }
.content { min-width: 0; }
.content-section { display: grid; gap: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h1 { margin: 8px 0 0; font-size: 34px; }
.status-badge { padding: 8px 12px; border: 1px solid rgba(93,230,167,.28); border-radius: 999px; color: var(--success); background: rgba(93,230,167,.08); }
.status-panel { padding: 18px 20px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--panel); }
.status-panel.error { border-color: rgba(255,127,143,.35); color: #ffc0c8; }
.panel { padding: 24px; border-radius: 18px; }
.panel h2 { margin: 0 0 18px; font-size: 20px; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; }
.panel-heading p, .panel-note { color: var(--muted); }
.identity-grid, .metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.identity-card, .metric-card { min-height: 126px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.identity-card .label, .metric-card .label { color: var(--muted); font-size: 13px; }
.identity-card .value, .metric-card .value { margin-top: 12px; font-size: 25px; font-weight: 800; word-break: break-word; }
.metric-card .value { color: #fff; }
.metric-card.accent .value { color: #ffc476; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.detail-row .label { color: var(--muted); }
.detail-row .value { text-align: right; overflow-wrap: anywhere; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.recharge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.recharge-card { position: relative; display: grid; gap: 10px; min-height: 178px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.recharge-card h3 { margin: 0; }
.recharge-card .price { font-size: 32px; font-weight: 900; }
.recharge-card .gift { color: #ffc476; }
.recharge-card button { align-self: end; }
.payment-panel { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; border-color: rgba(255,159,55,.35); }
#payment-qrcode { width: 220px; height: 220px; padding: 10px; border-radius: 12px; background: #fff; }

.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
td { color: #e8e9f4; font-size: 14px; }
.empty-state { padding: 30px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.referral-box { display: flex; gap: 18px; align-items: center; }
.referral-box img { width: 112px; height: 112px; object-fit: contain; border-radius: 10px; background: #fff; }
.invite-lock-note { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; }
.referral-share-controls { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(127, 135, 152, .25); }
.referral-share-controls label { display: block; margin: 10px 0 5px; color: var(--muted); font-size: .82rem; }
.referral-share-row { display: flex; gap: 8px; align-items: flex-start; }
.referral-share-row input,
.referral-share-row textarea { min-width: 0; flex: 1; padding: 9px; border: 1px solid rgba(127, 135, 152, .35); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
.referral-share-row .button { white-space: nowrap; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(420px, calc(100% - 48px)); padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #20233f; box-shadow: 0 18px 50px rgba(0,0,0,.35); }

@media (max-width: 1100px) {
  .identity-grid, .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recharge-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .payment-panel { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .auth-shell { width: min(720px, calc(100% - 40px)); grid-template-columns: 1fr; padding: 48px 0; }
  .auth-intro h1 { font-size: clamp(38px, 7vw, 58px); }
}
@media (max-width: 820px) {
  .topbar { position: relative; align-items: flex-start; }
  .brand span, .session-name, .authenticated { display: none; }
  .brand img { width: 112px; }
  .auth-shell { padding: 44px 0; }
  .auth-intro h1 { font-size: 38px; }
  .member-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(5, minmax(120px,1fr)); overflow-x: auto; }
  .nav-item { text-align: center; }
  .two-column { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sms-code-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
  .sms-code-row .button { width: auto; min-width: 0; padding: 0 8px; font-size: 13px; }
  .topbar { padding: 12px 14px; }
  .button { padding: 0 12px; }
  .member-shell, .auth-shell { width: min(100% - 24px, 1500px); }
  .auth-card, .panel { padding: 18px; }
  .identity-grid, .metric-grid, .recharge-grid { grid-template-columns: 1fr; }
  .section-heading h1 { font-size: 28px; }
}
