/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 头部导航 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

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

/* 添加到现有的 CSS 文件中 */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.site-logo {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

.logo span {
    font-weight: bold;
    font-size: 1.2rem;
}

.logo i {
    margin-right: 10px;
    color: #007bff;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #007bff;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-user {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
}

.customer-service {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    gap: 5px;
}

.customer-service i {
    color: #007bff;
}

/* 用户菜单 */
.user-menu {
    display: none;
    position: absolute;
    top: 100%; /* 从按钮底部开始 */
    right: 100%; /* 从右侧100%开始 */
    transform: translateX(100%); /* 向左移动自身100%以居中对齐 */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 120px;
    z-index: 1000;
}

.btn-user {
    position: relative; /* 确保按钮是相对定位 */
}

/* 确保父容器是相对定位 */
.auth-buttons {
    position: relative;
}

.user-menu.active {
    display: block;
}

.user-menu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
}

.user-menu a:hover {
    background-color: #f8f9fa;
}

/* 用户信息样式 */
.user-info {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #007bff;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.mobile-menu-links {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-menu-links a {
    text-decoration: none;
    color: #333;
    font-size: 1.1rem;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    width: auto;
    margin-right: 10px;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.switch-form {
    margin-top: 20px;
    text-align: center;
}

.switch-form a {
    color: #007bff;
    text-decoration: none;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #007bff;
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: #007bff;
}

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

/* 响应式设计 */
@media (max-width: 992px) {
    .nav-links {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .logo span {
        display: block; /* 确保logo文字在窄屏下显示 */
    }
    
    .customer-service {
        margin-right: 10px;
    }
}

/* 语言切换器样式 */
.lang-switcher {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 0.9rem;
    color: #333;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background-color: #007bff;
    color: #fff;
}

.lang-btn:hover:not(.active) {
    background-color: #f0f0f0;
}

/* 移动端语言切换器 */
.mobile-lang-switcher {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.mobile-lang-switcher span {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.mobile-lang-buttons {
    display: flex;
    gap: 10px;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 9999;
    transition: transform 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* 加载中样式 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 社交登录区域 */
.social-login {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.social-login p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.google-login-btn {
    background-color: #fff;
    color: #444;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 14px;
}

.google-login-btn:hover {
    background-color: #f8f8f8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-login-btn i {
    margin-right: 8px;
    color: #4285F4;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .google-login-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 用户头像 */
.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}