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

body {
    font-family: 'Noto Sans SC', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
    font-size: 16px;
}

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

.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* 防止logo被压缩 */
}

.header-logo-img {
    height: auto;
    width: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
    max-width: calc(100% - 400px); /* 为logo和用户区域预留空间 */
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 8px;
    font-size: 15px;
    white-space: nowrap; /* 防止文字换行 */
    flex-shrink: 0; /* 防止菜单项被压缩 */
}

.nav-link:hover {
    color: #4285f4;
    background-color: #e8f0fe;
}

#loginModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0; /* 防止用户区域被压缩 */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-text {
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.welcome-text:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.welcome-text i {
    font-size: 12px;
    color: #4285f4;
}

.username {
    font-weight: 600;
    color: #2c3e50;
}

.login-btn, .logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    color: #24292f;
}

.login-btn:hover {
    background: #f6f8fa;
    border-color: #1f2328;
    color: #1f2328;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    background: #fff1f0;
    border-color: #ffcdd2;
    color: #d32f2f;
}

.logout-btn:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.login-btn:active, .logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.login-btn i, .logout-btn i {
    font-size: 12px;
}

.login-btn i {
    color: #4285f4;
}

.logout-btn i {
    color: #d32f2f;
}

.nav-link.active {
    color: #4285f4;
    font-weight: 600;
    border-bottom: 3px solid #4285f4;
    border-radius: 0;
    background-color: transparent;
}

.search-toggle {
    background: none;
    border: none;
    color: #555;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-toggle:hover {
    color: #4285f4;
    background-color: #e8f0fe;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: #666;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 30px 0;
    margin-top: 40px;
    border-top: 3px solid #4285f4;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4285f4 50%, transparent);
    opacity: 0.6;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.footer-content p {
    margin-bottom: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.footer-content p:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
}

.footer-content p:hover {
    color: rgba(255, 255, 255, 1);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: fadeInScale 0.3s ease-out forwards;
    border: 1px solid #e0e0e0;
    min-height: 350px; /* 增加最小高度使登录框更高 */
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #4285f4;
    margin: -35px -35px 25px -35px;
    padding: 25px 35px 20px 35px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e8f0fe;
}

.modal-content label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.login-type-tabs {
    position: relative;
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
}

.tab-item:hover {
    color: #4285f4;
}

.tab-item.active {
    color: #4285f4;
    font-weight: 600;
}

.tab-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%; /* 修改为100%，因为只有一个标签 */
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #357ae8);
    border-radius: 2px 2px 0 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.modal-content button[type="submit"] {
    width: 100%;
    background: #4285f4;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.modal-content button[type="submit"]:hover {
    background: #357ae8;
}

.modal-content button[type="submit"]:active {
    background: #2c5aa0;
}

/* 登录提交按钮样式 */
.login-submit-btn {
    width: 100%;
    background: #4285f4;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-submit-btn:hover {
    background: #357ae8;
}

.login-submit-btn:active {
    background: #2c5aa0;
}

/* 发送验证码按钮样式 */
.send-sms-btn {
    width: 100%;
    height: 40px;
    background: #f8f9fa;
    color: #4285f4;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: -8px; /* 调整位置使其与输入框对齐 */
    margin-bottom: 16px;
}

.send-sms-btn:hover {
    background: #e9ecef;
    border-color: #4285f4;
}

.send-sms-btn:active {
    background: #dee2e6;
}

.send-sms-btn:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

/* 验证码容器 */
.sms-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.sms-input-group {
    flex: 1;
    position: relative;
}

.sms-send-btn {
    width: 120px;
    height: 40px;
    background: #f8f9fa;
    color: #4285f4;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.sms-send-btn:hover {
    background: #e9ecef;
    border-color: #4285f4;
}

.sms-send-btn:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

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

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="tel"] {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 16px;
    transition: color 0.2s ease;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus,
.modal-content input[type="tel"]:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.modal-content input[type="text"]:focus + .input-icon,
.modal-content input[type="password"]:focus + .input-icon,
.modal-content input[type="tel"]:focus + .input-icon {
    color: #4285f4;
}

.login-message {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #e74c3c;
}

.login-message.success {
    color: #27ae60;
}

/* 底部提示文字 */
.login-footer-note {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #888;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 临时消息提示动画 */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#temporaryMessage {
    animation: fadeInScale 0.3s ease-out;
}

#temporaryMessage.fadeOut {
    animation: fadeOut 0.5s ease-out;
}

