/* ==========================================================================
   星极光账号中台 · 前端样式（TDesign 极简风）
   品牌色 #0052D9 / 背景 #F3F5F8 / 分割线 #E7EAF0 / 圆角 6px / 无阴影
   ========================================================================== */

:root {
  --brand: #0052d9;
  --brand-hover: #366ef4;
  --brand-active: #003cab;
  --brand-light: #ecf2fe;
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e7eaf0;
  --line-strong: #d5dae3;
  --ink: #1f2329;
  --ink-2: #4b5563;
  --ink-3: #8b95a7;
  --ok: #2ba471;
  --ok-light: #e8f8f2;
  --warn: #e37318;
  --warn-light: #fef3e6;
  --danger: #d54941;
  --danger-light: #fdecee;
  --gold: #b7791f;
  --gold-light: #fdf6e8;
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 布局 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-in {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink);
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0052d9, #366ef4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 13.5px;
}
.nav a:hover { background: var(--brand-light); color: var(--brand); }
.nav a.on { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.card-sub { font-size: 12.5px; color: var(--ink-3); margin: 0 0 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-primary:disabled { background: #a8c0f0; border-color: #a8c0f0; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-light); }
.btn-danger { border-color: #f0b5b1; color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.tag-pro { background: var(--gold-light); color: var(--gold); }
.tag-free { background: #f2f4f8; color: var(--ink-3); }
.tag-ok { background: var(--ok-light); color: var(--ok); }
.tag-warn { background: var(--warn-light); color: var(--warn); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-brand { background: var(--brand-light); color: var(--brand); }
.tag-promo { background: var(--warn-light); color: var(--warn); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.input, .select {
  width: 100%; height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--brand); }
.input::placeholder { color: #b4bcc9; }
.input-sm { height: 28px; font-size: 12.5px; padding: 0 8px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 12.5px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { color: var(--ink); font-weight: 500; }

/* ---------- 杂项 ---------- */
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.between { justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
  object-fit: cover;
}

.stat {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.stat-value {
  font-size: 26px;
  font-weight: 600;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}
.stat-delta { font-size: 12px; margin-top: 2px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0;
  background: rgba(31, 35, 41, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 460px;
  padding: 24px;
  max-height: 88vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  animation: toast-in .2s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 套餐卡 ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  position: relative;
  background: var(--card);
}
.plan:hover { border-color: var(--brand); }
.plan.on { border-color: var(--brand); background: var(--brand-light); }
.plan-badge {
  position: absolute; top: -1px; right: -1px;
  background: var(--brand); color: #fff;
  font-size: 11px; padding: 2px 8px;
  border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
}
.plan-badge-promo {
  right: auto; left: -1px;
  background: var(--warn);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.plan-name { font-size: 13px; color: var(--ink-2); }
.plan-price { font-size: 24px; font-weight: 600; margin: 8px 0 2px; letter-spacing: -.5px; }
.plan-price small { font-size: 13px; font-weight: 400; margin-right: 1px; }
.plan-price del { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.plan-per { font-size: 12px; color: var(--ink-3); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .stat { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .nav { display: none; }
}
