/* ============================================================
 * 微信授权中转平台 - 全新设计系统（前台 + 代理中心共用）
 * 靛蓝/青色系 · 卡片式 · 圆角12px · system-ui · 无第三方UI框架
 * ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-100: #eef2ff;
  --cyan: #06b6d4;
  --cyan-600: #0891b2;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 20px 50px -20px rgba(79, 70, 229, .35);
  --grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #06b6d4 100%);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

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

img, svg { max-width: 100%; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12px;
}

/* ---------------- 通用布局 ---------------- */
.wxa-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wxa-main { padding: 28px 0 60px; }
.wxa-grid { display: grid; gap: 20px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 24px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); flex: none; }

/* ---------------- 顶部导航（前台） ---------------- */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 26px; }
.brand { font-size: 17px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex: none;
}
.topnav-menu { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.topnav-menu a {
  padding: 7px 13px; border-radius: 999px; color: var(--text-2); font-weight: 500; transition: .15s;
}
.topnav-menu a:hover { color: var(--primary); background: var(--primary-100); }
.topnav-menu a.on { color: var(--primary); background: var(--primary-100); font-weight: 600; }
.topnav-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------- Hero ---------------- */
.hero { background: var(--grad); color: #fff; padding: 68px 0 96px; position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; opacity: .18; background: #fff;
}
.hero::before { width: 420px; height: 420px; top: -180px; right: -80px; }
.hero::after { width: 260px; height: 260px; bottom: -160px; left: -60px; }
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; text-align: center; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: .5px; margin-bottom: 14px; }
.hero p { font-size: 15px; opacity: .92; max-width: 640px; margin: 0 auto 26px; }
.hero-tags { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hero-tags span {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  padding: 6px 14px; border-radius: 999px; font-size: 13px;
}

/* 前台叠压卡片 */
.hero-overlap { margin-top: -60px; position: relative; z-index: 2; }

/* ---------------- 区块 ---------------- */
.section { margin-top: 44px; }
.section-head { text-align: center; margin-bottom: 26px; }
.section-head h2 { font-size: 22px; font-weight: 800; }
.section-head p { color: var(--text-2); margin-top: 6px; }

/* ---------------- 价格卡片 ---------------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.price-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 30px 26px; text-align: center; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s; position: relative;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.price-card.featured { border: 2px solid var(--primary); }
.price-card .badge-top {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: 12px; padding: 3px 14px; border-radius: 999px;
}
.price-card .p-name { font-size: 16px; font-weight: 700; color: var(--text-2); }
.price-card .p-price { font-size: 38px; font-weight: 800; color: var(--primary); margin: 10px 0 2px; }
.price-card .p-price small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.price-card .p-days { color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
.price-card ul { list-style: none; text-align: left; margin: 0 0 22px; }
.price-card ul li { padding: 7px 0; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.price-card ul li:last-child { border-bottom: 0; }
.price-card ul li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 8px; }

/* ---------------- 功能特性 ---------------- */
.feature-card { padding: 24px; text-align: center; }
.feature-ico {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 13px;
  background: var(--primary-100); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.feature-card h3 { font-size: 15px; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 13px; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font); color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.textarea { resize: vertical; min-height: 120px; }
.form-text { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.form-inline { display: flex; gap: 10px; }
.form-inline .input { flex: 1; }

.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-cards input[type="radio"] { display: none; }
.radio-cards label {
  flex: 1; min-width: 130px; text-align: center; padding: 13px 10px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  font-weight: 600; color: var(--text-2); transition: .15s;
}
.radio-cards input:checked + label {
  border-color: var(--primary); color: var(--primary); background: var(--primary-100);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.radio-cards label small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-size: 14px; font-weight: 600; font-family: var(--font); cursor: pointer;
  transition: .15s; line-height: 1.4; white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .5); }
.btn-primary:hover { opacity: .92; color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 13px 30px; font-size: 15px; border-radius: 10px; }
.btn-ghost-light { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-green { background: #ecfdf5; color: #059669; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-orange { background: #fffbeb; color: #d97706; }
.badge-blue { background: var(--primary-100); color: var(--primary); }
.badge-gray { background: #f1f5f9; color: var(--text-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-green { background: var(--success); }
.dot-red { background: var(--danger); }
.dot-orange { background: var(--warning); }

/* ---------------- 代理中心布局 ---------------- */
.lobby { display: flex; min-height: 100vh; }
.sidenav {
  width: 220px; flex: none; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 90;
}
.sidenav-brand { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 18px; font-weight: 800; font-size: 15px; border-bottom: 1px solid var(--border); }
.sidenav-menu { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidenav-group { font-size: 11px; color: var(--text-3); padding: 12px 10px 6px; letter-spacing: 1px; }
.sidenav-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; transition: .15s;
}
.sidenav-menu a:hover { background: var(--bg); color: var(--primary); }
.sidenav-menu a.on { background: var(--primary-100); color: var(--primary); font-weight: 600; }
.sidenav-menu a .ico { width: 20px; text-align: center; font-style: normal; }
.sidenav-foot { padding: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

.lobby-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 80;
}
.topbar .page-title { font-size: 16px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.balance-chip {
  background: var(--primary-100); color: var(--primary); font-weight: 700;
  padding: 5px 14px; border-radius: 999px; font-size: 13px;
}
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.content { padding: 24px; flex: 1; }
.hamburger { display: none; background: none; border: 1.5px solid var(--border); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 16px; color: var(--text-2); }
.sidenav-mask { display: none; }

/* ---------------- 统计卡 ---------------- */
.stat-card { padding: 20px 22px; display: flex; align-items: center; gap: 14px; }
.stat-ico {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary-100);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex: none;
}
.stat-ico.alt { background: #ecfeff; color: var(--cyan-600); }
.stat-ico.warn { background: #fffbeb; color: #d97706; }
.stat-ico.ok { background: #ecfdf5; color: #059669; }
.stat-num { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { color: var(--text-2); font-size: 13px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 14px; background: #f8fafc; color: var(--text-2);
  font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbff; }
.table .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-tip { text-align: center; color: var(--text-3); padding: 44px 0; }
.empty-tip .big { font-size: 34px; margin-bottom: 8px; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; list-style: none; }
.pagination li a, .pagination li span {
  padding: 6px 12px; border-radius: 7px; border: 1.5px solid var(--border);
  color: var(--text-2); background: #fff; font-size: 13px; display: inline-block;
}
.pagination li.active span { background: var(--grad); color: #fff; border-color: transparent; }
.pagination li.disabled span { opacity: .45; }

/* ---------------- 提示条 ---------------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-info { background: var(--primary-100); color: var(--primary-600); border-color: #e0e7ff; }
.alert-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

/* 强提醒（密码90天） */
.pwd-alert {
  background: linear-gradient(90deg, #fef3c7, #ffedd5);
  border-bottom: 1px solid #fde68a; color: #92400e; padding: 10px 24px;
  font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ---------------- 纯CSS柱状图 ---------------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding: 10px 4px 0; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bars .bar {
  width: 100%; max-width: 26px; background: var(--grad); border-radius: 5px 5px 2px 2px;
  min-height: 3px; transition: height .3s; position: relative; opacity: .85;
}
.bars .bar:hover { opacity: 1; }
.bars .bar-val { font-size: 10px; color: var(--text-3); }
.bars .bar-label { font-size: 10px; color: var(--text-3); transform: rotate(0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.top-list li { list-style: none; padding: 9px 0; border-bottom: 1px dashed var(--border); display: flex; align-items: center; gap: 10px; }
.top-list { margin: 0; }
.top-list .rank {
  width: 22px; height: 22px; border-radius: 6px; background: var(--primary-100); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none;
}
.top-list .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .t-val { font-weight: 700; color: var(--primary); }

/* ---------------- 弹窗 / Toast ---------------- */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1000;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
  max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: popIn .22s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 22px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 18px; background: none; border: 0; }
.modal-body { padding: 22px; overflow-y: auto; line-height: 1.8; }
.modal-foot { padding: 0 22px 22px; }

#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #1e293b; color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 14px; z-index: 2000; transition: transform .25s; box-shadow: var(--shadow-lg);
  max-width: 86vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }
#toast.ok { background: #059669; }

/* ---------------- 支付页 ---------------- */
.pay-box { max-width: 420px; margin: 30px auto; }
.pay-amount { text-align: center; padding: 8px 0 18px; }
.pay-amount .num { font-size: 34px; font-weight: 800; color: var(--primary); }
.qr-holder {
  width: 240px; height: 240px; margin: 0 auto 14px; padding: 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.qr-holder svg, .qr-holder img { display: block; }
.pay-tip { text-align: center; color: var(--text-2); font-size: 13px; }
.pay-status { text-align: center; margin-top: 14px; font-weight: 600; }

/* ---------------- 信息列表 ---------------- */
.info-list .row { display: flex; padding: 10px 0; border-bottom: 1px dashed var(--border); gap: 14px; }
.info-list .row:last-child { border-bottom: 0; }
.info-list .k { width: 110px; flex: none; color: var(--text-2); }
.info-list .v { flex: 1; min-width: 0; word-break: break-all; }

.copy-box {
  background: #f8fafc; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.copy-box .txt { flex: 1; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--border); background: #fff; padding: 26px 0; color: var(--text-3); font-size: 13px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-inner a { color: var(--text-2); }

/* ---------------- 登录页 ---------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #eef2ff 0%, #f4f6fb 40%, #ecfeff 100%); }
.auth-card { width: 100%; max-width: 400px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .brand-logo { width: 52px; height: 52px; border-radius: 15px; font-size: 22px; margin-bottom: 12px; }
.auth-head h1 { font-size: 20px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .hero h1 { font-size: 26px; }
}

@media (max-width: 768px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .topnav-menu { display: none; }
  .topnav .btn-sm { padding: 6px 10px; }
  .hero { padding: 44px 0 84px; }

  /* 侧栏抽屉 */
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .sidenav {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidenav.open { transform: translateX(0); }
  .sidenav-mask.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 85; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-inline { flex-direction: column; }
  .info-list .k { width: 92px; }
}
