/* 图形验证码（注册表单） */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.captcha-row .input {
    flex: 1;
    min-width: 0;
}
.captcha-img {
    width: 128px;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: none;
    user-select: none;
}

/* 手机号锁定（获取短信验证码后） */
.input.input-locked {
    background: #f0f3f8;
    color: var(--muted);
    cursor: not-allowed;
}

/* ============================================================
   kaquan 卡券系统 全局样式 v2（电脑端 + 移动端自适应）
   重构要点：更清爽的层级、统一卡片体系、移动端卡片式表格、
   弹窗（绑定手机号）、协议页排版
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --bg: #f3f5f9;
    --card: #ffffff;
    --border: #e5e9f0;
    --border-strong: #d4dae6;
    --text: #172033;
    --text-2: #3d4a63;
    --muted: #75839c;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --warn: #d97706;
    --warn-bg: #fffbeb;
    --warn-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #0891b2;
    --info-bg: #ecfeff;
    --info-border: #a5f3fc;
    --sidebar-bg: #101a30;
    --sidebar-text: #aeb9d1;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(23, 32, 51, .05), 0 4px 14px rgba(23, 32, 51, .05);
    --shadow-lg: 0 16px 40px rgba(23, 32, 51, .16);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: Consolas, "JetBrains Mono", Menlo, Monaco, "Courier New", monospace;
}

* { 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.65;
}

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

/* ================= 整体布局 ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 236px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .28s ease;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff; font-weight: 800; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.brand-name { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px; }

.nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-group { margin-bottom: 12px; }
.nav-group-title {
    font-size: 11px; letter-spacing: 1px; color: #64748b;
    padding: 6px 13px 6px; text-transform: uppercase;
}
.nav-group-title:not(:first-child) { margin-top: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    margin-bottom: 3px;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}
.nav-item-disabled { opacity: .5; cursor: not-allowed; }
.nav-item-disabled:hover { background: none; color: var(--sidebar-text); }
.tag-dev {
    font-style: normal; font-size: 11px;
    background: rgba(255, 255, 255, .14);
    padding: 1px 7px; border-radius: 99px; margin-left: auto;
}

.sidebar-foot {
    padding: 13px 18px; font-size: 12px; color: #5d6b87;
    border-top: 1px solid rgba(255, 255, 255, .07);
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-foot a { color: #7d8bab; }

.overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(16, 26, 48, .55);
    z-index: 90;
    backdrop-filter: blur(2px);
}

.main { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 12px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 11px 22px;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-name { font-weight: 600; color: var(--text-2); }
.icon-btn {
    display: none;
    border: 1px solid var(--border); background: #fff;
    width: 38px; height: 38px; border-radius: 10px;
    font-size: 18px; cursor: pointer; color: var(--text);
    align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); }

.content { padding: 22px; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ================= 卡片 / 统计 ================= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}
.card-title {
    font-size: 15px; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
}
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--border-strong);
}
.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warn::before { background: var(--warn); }
.stat-card.danger::before { background: var(--danger); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-num { font-size: 26px; font-weight: 800; margin-top: 4px; line-height: 1.2; letter-spacing: -.3px; }
.stat-num small { font-size: 13px; color: var(--muted); font-weight: 400; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-card.primary .stat-num { color: var(--primary); }
.stat-card.success .stat-num { color: var(--success); }
.stat-card.warn .stat-num { color: var(--warn); }
.stat-card.danger .stat-num { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
/* 卡片内的表格区：无外框，紧贴卡片 */
.card .table-wrap { margin: 0 -20px -20px; }

table.tbl { width: 100%; border-collapse: collapse; min-width: 620px; }
.tbl th, .tbl td {
    padding: 11px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle; white-space: nowrap;
}
.tbl th {
    background: #f8fafc;
    font-size: 12px; color: var(--muted); font-weight: 600;
    letter-spacing: .3px;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-family: var(--mono); font-size: 13px; }
