:root {
  --blue: #3b6ef5;
  --blue-weak: #eef3ff;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e9ecf3;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page { padding: 28px 0 64px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .inner { display: flex; align-items: center; gap: 30px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #3b6ef5, #82a7ff);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
}
.nav { display: flex; gap: 24px; height: 100%; }
.nav a {
  color: #4b5563; font-size: 14px; display: inline-flex; align-items: center;
  border-bottom: 2px solid transparent; padding: 0 2px;
}
.nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.nav a:hover { text-decoration: none; color: var(--blue); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-user { color: var(--muted); font-size: 13px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #cfd6e6; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2f5fe0; border-color: #2f5fe0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--red); border-color: #fbd5d5; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card + .card { margin-top: 16px; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.flex-1 { flex: 1; }

/* ---------------- 首页 ---------------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: 38px; letter-spacing: -0.5px; line-height: 1.25; }
.hero p.lead { color: var(--muted); font-size: 16px; max-width: 640px; margin: 16px auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--blue-weak); color: var(--blue);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; margin-bottom: 20px;
}
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .grid-3, .grid-2, .grid-5 { grid-template-columns: 1fr; }
  .nav { display: none; }
}

/* ---------------- 套餐卡 ---------------- */
.plan { position: relative; display: flex; flex-direction: column; padding: 26px; }
.plan.popular { border-color: #c7d6ff; box-shadow: 0 12px 32px rgba(59, 110, 245, .12); }
.plan .plan-name { font-size: 18px; font-weight: 600; }
.plan .plan-tagline { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 20px; }
.plan .plan-price { font-size: 34px; font-weight: 700; margin: 18px 0 2px; }
.plan .plan-price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 22px; color: #4b5563; }
.plan ul li { padding: 5px 0 5px 24px; position: relative; font-size: 13px; }
.plan ul li::before {
  content: "✓"; position: absolute; left: 0; top: 5px; color: var(--green); font-weight: 700;
}
.plan .btn { margin-top: auto; }

/* ---------------- 统计卡（推广中心同款） ---------------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { border-radius: var(--radius); padding: 20px; border: 1px solid transparent; }
.stat .value { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.stat .label { color: #5b647a; font-size: 13px; margin-top: 6px; }
.stat.tint-blue { background: #eef3ff; border-color: #e2eaff; }
.stat.tint-violet { background: #f6f1ff; border-color: #ece2ff; }
.stat.tint-mint { background: #edfaf3; border-color: #dcf5e8; }
.stat.tint-gray { background: #f3f5f9; border-color: #e8ecf3; }
.stat.tint-amber { background: #fff7ea; border-color: #ffedcf; }
.stat .badge-btn {
  background: var(--blue); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 6px;
  font-weight: 500; cursor: pointer; border: none;
}
.help-dot {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #c3cad9;
  color: #98a1b3; font-size: 11px; align-items: center; justify-content: center; cursor: help;
}

/* ---------------- Tab ---------------- */
.tabs { display: flex; gap: 34px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a {
  padding: 12px 2px; color: #4b5563; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }
.tabs a:hover { text-decoration: none; color: var(--blue); }

/* ---------------- 表格 ---------------- */
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
table.table th { color: var(--muted); font-weight: 500; background: #fafbfd; }
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: #fcfdff; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #dbe0ea; border-radius: 8px; padding: 9px 12px;
  font-size: 14px; color: var(--text); background: #fff; outline: none; transition: border .15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 110, 245, .12); }
textarea.input { min-height: 90px; resize: vertical; }
.form-narrow { max-width: 420px; }
.inline-form { display: inline; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }

/* ---------------- 提示 ---------------- */
.alert { border-radius: 8px; padding: 11px 14px; margin-bottom: 18px; font-size: 13px; }
.alert-ok { background: #ecfdf3; border: 1px solid #c9f0d8; color: #137a43; }
.alert-err { background: #fef2f2; border: 1px solid #fbd5d5; color: #b42318; }
.alert-info { background: #eff6ff; border: 1px solid #d8e6ff; color: #1d4ed8; }

/* ---------------- 状态徽标 ---------------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.badge-active { background: #ecfdf3; color: #137a43; }
.badge-pending { background: #fff7ea; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b42318; }
.badge-muted { background: #f3f5f9; color: #5b647a; }
.badge-blue { background: var(--blue-weak); color: var(--blue); }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; color: var(--muted); padding: 36px 12px; font-size: 13px; }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 26px 0; color: var(--muted); font-size: 12px; }
.footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------- 登录卡 ---------------- */
.auth-wrap { max-width: 420px; margin: 56px auto; }
.auth-card { padding: 30px; }
.auth-title { font-size: 20px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ---------------- 详情 ---------------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.copy-box { display: flex; gap: 0; }
.copy-box .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.copy-box .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; }

/* ---------------- 推广 ---------------- */
.steps { display: grid; gap: 18px; margin-top: 8px; }
.step { display: flex; gap: 14px; }
.step .num {
  width: 26px; height: 26px; border-radius: 7px; background: var(--blue-weak); color: var(--blue);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 13px;
}
.rate { color: var(--orange); font-weight: 600; }

/* ---------------- 管理端 ---------------- */
.admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.admin-kpi .num { font-size: 24px; font-weight: 700; }

/* ---------------- 二维码 ---------------- */
.qr { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: inline-block; background: #fff; }
