/* ========== 全局变量与重置 ========== */
:root {
    --primary-color: #e60012;
    --primary-light: #ff3b30;
    --primary-dark: #b3000e;
    --primary-gradient: linear-gradient(135deg, #ff3b30 0%, #e60012 50%, #b3000e 100%);
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.85);
    --bg-card-hover: rgba(30, 30, 45, 0.9);
    --border-color: rgba(230, 0, 18, 0.3);
    --border-light: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --success-color: #00c48c;
    --warning-color: #ffab00;
    --danger-color: #ff3b30;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 20px rgba(230, 0, 18, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

body {
    background: 
        radial-gradient(circle at 20% 10%, rgba(230, 0, 18, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(230, 0, 18, 0.1) 0%, transparent 40%),
        var(--bg-dark);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
    color: inherit;
}

/* ========== 通用组件 ========== */
.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;
    padding-bottom: 80px;
    padding-top: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-light);
}

.btn-outline:active {
    background: rgba(230, 0, 18, 0.1);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.input-field {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition);
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ========== 顶部导航栏 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-back {
    position: absolute;
    left: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ========== 底部导航栏 ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.tabbar-item.active {
    color: var(--primary-light);
}

.tabbar-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 登录页专属 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 13px;
}

.login-tabs {
    display: flex;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 4px;
}

.login-tab {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.login-tab.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.captcha-group {
    display: flex;
    gap: 12px;
}

.captcha-group .input-field {
    flex: 1;
}

.captcha-img {
    width: 120px;
    height: 48px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.gender-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.gender-item {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.gender-item.active {
    border-color: var(--primary-color);
    background: rgba(230, 0, 18, 0.1);
    color: var(--primary-light);
}

.tip-text {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== VIP弹窗 ========== */
.vip-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.vip-modal-mask.show {
    display: flex;
}

.vip-modal {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    text-align: center;
}

.vip-modal h3 {
    font-size: 20px;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vip-modal p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.vip-qrcode {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    background: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 12px;
}

/* ========== 响应式适配 ========== */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding-top: 80px;
    }
    
    .header {
        height: 70px;
    }
    
    .tabbar {
        display: none;
    }
    
    .container {
        padding-bottom: 40px;
    }
}

/* MathJax 样式适配 */
mjx-container {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}