/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #4285f4;
    --secondary: #34a853;
    --accent: #fbbc05;
    --light: #f8f9fa;
    --dark: #202124;
    --gray: #5f6368;
    --light-gray: #dadce0;
    --border-color: #e8eaed;
}

body {
    color: var(--dark);
    line-height: 1.6;
    background-color: #fff;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 14px;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline:hover {
    background: rgba(26, 115, 232, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-buttons {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    margin-right: 15px;
    font-size: 14px;
    color: var(--gray);
}

#userName {
    margin-right: 10px;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

/* 页脚样式 */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        position: relative;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin: 20px 0;
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
        text-align: center;
    }

    .nav-buttons {
        display: none;
    }

    .nav-links.active+.nav-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    .nav-buttons .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* ==================== 登录/注册页面通用样式 ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.92) 0%, rgba(26, 115, 232, 0.15) 100%), url('../images/login_bg.jpg') center/cover no-repeat fixed;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
}

/* ==================== 登录/注册带有 Banner 样式 ==================== */
.login-box.with-banner {
    max-width: 900px;
    display: flex;
    padding: 0;
    overflow: hidden;
}

.login-banner {
    flex: 1;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.85) 0%, rgba(13, 71, 161, 0.95) 100%), url('../images/auth_banner.jpg') center/cover no-repeat;
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-banner h2 {
    font-size: 32px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.login-banner p {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.banner-features {
    list-style: none;
    position: relative;
    z-index: 1;
}

.banner-features li {
    margin-bottom: 15px;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.banner-features li i {
    margin-right: 10px;
    color: var(--accent);
    font-size: 18px;
}

.login-form-wrapper {
    flex: 0 0 450px;
    padding: 50px 40px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 850px) {
    .login-box.with-banner {
        flex-direction: column;
        max-width: 450px;
    }

    .login-banner {
        padding: 40px 30px;
        text-align: center;
    }

    .banner-features {
        display: none;
    }

    .login-form-wrapper {
        flex: auto;
        padding: 40px 30px;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray);
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group.error .form-control {
    border-color: #ef4444;
}

.form-group.error .error-message {
    display: block;
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
}

/* 验证码容器 */
.captcha-container {
    display: flex;
    gap: 10px;
}

.captcha-image {
    flex-shrink: 0;
    width: 100px;
    height: 40px;
    background: #f5f7fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.captcha-image:hover {
    border-color: var(--primary);
}

.captcha-image img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    color: var(--gray);
    font-size: 13px;
    cursor: pointer;
}

.checkbox-group label a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-group.error label {
    color: #ef4444;
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-submit:disabled {
    background: var(--light-gray);
    cursor: not-allowed;
    transform: none;
}

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

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 标签切换 */
.tab-buttons {
    display: flex;
    background: #f5f7fa;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

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

/* 返回链接 */
.back-link {
    text-align: center;
    margin-bottom: 10px;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    text-decoration: underline;
}


/* ==================== Toast 提示组件 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast.removing {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

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

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

.toast-icon.warning {
    background: #f59e0b;
    color: white;
}

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
}

.toast-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    flex-shrink: 0;
    font-size: 12px;
}

.toast-close:hover {
    color: #6b7280;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .captcha-container {
        flex-direction: column;
    }

    .captcha-image {
        width: 100%;
    }
}