/**
 * SpeedLink 加速系统 - 登录/注册页面样式
 * 完美自适应手机+电脑端
 */

/* ========== 基础重置 ========== */
* {
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background: #f5f5f5;
    color: rgba(0, 0, 0, 0.64);
    font-size: 14px;
    line-height: 1.5;
}

/* ========== 主色调定义 ========== */
:root {
    --primary: #503f32;
    --primary-dark: #352a21;
    --accent: #debb69;
    --success: #19805c;
    --warning: #f0ad4e;
    --danger: #e76565;
    --bg-light: #fff;
    --bg-gray: #FAFAF9;
    --text-main: rgba(0, 0, 0, 0.64);
    --text-dark: #000;
    --border: rgba(0, 0, 0, 0.08);
}

/* ========== Header头部 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

/* ========== Main主体 ========== */
.main {
    width: 100%;
    min-height: calc(100vh - 56px);
    margin-top: 56px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ========== 登录/注册容器 ========== */
.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 32px 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ========== Logo区域 ========== */
.logo-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--accent);
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 13px;
    color: rgba(0,0,0,0.48);
}

/* ========== Tab切换 ========== */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--bg-gray);
    margin-bottom: 24px;
}

.tab-item {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: rgba(0,0,0,0.48);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-item.active {
    color: var(--success);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--success);
}

/* ========== 表单区域 ========== */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--success);
    border-width: 2px;
    background: var(--bg-light);
}

.form-input.error {
    border-color: var(--danger);
    border-width: 2px;
}

.form-input::placeholder {
    color: rgba(0,0,0,0.32);
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.form-error.show {
    display: block;
}

/* ========== 复选框 ========== */
.form-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--success);
}

.form-checkbox label {
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

/* ========== 按钮 ========== */
.btn-submit {
    width: 100%;
    height: 48px;
    background: var(--success);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.btn-submit:hover {
    background: #156a4a;
}

.btn-submit:disabled {
    background: rgba(0,0,0,0.24);
    cursor: not-allowed;
}

.btn-submit.loading {
    background: #1a7a5a;
}

/* ========== 提示信息 ========== */
.message-box {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.message-box.show {
    display: block;
}

.message-box.success {
    background: rgba(25,128,92,0.1);
    color: var(--success);
    border: 1px solid rgba(25,128,92,0.3);
}

.message-box.error {
    background: rgba(231,101,101,0.1);
    color: var(--danger);
    border: 1px solid rgba(231,101,101,0.3);
}

/* ========== 底部链接 ========== */
.footer-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 12px;
    color: rgba(0,0,0,0.48);
}

.footer-link {
    color: var(--success);
    cursor: pointer;
    font-weight: 600;
}

/* ========== 加载遮罩 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 响应式适配 ========== */
@media screen and (min-width: 1px) and (max-width: 639px) {
    /* 手机端 */
    .header-title {
        font-size: 16px;
    }
    
    .main {
        padding: 12px;
        justify-content: flex-start;
        padding-top: 24px;
    }
    
    .auth-container {
        padding: 24px 16px;
        border-radius: 8px;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .logo-title {
        font-size: 18px;
    }
    
    .form-input {
        height: 44px;
    }
    
    .btn-submit {
        height: 44px;
        font-size: 14px;
    }
}

@media screen and (min-width: 640px) {
    /* 平板及以上 */
    .main {
        padding: 24px;
    }
    
    .auth-container {
        padding: 40px 32px;
    }
}

@media screen and (min-width: 1024px) {
    /* 电脑端 */
    .auth-container {
        max-width: 480px;
        padding: 48px 40px;
    }
    
    .logo-icon {
        width: 80px;
        height: 80px;
    }
    
    .logo-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .logo-title {
        font-size: 22px;
    }
}