/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: linear-gradient(145deg, #f5f7fa 0%, #e9edf5 100%);
    color: #1e293b;
    min-height: 100vh;
    padding-top: 68px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== 顶部栏 ===== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    color: #1e293b;
}
.user-info .balance {
    background: rgba(37, 99, 235, 0.1);
    padding: 6px 14px;
    border-radius: 40px;
    font-weight: 600;
    color: #2563eb;
}
.logout-btn {
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 40px;
    background: rgba(239, 68, 68, 0.08);
    transition: 0.2s;
}
.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ===== 主内容 ===== */
.main-content {
    width: 100%;
    max-width: 480px;
    padding: 0 16px;
}

/* ===== 卡片 ===== */
.card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    padding: 20px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    transition: 0.2s;
}

/* ===== 信息卡片 ===== */
.info-card .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 12px;
}
.info-card .info-item {
    display: flex;
    flex-direction: column;
}
.info-card .info-item .label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.info-card .info-item .value {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}
.info-card .history-result {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
.info-card .history-result .label {
    font-size: 14px;
    color: #94a3b8;
}
.info-card .history-result .value {
    font-size: 16px;
    font-weight: 500;
    color: #2563eb;
}

/* ===== 抽屉容器 ===== */
.drawer-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: 0.3s ease;
}
.drawer-toggle {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 18px;
    color: #0f172a;
}
.drawer-toggle .toggle-icon {
    transition: transform 0.3s;
}
.drawer-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 20px 20px 20px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}
.drawer-content.open {
    max-height: 500px;
    opacity: 1;
}

/* ===== 左右选择 ===== */
.choice-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 10px 0 16px;
}
.choice-btn {
    flex: 1;
    padding: 14px 0;
    border-radius: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.choice-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}
.choice-btn.selected {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

/* ===== 快捷金额（每行3个，整齐排列） ===== */
.quick-amount {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.amount-btn {
    padding: 12px 0;
    border-radius: 30px;
    border: none;
    background: rgba(255,255,255,0.4);
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}
.amount-btn:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.05);
}

/* ===== 下注组 ===== */
.bet-group {
    display: flex;
    gap: 12px;
}
.bet-group input {
    flex: 1;
    padding: 16px 18px;
    border-radius: 40px;
    border: 1px solid rgba(0,0,0,0.04);
    background: rgba(255,255,255,0.6);
    color: #0f172a;
    font-size: 18px;
    outline: none;
    transition: 0.2s;
}
.bet-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.bet-group input::placeholder {
    color: #94a3b8;
}
.bet-group button {
    padding: 16px 32px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.bet-group button:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

/* ===== 消息 ===== */
.msg {
    padding: 12px 16px;
    border-radius: 30px;
    margin-top: 12px;
    text-align: center;
    font-size: 16px;
    display: none;
}
.msg.error {
    display: block;
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.msg.success {
    display: block;
    color: #065f46;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ===== 账户信息 ===== */
.account-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 17px;
}
.info-item span {
    color: #64748b;
}
.info-item strong {
    color: #0f172a;
    font-weight: 600;
}

/* ===== 历史记录 ===== */
.history-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 15px;
    color: #1e293b;
}
.history-item:last-child {
    border-bottom: none;
}

/* ===== 底部导航（抬高） ===== */
.bottom-nav.raised {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 60px;
    padding: 8px 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    min-width: 200px;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    transition: 0.2s;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 500;
}
.nav-item.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}
.nav-item:hover {
    color: #2563eb;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 200;
}
.modal-content {
    max-width: 440px;
    width: 92%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(32px);
    border-radius: 40px;
    padding: 28px 24px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 60px rgba(0,0,0,0.06);
    animation: modalPop 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}
@keyframes modalPop {
    from { opacity:0; transform: scale(0.95) translateY(10px); }
    to { opacity:1; transform: scale(1) translateY(0); }
}
.modal-content .close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: 0.2s;
}
.modal-content .close:hover {
    color: #0f172a;
    transform: rotate(90deg);
}
.modal-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
}
.modal-content input[type="number"],
.modal-content input[type="file"] {
    width: 100%;
    padding: 14px 18px;
    margin: 10px 0;
    border-radius: 40px;
    border: 1px solid rgba(0,0,0,0.04);
    background: rgba(255,255,255,0.6);
    color: #0f172a;
    font-size: 17px;
    outline: none;
}
.modal-content input:focus {
    border-color: #2563eb;
}
.modal-content .btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.modal-content .btn-primary:hover {
    filter: brightness(1.05);
    transform: scale(1.02);
}

/* ===== 正方形二维码 ===== */
.qr-code {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1/1;
    margin: 12px auto;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 确认弹窗 ===== */
.confirm-modal .confirm-info {
    margin: 16px 0;
}
.confirm-modal .confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.confirm-modal .confirm-row span {
    color: #64748b;
}
.confirm-modal .confirm-row strong {
    color: #0f172a;
}

/* ===== 下分弹窗（带边框框住） ===== */
.withdraw-modal .withdraw-info {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(37, 99, 235, 0.08);
}
.withdraw-modal .withdraw-info p {
    color: #1e293b;
    font-size: 16px;
}
.withdraw-modal .withdraw-info strong {
    color: #2563eb;
    font-size: 18px;
}
.withdraw-modal .withdraw-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.withdraw-modal .upload-area {
    background: rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 16px;
    border: 1px dashed rgba(0,0,0,0.08);
}
.withdraw-modal .upload-area label {
    display: block;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}
.withdraw-modal .upload-area input[type="file"] {
    width: 100%;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.04);
    color: #0f172a;
}

/* ===== 登录注册专用 ===== */
.login-body {
    padding: 0;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    background: linear-gradient(145deg, #f0f4fe, #e6edf9);
}
.login-body .container {
    max-width: 420px;
    width: 100%;
    padding: 20px;
}
.login-body .card {
    padding: 40px 32px;
    text-align: center;
}
.login-body .card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}
.login-body .subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 28px;
}
.login-body .input-group {
    margin: 18px 0;
    text-align: left;
}
.login-body .input-group input {
    padding: 16px 20px;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 40px;
    background: rgba(255,255,255,0.6);
    font-size: 17px;
    width: 100%;
    outline: none;
}
.login-body .input-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.login-body .input-line {
    display: block;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 4px;
    transition: width 0.4s;
    margin: 4px auto 0;
}
.login-body .input-group input:focus ~ .input-line {
    width: 60%;
}
.login-body button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.login-body button:hover {
    filter: brightness(1.05);
    transform: scale(1.02);
}
.login-body .msg {
    margin-top: 16px;
}
.login-body p {
    margin-top: 20px;
    font-size: 16px;
    color: #475569;
}
.login-body a {
    color: #2563eb;
    font-weight: 500;
}
.login-body a:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 400px) {
    .info-card .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px 8px;
    }
    .info-card .info-item .value {
        font-size: 16px;
    }
    .choice-btn {
        font-size: 20px;
        padding: 12px 0;
    }
    .quick-amount {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .amount-btn {
        font-size: 14px;
        padding: 10px 0;
    }
    .bet-group input {
        font-size: 16px;
        padding: 14px;
    }
    .bet-group button {
        font-size: 16px;
        padding: 14px 20px;
    }
    .top-bar {
        padding: 0 12px;
    }
    .user-info {
        font-size: 13px;
        gap: 10px;
    }
    .card {
        padding: 16px 14px;
    }
    .modal-content {
        padding: 20px 16px;
    }
}