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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 0 40px;
}

/* 页面页眉（容器顶部位置紧接其下，不随整页居中下移） */
.page-header {
    width: 100%;
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 20px 0;
    flex-shrink: 0;
}

.header-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 18px;
    color: white;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* 功能特点 */
.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: white;
    opacity: 0.9;
}

.feature-icon {
    font-size: 20px;
}

.feature-text {
    font-weight: 400;
}

/* 登录/注册白色容器：顶部位置固定，紧接页眉下方 */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    max-width: 500px;
    margin: 0 auto 30px;
    margin-top: 0;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border-radius: 20px;
    background-color: white;
    flex-shrink: 0;
}

/* 页面页脚 */
.page-footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.footer-content {
    color: white;
    font-size: 14px;
}

.footer-content a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    opacity: 0.8;
}

.footer-content a:hover {
    color: #a78bfa;
    opacity: 1;
}

/* 表单区域 */
.auth-right {
    width: 100%;
    max-width: 400px;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 30px 35px;
    margin: 0 auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
}

.tabs {
    display: flex;
    margin-bottom: 35px;
    gap: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    margin-bottom: 35px;
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.input-wrapper {
    position: relative;
}

input {
    width: 100%;
    padding: 14px 16px 14px 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
    transition: color 0.3s ease;
}

input:focus + .input-icon {
    color: #667eea;
}

.error-message {
    display: block;
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    margin-left: 8px;
}

.code-input-group {
    margin-bottom: 25px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
}

.btn:disabled {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled::before {
    display: none;
}

/* Toast通知样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.toast.success {
    background-color: #10b981;
    color: white;
}

.toast.error {
    background-color: #ef4444;
    color: white;
}

.toast.info {
    background-color: #3b82f6;
    color: white;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* 响应式设计 */
@media (max-width: 968px) {
    .page-header {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 36px;
    }
    
    .header-content p {
        font-size: 16px;
    }
    
    .container {
        flex-direction: column;
        height: 80vh;
        min-height: 550px;
        border-radius: 0;
        margin: 0 0 20px;
        max-width: 100%;
    }
    
    .auth-left {
        padding: 30px 20px;
        min-height: 30vh;
    }
    
    .logo {
        margin-bottom: 30px;
    }
    
    .logo h1 {
        font-size: 32px;
    }
    
    .features {
        flex-direction: row;
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        animation: slideInUp 0.8s ease-in-out;
        font-size: 14px;
    }
    
    @keyframes slideInUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 0.95; transform: translateY(0); }
    }
    
    .auth-right {
        padding: 15px 20px;
    }
    
    .auth-header {
        padding: 15px 0;
    }
    
    .auth-header h1 {
        font-size: 28px;
    }
    
    .auth-box {
        padding: 25px 20px;
        min-height: 350px;
    }
    
    .auth-footer {
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .page-header {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    .header-content h1 {
        font-size: 28px;
    }
    
    .header-content p {
        font-size: 14px;
    }
    
    .page-footer {
        padding: 15px 10px;
    }
    
    .footer-content {
        font-size: 12px;
    }
    
    .container {
        height: 85vh;
        min-height: 500px;
    }
    
    .auth-left {
        padding: 20px 15px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .logo p {
        font-size: 14px;
    }
    
    .features {
        gap: 15px;
    }
    
    .feature-item {
        font-size: 12px;
    }
    
    .auth-right {
        padding: 10px 15px;
    }
    
    .auth-header {
        padding: 10px 0;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-box {
        padding: 20px 15px;
        min-height: 300px;
    }
    
    .auth-footer {
        padding: 10px 0;
        font-size: 11px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    input {
        padding: 12px 14px 12px 45px;
        font-size: 14px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}