.tbl .ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 独立表格容器（少数独立使用场景） */
.table-wrap:not(.card .table-wrap) {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 99px; font-size: 12px; line-height: 1.7; font-weight: 500;
    border: 1px solid transparent;
}
.badge-green { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-orange { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-gray { background: #f1f4f9; color: #55627c; border-color: var(--border); }
.badge-blue { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }
.badge-cyan { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }

.role-badge { padding: 2px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.role-admin { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.role-merchant { background: #ecfeff; color: #0284c7; border: 1px solid #a5f3fc; }

.empty { text-align: center; color: var(--muted); padding: 44px 12px; font-size: 14px; }
.empty a { font-weight: 600; }

/* ================= 按钮 ================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    color: var(--text);
    transition: all .15s ease;
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-outline { border-color: var(--border-strong); background: #fff; color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: #f1f4f9; }
.btn-sm { padding: 4px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-danger-outline { border-color: var(--danger-border); color: var(--danger); background: #fff; }
.btn-danger-outline:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-success-outline { border-color: var(--success-border); color: var(--success); background: #fff; }
.btn-success-outline:hover { background: var(--success); border-color: var(--success); color: #fff; }

/* ================= 表单 ================= */
.form-row { margin-bottom: 15px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.form-row .hint, .form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.textarea { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .form-row[style*="grid-column"] { grid-column: 1 / -1; }
.form-check { display: flex; align-items: center; gap: 8px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check-label input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.link-agreement { font-weight: 600; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; margin-bottom: 18px; }
.panel summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; list-style: none; user-select: none; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary::before { content: "▸ "; color: var(--primary); }
.panel[open] summary::before { content: "▾ "; }
.panel-body { padding: 4px 16px 16px; }

/* ================= 工具栏 / 筛选 ================= */
.toolbar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 16px;
}
.card .toolbar { margin: 0 0 16px; }
.toolbar .field { display: flex; flex-direction: column; gap: 5px; }
.toolbar .field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; }

/* ================= 提示条 ================= */
.flash {
    padding: 11px 15px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* ================= 分页 ================= */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 16px; flex-wrap: wrap; }
.pagination .pg {
    padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
    font-size: 13px; color: var(--text-2); background: #fff;
}
.pagination .pg:hover { border-color: var(--primary); color: var(--primary); }
.pagination .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg.disabled { opacity: .45; pointer-events: none; }
.pagination .pg-info { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ================= 图表（纯 CSS 柱状） ================= */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
    width: 100%; max-width: 46px;
    background: linear-gradient(180deg, #93c5fd, #2563eb);
    border-radius: 7px 7px 0 0; min-height: 3px;
    transition: filter .15s ease;
}
.bar:hover { filter: brightness(1.08); }
.bar-label { font-size: 11px; color: var(--muted); }

/* ================= 登录/注册页 ================= */
.auth-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(56, 189, 248, .35), transparent 60%),
        radial-gradient(800px 500px at -10% 110%, rgba(99, 102, 241, .3), transparent 55%),
        linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
    padding: 20px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
    background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
    padding: 34px 30px;
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 15px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; font-weight: 800; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.auth-head h1 { font-size: 21px; margin-bottom: 4px; letter-spacing: .5px; }
.auth-head p { color: var(--muted); font-size: 13px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
    flex: 1; text-align: center; padding: 8px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: 14px; color: var(--muted);
    transition: all .15s ease;
}
.auth-tab:hover { border-color: var(--primary); color: var(--primary); }
.auth-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ================= 卡密展示 ================= */
.card-secret {
    display: inline-flex; align-items: center; gap: 8px;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
    padding: 4px 9px;
    max-width: 100%;
    word-break: break-all;
}
.copy-btn { border: none; background: transparent; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0 4px; flex-shrink: 0; }
.copy-btn:hover { color: var(--primary-dark); }

/* 购买页 */
.buy-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.buy-card {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow);
    flex-wrap: wrap;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.buy-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-lg); }
.buy-card-info { flex: 1; min-width: 220px; }
.buy-card-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.buy-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.buy-card-meta b { color: var(--text-2); }
.buy-card-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.buy-card-price { font-size: 20px; font-weight: 800; color: var(--primary); margin-top: 5px; }
.buy-card-price del { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.buy-card-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.buy-card-form .input { width: 110px; flex: none; }

.amount-strong { color: var(--success); font-weight: 800; font-size: 17px; }

/* 绑定手机号页 */
.bind-tip {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-2);
}
.bind-tip p + p { margin-top: 6px; }
.bind-current { font-size: 13px; }
.bind-current .mono { font-family: var(--mono); color: var(--primary); font-weight: 600; }

/* 空状态（带图标） */
.empty-block { text-align: center; padding: 34px 16px; }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty-block p { color: var(--text-2); margin-bottom: 6px; font-size: 14px; }
.empty-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ================= 弹窗（Modal） ================= */
.modal-mask {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(16, 26, 48, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    animation: modalFade .2s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
    width: 100%; max-width: 400px;
    padding: 26px 26px 22px;
    animation: modalUp .25s ease;
}
@keyframes modalUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.modal-body { font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
.modal-body p + p { margin-top: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ================= 行内充值下拉 ================= */
.recharge-inline summary { cursor: pointer; list-style: none; }
.recharge-inline summary::-webkit-details-marker { display: none; }
.recharge-inline .recharge-panel {
    position: absolute; z-index: 40;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    padding: 14px; width: 280px; margin-top: 6px;
    right: 0;
}
.recharge-inline .recharge-panel .form-row { margin-bottom: 10px; }

/* ================= 页脚（应用内） ================= */
.app-footer {
    padding: 12px 22px;
    font-size: 12px; color: var(--muted);
    border-top: 1px solid var(--border);
    background: #fff;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap;
}

/* ================= 协议页 ================= */
.agreement-body { background: #f6f7fb; }
.agreement-shell { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.agreement-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.agreement-topbar .brand-logo { width: 32px; height: 32px; font-size: 14px; }
.agreement-topbar h1 { font-size: 17px; font-weight: 700; }
.agreement-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.agreement-toc {
    position: sticky; top: 16px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px;
    max-height: calc(100vh - 40px); overflow-y: auto;
}
.agreement-toc .toc-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.agreement-toc ol { list-style: none; counter-reset: toc; }
.agreement-toc li { margin-bottom: 6px; }
.agreement-toc a { font-size: 13px; color: var(--text-2); display: block; padding: 4px 8px; border-radius: 7px; }
.agreement-toc a:hover { background: var(--primary-light); color: var(--primary); }
.agreement-content { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 38px; }
.agreement-content .doc-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.agreement-content .doc-meta { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.agreement-content .doc-count { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 26px; }
.agreement-content h2 { font-size: 18px; font-weight: 800; margin: 30px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.agreement-content h3 { font-size: 15px; font-weight: 700; margin: 22px 0 10px; color: var(--text-2); }
.agreement-content p { margin-bottom: 10px; text-align: justify; font-size: 14px; line-height: 1.9; color: var(--text); }
.agreement-content p.article-head { font-weight: 700; margin-bottom: 6px; }
.agreement-content ol, .agreement-content ul { margin: 6px 0 12px 22px; }
.agreement-content li { margin-bottom: 6px; line-height: 1.85; text-align: justify; }
.agreement-content .clause-strong { font-weight: 700; color: var(--danger); }
.agreement-content .clause-note { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 8px 0 12px; }

/* ================= 响应式（移动端） ================= */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .overlay.show { display: block; }
    .main { margin-left: 0; }
    .icon-btn { display: inline-flex; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 14px; }
    .topbar { padding: 10px 14px; }
    .topbar-name { display: none; }
    .stat-num { font-size: 22px; }
    .agreement-layout { grid-template-columns: 1fr; }
    .agreement-toc { position: static; max-height: 240px; }
    .agreement-content { padding: 22px 18px; }
    .card .table-wrap { margin: 0 -14px -14px; }
    .tbl th, .tbl td { padding: 10px 14px; }
}

/* 移动端：表格转为卡片式（JS 自动填充 data-label） */
@media (max-width: 720px) {
    table.tbl { min-width: 0; }
    .tbl thead { display: none; }
    .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
    .tbl tr {
        border: 1px solid var(--border);
        border-radius: 11px;
        margin: 0 0 10px;
        padding: 6px 12px;
        background: #fff;
    }
    .tbl tbody tr:hover { background: #fff; }
    .tbl td {
        display: flex; justify-content: space-between; align-items: center; gap: 14px;
        border-bottom: 1px dashed var(--border);
        padding: 7px 2px;
        white-space: normal;
        text-align: left !important;
    }
    .tbl td:last-child { border-bottom: none; }
    .tbl td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 600;
        font-size: 12px;
        flex-shrink: 0;
        min-width: 76px;
    }
    .tbl td.num { justify-content: space-between; }
    .tbl td.empty { display: block; text-align: center; padding: 26px 8px; border: none; }
    .tbl td.empty::before { content: none; }
    .tbl td .btn { padding: 5px 12px; }
    .tbl td .card-secret { max-width: 100%; }
    .tbl td .recharge-inline .recharge-panel { position: fixed; left: 12px; right: 12px; width: auto; top: 50%; transform: translateY(-50%); z-index: 300; }
    .toolbar { padding: 12px; }
    .toolbar .input, .toolbar .select { min-width: 100%; width: 100%; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .buy-card { flex-direction: column; align-items: stretch; }
    .buy-card-form .input { width: 100%; flex: 1; }
    .buy-card-form .btn { flex: 1; }
    .pagination .pg-info { width: 100%; margin-left: 0; text-align: center; }
}

@media (max-width: 480px) {
    .content { padding: 12px; }
    .card { padding: 16px; }
    .auth-card { padding: 26px 20px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 13px 14px; }
    .stat-num { font-size: 20px; }
    .app-footer { flex-direction: column; text-align: center; }
}

/* ================= 重置密码结果提示 ================= */
.pwd-result { border-left: 4px solid var(--success); }
.pwd-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 8px; }
.pwd-code {
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 18px; font-weight: 700; letter-spacing: 1px;
    background: #eef8f1; color: var(--success);
    border: 1px dashed rgba(0, 0, 0, .12); border-radius: 8px;
    padding: 6px 12px;
}

/* ================= 表格批量操作条 ================= */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 0 12px; }
.bulk-bar .hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.tbl .chk-cell { width: 52px; text-align: center; }
.tbl .chk-cell input { cursor: pointer; }
.tbl td.chk-cell input:disabled { cursor: not-allowed; opacity: .55; }

/* ================= 公告：滚动横幅 + 弹窗 ================= */
.ann-bar {    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #eff6ff, #f8fbff);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    margin-bottom: 16px;
    overflow: hidden;
}
.ann-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    letter-spacing: .5px;
}
.ann-badge svg { width: 14px; height: 14px; }
.ann-viewport { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.ann-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: annScroll 30s linear infinite;
    will-change: transform;
}
.ann-item { font-size: 13px; color: var(--text-2); }
.ann-item b { color: var(--primary); margin-right: 6px; }
.ann-sep { color: var(--primary-border); margin: 0 16px; }
@keyframes annScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
/* 鼠标悬停暂停滚动，方便看清 */
.ann-viewport:hover .ann-track { animation-play-state: paused; }

.ann-popup { max-width: 520px; }
.ann-popup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ann-popup-head .modal-title { margin-bottom: 0; }
.ann-popup-badge {
    flex: none;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 99px;
}
.ann-popup-body {
    white-space: pre-wrap;
    max-height: 56vh;
    overflow-y: auto;
    line-height: 1.8;
}

@media (max-width: 720px) {
    .ann-bar { padding: 8px 10px; gap: 8px; }
    .ann-item { font-size: 12px; }
    .ann-sep { margin: 0 10px; }
    .ann-popup { width: calc(100vw - 32px); }

    /* 勾选列在卡片模式下单独一行，避免与其它字段挤在一起 */
    .tbl td.chk-cell { border-bottom: 1px dashed var(--border); padding: 8px 2px; }
    .tbl td.chk-cell::before { content: '选择作废'; }
    .tbl td.chk-cell input { margin-left: auto; display: block; width: 18px; height: 18px; }
    .bulk-bar { padding-bottom: 10px; }
}


/* ============================================================
   VIP 等级主题（每个等级整体配色/边角/渐变都不同）
   body 上挂 vip-lv-N + vip-theme-xxx
   ============================================================ */
body.vip-lv-0 {
    --primary: #2563eb; --primary-dark: #1d4ed8;
    --primary-light: #eff6ff; --primary-border: #bfdbfe;
    --vip-grad: linear-gradient(135deg, #60a5fa, #2563eb);
    --vip-tint: rgba(37, 99, 235, .10);
    --vip-line: #bfdbfe; --radius: 14px;
}
body.vip-lv-1.vip-theme-bronze {
    --primary: #b45309; --primary-dark: #92400e;
    --primary-light: #fef3c7; --primary-border: #fde68a;
    --sidebar-bg: #241a12;
    --vip-grad: linear-gradient(135deg, #f59e0b, #92400e);
    --vip-tint: rgba(180, 83, 9, .10);
    --vip-line: #fde68a; --radius: 10px;
}
body.vip-lv-2.vip-theme-silver {
    --primary: #64748b; --primary-dark: #475569;
    --primary-light: #f1f5f9; --primary-border: #cbd5e1;
    --sidebar-bg: #141a24;
    --vip-grad: linear-gradient(135deg, #94a3b8, #475569);
    --vip-tint: rgba(100, 116, 139, .10);
    --vip-line: #cbd5e1; --radius: 8px;
}
body.vip-lv-3.vip-theme-gold {
    --primary: #c2870a; --primary-dark: #a16207;
    --primary-light: #fef9c3; --primary-border: #fde047;
    --sidebar-bg: #23200f;
    --vip-grad: linear-gradient(135deg, #fbbf24, #b45309);
    --vip-tint: rgba(194, 135, 10, .12);
    --vip-line: #fde047; --radius: 16px;
}
body.vip-lv-4.vip-theme-platinum {
    --primary: #0f766e; --primary-dark: #115e59;
    --primary-light: #ccfbf1; --primary-border: #5eead4;
    --sidebar-bg: #0b1f1e;
    --vip-grad: linear-gradient(135deg, #2dd4bf, #0f766e);
    --vip-tint: rgba(15, 118, 110, .12);
    --vip-line: #5eead4; --radius: 18px;
}
body.vip-lv-5.vip-theme-diamond {
    --primary: #7c3aed; --primary-dark: #6d28d9;
    --primary-light: #f5f3ff; --primary-border: #ddd6fe;
    --sidebar-bg: #1b1230;
    --vip-grad: linear-gradient(135deg, #c084fc 0%, #7c3aed 55%, #ec4899 100%);
    --vip-tint: rgba(124, 58, 237, .14);
    --vip-line: #ddd6fe; --radius: 22px;
}

/* 品牌 logo / 导航高亮 / 顶栏跟随等级变色 */
body[class*="vip-lv-"] .brand-logo { background: var(--vip-grad); }
body[class*="vip-lv-"] .nav-item.active { background: var(--vip-grad); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
body[class*="vip-lv-"] .topbar {
    background: linear-gradient(90deg, var(--vip-tint), rgba(255, 255, 255, .94) 42%);
    border-bottom-color: var(--vip-line);
}
body[class*="vip-lv-"] .content { background-image: radial-gradient(circle at 100% 0, var(--vip-tint), transparent 38%); }
body[class*="vip-lv-"] .btn-primary { box-shadow: 0 2px 10px var(--vip-tint); }

/* VIP 徽标 / 顶栏胶囊 */
.vip-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 700; letter-spacing: .2px;
    border: 1px solid transparent; white-space: nowrap;
}
.vip-badge-blue     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.vip-badge-bronze   { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.vip-badge-silver   { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.vip-badge-gold     { background: #fefce8; color: #a16207; border-color: #fde047; }
.vip-badge-platinum { background: #f0fdfa; color: #0f766e; border-color: #5eead4; }
.vip-badge-diamond  { background: linear-gradient(135deg, #faf5ff, #fdf2f8); color: #6d28d9; border-color: #ddd6fe; }

.vip-chip { display: inline-flex; align-items: center; text-decoration: none; }
.vip-chip:hover { text-decoration: none; filter: brightness(.96); }

/* 会员横幅 */
.vip-banner {
    background: var(--vip-grad, linear-gradient(135deg, #60a5fa, #2563eb));
    color: #fff; border-radius: var(--radius); padding: 22px 24px;
    margin-bottom: 18px; position: relative; overflow: hidden;
    box-shadow: 0 14px 34px rgba(23, 32, 51, .18);
}
.vip-banner::after {
    content: ""; position: absolute; right: -60px; top: -70px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}
.vip-banner .vb-kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .88; }
.vip-banner .vb-level { font-size: 30px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
.vip-banner .vb-meta { font-size: 13px; opacity: .92; margin-top: 4px; }
.vip-banner .vb-progress { margin-top: 16px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.vip-banner .vb-progress i { display: block; height: 100%; border-radius: 99px; background: #fff; }
.vip-banner .vb-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-top: 6px; opacity: .92; flex-wrap: wrap; }

/* 等级阶梯 */
.vip-ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.vip-tier {
    position: relative; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px 16px 16px; overflow: hidden;
}
.vip-tier::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tier-grad, var(--border-strong)); }
.vip-tier.tier-blue     { --tier-grad: linear-gradient(90deg, #93c5fd, #2563eb); }
.vip-tier.tier-bronze   { --tier-grad: linear-gradient(90deg, #fcd34d, #92400e); }
.vip-tier.tier-silver   { --tier-grad: linear-gradient(90deg, #e2e8f0, #64748b); }
.vip-tier.tier-gold     { --tier-grad: linear-gradient(90deg, #fde68a, #b45309); }
.vip-tier.tier-platinum { --tier-grad: linear-gradient(90deg, #99f6e4, #0f766e); }
.vip-tier.tier-diamond  { --tier-grad: linear-gradient(90deg, #c084fc, #ec4899); }
.vip-tier.current { border-color: var(--vip-line, var(--primary)); box-shadow: 0 10px 26px rgba(23, 32, 51, .10); }
.vip-tier .t-name { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vip-tier .t-th { font-size: 12px; color: var(--muted); margin-top: 3px; }
.vip-tier .t-benefit { font-size: 12px; color: var(--text-2); margin-top: 9px; line-height: 1.6; min-height: 38px; }
.vip-tier .t-tag {
    position: absolute; right: 12px; top: 12px;
    font-size: 11px; font-weight: 700; color: var(--primary);
    background: var(--primary-light); border: 1px solid var(--primary-border);
    border-radius: 99px; padding: 1px 8px;
}

/* 商品锁定 / 限购 / 非余额支付提示 */
.buy-card.is-locked { opacity: .7; background: #fbfcfe; }
.buy-card.is-locked .buy-card-name { color: var(--muted); }
.buy-card .lock-note {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; padding: 4px 10px; border-radius: 8px;
    font-size: 12px; background: #f1f4f9; color: #55627c; border: 1px solid var(--border);
}
.buy-card .lock-note strong { color: var(--text); }
.buy-card .buy-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* 权限列表 */
.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.perm-item {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 13px 15px; background: #fff; position: relative;
}
.perm-item .p-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perm-item .p-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.perm-item .p-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }

@media (max-width: 720px) {
    .vip-banner { padding: 18px; }
    .vip-banner .vb-level { font-size: 24px; }
    .vip-ladder { grid-template-columns: 1fr; }
    .vip-tier .t-benefit { min-height: 0; }
    .vip-badge { font-size: 11px; padding: 1px 8px; }
    .topbar-user .vip-chip { display: none; }
}

/* ================= VIP 等级配置块（终端） ================= */
.vip-cfg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 2px; margin-bottom: 14px; background: #fbfcfe; }
.vip-cfg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
@media (max-width: 720px) {
    .vip-cfg .form-grid { grid-template-columns: 1fr; }
}
/* ================= 自动发货 / 等级不足锁定 ================= */
.level-lock { text-align: center; padding: 28px 20px; }
.level-lock-icon { font-size: 38px; line-height: 1; margin-bottom: 8px; }
.level-lock-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.level-lock-desc { color: var(--text-2); font-size: 14px; line-height: 1.85; max-width: 660px; margin: 0 auto; }
.level-lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.level-lock code { background: #eef2ff; padding: 1px 6px; border-radius: 6px; }
/* ==================== 版式分层（本轮统一整理） ==================== */
/* 桌面端：固定侧栏稍宽，导航分组标题吸顶，内容区居中限宽，表格更舒展 */
@media (min-width: 961px) {
    .sidebar { width: 250px; }
    .main { margin-left: 250px; }
    .nav-group { margin-bottom: 14px; }
    .nav-group-title {
        position: sticky; top: 0; z-index: 2;
        background: var(--sidebar-bg);
        padding-top: 8px; padding-bottom: 8px;
        letter-spacing: 1.4px;
    }
    .content { max-width: 1360px; padding: 24px 26px 30px; }
    .card { border-radius: 14px; }
    .card:hover { box-shadow: 0 10px 26px rgba(15, 23, 42, .07); }
    .tbl th, .tbl td { padding: 12px 16px; }
    .card .table-wrap { overflow-x: auto; }
}

/* 移动端：抽屉更宽、标题不吸顶、页面标题与筛选条纵向排布 */
@media (max-width: 720px) {
    .sidebar { width: min(88vw, 320px); }
    .nav-group-title { position: static; letter-spacing: 1px; }
    .nav-item { padding: 12px 14px; font-size: 15px; }
    .topbar { padding: 10px 12px; gap: 8px; }
    .topbar-title { font-size: 15px; }
    .content { padding: 12px 12px 20px; }
    .card { border-radius: 12px; }

    /* 浮窗统一改为底部抽屉式，手机上不再被键盘/窄屏挤压 */
    .od-mask, .cd-mask, .coop-mask { align-items: flex-end; padding: 0; }
    .od-box, .cd-box, .coop-box {
        width: 100% !important; max-width: 100% !important;
        max-height: 92vh; border-radius: 16px 16px 0 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .od-box { height: 88vh; }
    .od-head { padding: 12px 14px; }
    .od-body { padding: 12px 14px 20px; }
    .od-row { display: block; padding: 2px 0; }
    .od-row .k { width: auto; font-size: 12px; }
    .coop-box { max-height: 88vh; overflow-y: auto; }

    /* 表格卡片化的行距与按钮尺寸，方便拇指点按 */
    .tbl tr { padding: 8px 12px; margin-bottom: 12px; }
    .tbl td { padding: 8px 2px; gap: 10px; }
    .tbl td .btn { padding: 7px 14px; font-size: 13px; }
    .card .table-wrap { margin: 0 -12px -12px; }
}
/* 分页条上的「每页 N 条」选择器 */
.pagination .pg-size { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pagination .pg-size select {
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    padding: 3px 6px; font-size: 13px; color: var(--text); cursor: pointer;
}
@media (max-width: 720px) {
    .pagination .pg-size { margin-left: auto; }
}