:root {
    --primary: #4f6ef7;
    --primary-dark: #3a55d4;
    --success: #22c55e;
    --danger: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f3f5fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

/* ============ 顶部导航 ============ */
.navbar {
    background: var(--card);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
    max-width: 1000px; margin: 0 auto; padding: 0 20px;
    height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text); font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-light); }
.nav-balance { color: var(--success); font-weight: 700; }
.nav-logout { cursor: pointer; color: var(--text-light); background: none; border: none; font-size: 14px; }
.nav-logout:hover { color: var(--danger); }

/* ============ 布局 ============ */
.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px 48px; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 28px;
    margin-bottom: 24px;
    overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.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; background: var(--primary); border-radius: 2px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.form-input {
    width: 100%; height: 44px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none; transition: border .2s;
}
.form-input:focus { border-color: var(--primary); }
.form-tip { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; margin: 10px 0; min-height: 18px; }

.btn {
    display: inline-block; height: 44px; line-height: 44px; padding: 0 28px;
    border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
    background: var(--primary); color: #fff; transition: background .2s;
    text-align: center;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #a5b4fc; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #eef2ff; }

/* ============ 登录/注册页 ============ */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 60px); }
.auth-card { width: 400px; max-width: 92vw; }
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 26px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-light); margin-top: 18px; }

/* ============ 余额卡片 ============ */
.balance-card {
    background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
    color: #fff; border-radius: var(--radius); padding: 32px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.balance-num { font-size: 40px; font-weight: 700; margin-top: 8px; }
.balance-label { opacity: .85; font-size: 14px; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f0f2ff; }

/* ============ 充值页 ============ */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.pkg-card {
    border: 2px solid var(--border); border-radius: 10px; padding: 18px 10px;
    text-align: center; cursor: pointer; transition: all .15s;
}
.pkg-card:hover { border-color: #c7d2fe; }
.pkg-card.selected { border-color: var(--primary); background: #eef2ff; }
.pkg-amount { font-size: 22px; font-weight: 700; color: var(--text); }
.pkg-amount small { font-size: 13px; font-weight: 400; }
.pkg-name { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.pkg-card.member-card { border-color: #f59e0b; background: #fffbeb; }
.pkg-card.member-card.selected { border-color: #d97706; background: #fef3c7; }
.pkg-badge { display: inline-block; background: #f59e0b; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-bottom: 6px; font-weight: 600; letter-spacing: 1px; }

/* ============ 会员状态条 ============ */
.member-bar {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff; border-radius: var(--radius); padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.member-bar-inactive {
    background: #f1f5f9; color: #475569; border: 1px dashed #cbd5e1;
}
.member-title { font-size: 16px; font-weight: 700; }
.member-sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.member-bar .btn { background: #fff; color: #d97706; font-weight: 600; }
.member-bar .btn:hover { background: #fff7ed; }

.pay-methods { display: flex; gap: 14px; }
.pay-method {
    flex: 1; border: 2px solid var(--border); border-radius: 10px;
    padding: 16px; text-align: center; cursor: pointer; font-size: 15px; transition: all .15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pay-method.selected { border-color: var(--primary); background: #eef2ff; font-weight: 700; }
.pay-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pay-dot-alipay { background: #1677ff; }
.pay-dot-wxpay { background: #09bb07; }

/* ============ 二维码弹窗 ============ */
.modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 200; justify-content: center; align-items: center;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff; border-radius: 14px; padding: 32px 36px; width: 380px; max-width: 92vw;
    text-align: center; position: relative;
}
.modal-close {
    position: absolute; top: 10px; right: 14px; font-size: 22px; color: var(--text-light);
    cursor: pointer; background: none; border: none;
}
.modal-amount { font-size: 30px; font-weight: 700; color: var(--danger); margin: 6px 0 18px; }
.qr-box { display: flex; justify-content: center; padding: 12px; border: 1px solid var(--border); border-radius: 10px; width: 224px; margin: 0 auto; }
.modal-tip { margin-top: 16px; font-size: 14px; color: var(--text-light); }
.modal-status { margin-top: 10px; font-size: 14px; color: var(--primary); }
.modal-status.paid { color: var(--success); font-weight: 700; }

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--text-light); font-weight: 500; background: #fafafa; }
.table-empty { text-align: center; color: var(--text-light); padding: 36px 0 !important; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-success { background: #dcfce7; color: #16a34a; }
.tag-wait { background: #fef3c7; color: #d97706; }
.tag-closed { background: #f3f4f6; color: #9ca3af; }
.amount-in { color: var(--success); font-weight: 700; }
.amount-out { color: var(--danger); font-weight: 700; }

/* ============ Tabs & 分页 ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
    padding: 8px 20px; border-radius: 8px; cursor: pointer; font-size: 14px;
    background: #f3f4f6; color: var(--text-light); border: none;
}
.tab.active { background: var(--primary); color: #fff; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; font-size: 14px; color: var(--text-light); }
.pager button { padding: 6px 14px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 13px; }
    .card { padding: 20px; }
    .pay-methods { flex-direction: column; }
    .table-wrap { overflow-x: auto; }
}