#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTopBtn.show {
    opacity: 1;
    transform: translateY(0);
}

#backToTopBtn:hover {
    background-color: #357ae8;
    transform: translateY(-2px);
}


/* 当屏幕宽度较小但还没到手机端时，进一步优化导航栏 */
@media (max-width: 1200px) {
    .nav {
        gap: 8px;
        max-width: calc(100% - 350px);
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .header .container {
        gap: 10px;
    }
}

@media (max-width: 992px) {
    .nav {
        gap: 6px;
        max-width: calc(100% - 300px);
    }
    
    .nav-link {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .welcome-text {
        font-size: 13px;
        padding: 5px 10px;
    }
}

@media (max-width: 768px) {
    .header-logo-img {
        max-height: 40px;
    }

    .nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav.show {
        display: flex;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        gap: 16px;
    }

    /* 手机端header布局 */
    .header .container {
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    /* 手机端用户信息样式 */
    .user-section {
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
        order: 2;
    }

    .user-info {
        flex-direction: row;
        gap: 8px;
        width: auto;
        align-items: center;
    }

    .welcome-text {
        display: none; /* 手机端隐藏欢迎文字，节省空间 */
    }

    .logo {
        order: 1;
        flex-shrink: 0;
    }

    .mobile-menu-toggle {
        order: 3;
    }

    .login-btn, .logout-btn {
        width: auto;
        justify-content: center;
        padding: 8px;
        font-size: 12px;
        border-radius: 6px;
        gap: 0;
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-btn i, .logout-btn i {
        font-size: 14px;
    }

    .login-btn span, .logout-btn span {
        display: none; /* 手机端只显示图标 */
    }

    /* 手机端按钮增强样式 */
    .login-btn {
        background: #4285f4;
        border-color: #4285f4;
        color: white;
    }

    .login-btn:hover {
        background: #357ae8;
        border-color: #357ae8;
    }

    .login-btn i {
        color: white;
    }

    .logout-btn {
        background: #dc3545;
        border-color: #dc3545;
        color: white;
    }

    .logout-btn:hover {
        background: #c82333;
        border-color: #c82333;
    }

    .logout-btn i {
        color: white;
    }



    .footer {
        padding: 20px 0;
        margin-top: 30px;
    }

    .footer-content p {
        font-size: 12px;
        line-height: 1.4;
    }



    .modal-content {
        padding: 30px 25px;
        margin: 20px;
        max-width: 90%;
        min-height: 300px; /* 手机端最小高度 */
    }

    .modal-content h2 {
        font-size: 22px;
        margin: -30px -25px 20px -25px;
        padding: 20px 25px 18px 25px;
    }

    .modal-content input[type="text"],
    .modal-content input[type="password"] {
        padding: 11px 14px 11px 36px;
        font-size: 16px;
    }

    .input-icon {
        left: 12px;
        font-size: 15px;
    }

    .modal-content button[type="submit"] {
        padding: 11px 18px;
        font-size: 15px;
    }

    .login-type-tabs {
        margin-bottom: 20px;
    }

    .tab-item {
        padding: 10px 16px;
        font-size: 14px;
    }

    .tab-indicator {
        height: 2px;
    }
    
    .captcha-code {
        width: 80px;
        height: 36px;
        font-size: 13px;
    }
    
    .captcha-group {
        gap: 8px;
    }
    
    /* 手机端发送验证码按钮 */
    .send-sms-btn {
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
        margin-top: -6px; /* 手机端调整位置 */
    }
    
    .sms-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .sms-send-btn {
        width: 100%;
        height: 36px;
    }
    
    #backToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    #backToTopBtn {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
