/* ============================================================
   时空ai数据 · 会员系统（登录/注册 · 会员中心 · 管理后台）
   与终端同色系：深色底 + 金色强调 + 红涨绿跌
   ============================================================ */
:root {
  --bg: #0d1015;
  --bg-2: #11161d;
  --panel: #151a21;
  --panel-2: #1b212b;
  --panel-3: #212936;
  --line: #252c38;
  --text: #d5dbe5;
  --muted: #78828f;
  --up: #ef232a;
  --down: #14b143;
  --accent: #f0b90b;
  --blue: #4a9eff;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 13px/1.6 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 12px; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.accent { color: var(--accent) !important; }
.spacer { flex: 1; }
.mono { font-family: Consolas, "Courier New", monospace; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
code, .code {
  background: #0f141a; border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-family: Consolas, monospace; font-size: 12px;
}

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 14px; font: inherit; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #39414f; background: #263041; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #191300; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: #ffc91f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--up); border-color: rgba(239, 35, 42, .45); }
.btn.danger:hover { background: rgba(239, 35, 42, .12); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; padding: 10px; font-size: 14px; }

.input, select.input, textarea.input {
  background: #0f141a; border: 1px solid var(--line); border-radius: 7px;
  color: var(--text); padding: 8px 11px; font: inherit; width: 100%; outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; font-family: inherit; }
label.field-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px; margin: -2px 0 14px;
  font-size: 14px; font-weight: 700;
}
.card-head .muted { font-weight: 400; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.tag.ok { color: var(--down); border-color: rgba(20, 177, 67, .45); background: rgba(20, 177, 67, .08); }
.tag.warn { color: var(--accent); border-color: rgba(240, 185, 11, .45); background: rgba(240, 185, 11, .08); }
.tag.err { color: var(--up); border-color: rgba(239, 35, 42, .45); background: rgba(239, 35, 42, .08); }
.tag.blue { color: var(--blue); border-color: rgba(74, 158, 255, .45); background: rgba(74, 158, 255, .08); }

.alert {
  border-radius: 8px; padding: 9px 12px; font-size: 12px; margin: 0 0 12px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.alert.err { color: #ffb3b6; border-color: rgba(239, 35, 42, .45); background: rgba(239, 35, 42, .1); }
.alert.ok { color: #9fe6b8; border-color: rgba(20, 177, 67, .45); background: rgba(20, 177, 67, .1); }
.alert.warn { color: #ffe08a; border-color: rgba(240, 185, 11, .45); background: rgba(240, 185, 11, .09); }

/* ---------------- 登录 / 注册页 ---------------- */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 18% -8%, #1a2433 0%, rgba(13, 16, 21, 0) 60%),
    radial-gradient(900px 500px at 100% 0%, #1d1a0e 0%, rgba(13, 16, 21, 0) 55%),
    var(--bg);
  overflow-y: auto;
}
.auth-wrap {
  max-width: 1160px; margin: 0 auto; padding: 54px 28px 0;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center;
}
.brand .logo-row { display: flex; align-items: center; gap: 10px; }
.brand .logo-mark { color: var(--accent); font-size: 24px; }
.brand .logo-text { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand .logo-sub {
  font-size: 11px; color: var(--accent); border: 1px solid rgba(240, 185, 11, .4);
  border-radius: 999px; padding: 1px 8px;
}
.brand h1 {
  font-size: 32px; line-height: 1.35; margin: 20px 0 14px; font-weight: 700;
  letter-spacing: .3px;
}
.brand > p { color: #9aa5b3; margin: 0; max-width: 470px; }
.feature-list { list-style: none; padding: 0; margin: 26px 0 18px; }
.feature-list li {
  position: relative; padding: 8px 0 8px 26px; color: #aab3c0; font-size: 13px;
}
.feature-list li::before {
  content: "✓"; position: absolute; left: 4px; top: 7px;
  color: var(--down); font-weight: 700;
}
.feature-list b { color: var(--text); margin-right: 6px; }
.brand .preview-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  border: 1px dashed rgba(240, 185, 11, .4); border-radius: 8px;
  padding: 8px 12px; color: #d9c27a; font-size: 12px; background: rgba(240, 185, 11, .05);
}

.auth-card {
  background: linear-gradient(180deg, #171d26, #12171e);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 26px 22px; box-shadow: var(--shadow);
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; background: transparent; border: 1px solid transparent;
  color: var(--muted); padding: 9px 0; border-radius: 8px;
  font: inherit; font-size: 14px; cursor: pointer; transition: .15s;
}
.auth-tabs button.active { background: var(--panel-3); color: var(--text); border-color: var(--line); font-weight: 700; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.auth-field input {
  width: 100%; background: #0f141a; border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); padding: 9px 12px; font: inherit; outline: none;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-field input::placeholder { color: #4d5665; }
.auth-hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; text-align: center; }
.auth-hint a { color: var(--accent); }
.auth-foot { color: #5d6675; font-size: 11px; text-align: center; margin-top: 18px; }

/* 套餐卡片 */
.plans {
  max-width: 1160px; margin: 34px auto 0; padding: 0 28px 56px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.plan {
  background: linear-gradient(180deg, #161c25, #12171e);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 6px; position: relative;
}
.plan:hover { border-color: #39414f; }
.plan.featured { border-color: rgba(240, 185, 11, .55); box-shadow: 0 0 0 1px rgba(240, 185, 11, .12), var(--shadow); }
.plan .plan-top { display: flex; align-items: center; gap: 8px; }
.plan .plan-name { font-size: 15px; font-weight: 700; }
.plan .plan-price { font-size: 28px; font-weight: 700; color: var(--text); margin: 6px 0 2px; }
.plan .plan-price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan .plan-desc { color: var(--muted); font-size: 12px; min-height: 34px; }
.plan ul { list-style: none; padding: 0; margin: 10px 0 16px; display: grid; gap: 6px; }
.plan ul li { color: #aab3c0; font-size: 12px; padding-left: 18px; position: relative; }
.plan ul li::before { content: "·"; position: absolute; left: 6px; color: var(--accent); }
.plan .btn { margin-top: auto; }
.plan .corner {
  position: absolute; top: -9px; right: 14px; font-size: 10px; padding: 1px 8px;
  border-radius: 999px; background: var(--accent); color: #191300; font-weight: 700;
}

/* 收款码 / 会员开通 */
.pay-box {
  max-width: 1000px; margin: 18px auto 40px; padding: 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px;
  background: linear-gradient(180deg, #161c25, #12171e);
  border: 1px solid rgba(240,185,11,.28); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.22);
}
.pay-kicker { color: var(--accent); font-size: 11px; letter-spacing: 1.2px; font-weight: 700; }
.pay-copy h2 { margin: 6px 0 4px; font-size: 20px; }
.pay-amount { color: var(--accent); font-size: 34px; font-weight: 800; margin: 10px 0 8px; }
.pay-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 14px; }
.pay-qr-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pay-qr {
  width: 100%; max-width: 280px; border-radius: 10px; display: block;
  border: 1px solid var(--line); background: #fff;
}
.pay-qr-cap { color: #aab3c0; font-size: 11px; text-align: center; }
.pay-qr-sub { color: #5d6675; font-size: 10px; text-align: center; }
.pay-mini {
  display: flex; align-items: center; gap: 18px; margin-top: 16px;
  padding: 14px; border: 1px solid rgba(240,185,11,.24); border-radius: 12px;
  background: rgba(240,185,11,.04);
}
.pay-mini-copy { flex: 1; min-width: 0; }
.pay-mini-copy b { font-size: 14px; }
.pay-mini-copy p { margin: 5px 0 6px; font-size: 12px; line-height: 1.65; }
.pay-mini-tip { color: var(--muted); font-size: 11px; }
.pay-mini-qr {
  width: 170px; max-width: 45%; border-radius: 8px; display: block;
  border: 1px solid var(--line); background: #fff; flex: 0 0 auto;
}
@media (max-width: 760px) {
  .pay-box { grid-template-columns: 1fr; padding: 16px; margin: 14px 14px 30px; }
  .pay-qr-wrap { order: -1; }
  .pay-qr { max-width: 240px; }
  .pay-mini { align-items: flex-start; }
  .pay-mini-qr { width: 130px; }
}

/* ---------------- 后台 / 会员中心布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 216px; background: var(--bg-2);
  border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .sb-brand {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.sidebar .sb-brand .logo-mark { color: var(--accent); font-size: 18px; }
.sidebar .sb-brand b { font-size: 13px; }
.sidebar .sb-brand .muted { display: block; font-size: 10px; line-height: 1.2; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: 8px; color: #9aa5b3; cursor: pointer; font-size: 13px;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--panel); }
.nav-item.active { background: rgba(240, 185, 11, .1); color: var(--accent); border-color: rgba(240, 185, 11, .18); }
.nav-item .ico { width: 16px; text-align: center; }
.sb-user {
  margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 4px;
  display: flex; align-items: center; gap: 9px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700; font-size: 13px; flex: 0 0 30px;
}
.sb-user .who { min-width: 0; line-height: 1.3; }
.sb-user .who b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.sb-user .who span { font-size: 10px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 20px 26px 60px; }
.main-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.main-head h2 { font-size: 18px; margin: 0; }
.main-head .muted { margin-top: 2px; }

/* 顶部导航（会员中心） */
.topnav {
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  height: 50px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topnav .logo-mark { color: var(--accent); font-size: 18px; }
.topnav b { font-size: 14px; }
.topnav a { color: #9aa5b3; font-size: 13px; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.on { color: var(--accent); }
.member-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 22px 70px; }
.member-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .member-grid { grid-template-columns: 1fr; } }

/* 统计卡 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 25px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .s { color: #5d6675; font-size: 11px; margin-top: 2px; }

/* 进度条 */
.progress { height: 8px; background: #0f141a; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress > i.hot { background: var(--up); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row .num { font-size: 12px; color: var(--muted); min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.table th {
  background: var(--panel-2); color: var(--muted); font-weight: 400;
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.table td { padding: 8px 12px; border-bottom: 1px solid rgba(37, 44, 56, .6); vertical-align: middle; }
table.table tbody tr:hover { background: rgba(33, 41, 54, .5); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar select.input { width: auto; }
.toolbar .search { width: 220px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--muted); }

/* 抽屉 / 弹窗 */
.drawer-back {
  position: fixed; inset: 0; background: rgba(5, 7, 10, .55);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 40;
}
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw;
  background: #131920; border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .22s ease; z-index: 50;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 16px 18px 40px; overflow-y: auto; }
.drawer-body h4 { margin: 18px 0 8px; font-size: 13px; color: #aab3c0; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 12px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }

.modal-back {
  position: fixed; inset: 0; background: rgba(5, 7, 10, .6); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  width: 540px; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Key 明文提示 */
.key-reveal {
  background: rgba(240, 185, 11, .08); border: 1px dashed rgba(240, 185, 11, .5);
  border-radius: 8px; padding: 10px 12px; margin: 10px 0;
  font-family: Consolas, monospace; font-size: 13px; color: #ffe08a;
  word-break: break-all; display: flex; align-items: center; gap: 10px;
}
.key-reveal .spacer { flex: 1; }

/* 空状态 */
.empty { padding: 34px 10px; text-align: center; color: var(--muted); }
.empty .big { font-size: 26px; margin-bottom: 8px; opacity: .7; }

/* 趋势柱 */
.trend { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 10px; }
.trend .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; align-items: center; }
.trend .bar i { width: 100%; background: rgba(240, 185, 11, .7); border-radius: 3px 3px 0 0; min-height: 2px; display: block; }
.trend .bar i.blue { background: rgba(74, 158, 255, .65); }
.trend .bar span { font-size: 9px; color: #5d6675; white-space: nowrap; }

/* 响应式 */
@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 30px; }
  .brand h1 { font-size: 26px; }
  .plans { grid-template-columns: 1fr; }
  .sidebar { width: 68px; flex-basis: 68px; padding: 12px 8px; }
  .sidebar .sb-brand b, .sidebar .sb-brand .muted, .nav-item span.t { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .sb-user .who { display: none; }
  .main { padding: 16px 14px 50px; }
}
