/* ========== 全局变量 & 重置 ========== */
:root {
    --bg-gradient: radial-gradient(circle at 10% 20%, #0c0f2a, #020617);
    --glass-bg: rgba(20, 30, 55, 0.75);
    --glass-border: rgba(100, 160, 255, 0.25);
    --glass-border-hover: rgba(79, 142, 255, 0.6);
    --primary: #2b6ef0;
    --primary-dark: #1a4bc0;
    --success: #10b981;
    --danger: #e74c3c;
    --text-light: #eef4ff;
    --text-muted: #a0b4d0;
    --input-bg: #0f1a2e;
    --input-border: #2b4f8c;
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* 动态根字体：最小14px，最大18px，根据视口宽度缩放 */
html {
    font-size: clamp(14px, 2.5vw, 18px);
}

body {
    font-family: 'Inter', 'Segoe UI', '微软雅黑', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
    padding: 1rem;
    min-height: 100vh;
}

/* 容器自适应 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 玻璃卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    transition: all 0.2s ease;
}
.glass-card:hover {
    border-color: var(--glass-border-hover);
}

/* 按钮统一样式 */
.btn, button, .btn-primary, .btn-outline, .btn-success, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: inherit;
}
.btn-primary, button[type="submit"], .btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(43,110,240,0.3);
}
.btn-primary:hover, button[type="submit"]:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43,110,240,0.4);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--text-light);
}
.btn-outline:hover {
    background: rgba(79, 142, 255, 0.15);
    border-color: #7faeff;
}
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c0392b);
}
.btn:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 输入框 - 深色主题，圆润 */
input, select, textarea {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-light) !important;
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(79,142,255,0.3) !important;
}
/* 自动填充覆盖 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-light) !important;
}
::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* 表单组 */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 商品卡片 */
.product-card {
    background: rgba(20,30,55,0.9);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}
.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}
.product-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.price {
    font-size: 2rem;
    color: #ffaa66;
    margin: 0.5rem 0;
}

/* 支付方式 */
.pay-method {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}
.pay-method label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.pay-method input[type="radio"] {
    width: auto;
    accent-color: var(--primary);
}

/* 用户栏 */
.user-bar {
    background: rgba(20,30,55,0.8);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

/* 统计卡片 */
.stat-card {
    background: rgba(20,30,55,0.7);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #ffaa66;
}
.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* 错题本卡片 */
.mistake-card {
    background: rgba(20,30,55,0.6);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

/* 响应式微调 */
@media (max-width: 640px) {
    body { padding: 0.5rem; }
    .glass-card { padding: 1rem; }
    .user-bar { flex-direction: column; text-align: center; }
    .grid { grid-template-columns: 1fr; }
    .btn, button { width: 100%; }
    .product-buttons { flex-direction: column; }
}

/* 提示框 */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.alert-error {
    background: rgba(231,76,60,0.2);
    border: 1px solid #e74c3c;
    color: #ff8888;
}
.alert-success {
    background: rgba(16,185,129,0.2);
    border: 1px solid #10b981;
    color: #88ff88;
}
.hint {
    font-size: 0.7rem;
    margin-top: 0.2rem;
    color: var(--text-muted);
}
.badge {
    background: rgba(43,110,240,0.3);
    border-radius: 40px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
}
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }

/* 手机端底部导航 */
@media (max-width: 640px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(20,30,55,0.95);
        backdrop-filter: blur(10px);
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        border-top: 1px solid rgba(100,160,255,0.3);
        z-index: 100;
    }
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 12px;
        color: #eef4ff;
        text-decoration: none;
        gap: 4px;
    }
    .mobile-bottom-nav i {
        font-size: 20px;
    }
    /* 为底部导航留出空间 */
    body {
        padding-bottom: 70px;
    }
}