/* ========== 基础样式 ========== */
:root {
    --primary-color: #1a73e8;
    --dark-primary: #0d47a1;
    --text-color: #333;
    --light-gray: #f8f8f8;
    --border-color: #e0e0e0;
    --white: #fff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* ========== 导航栏 ========== */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    flex-wrap: nowrap;
}

.nav-links {
    display: flex;
    gap: 2rem;
    flex-grow: 1;
    justify-content: flex-start;
    min-width: 0;
    overflow-x: auto; /* 允许水平滚动而非换行 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: opacity 0.3s ease;
    white-space: nowrap; /* 防止链接文字换行 */
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* ========== 语言选择器 ========== */
.language-switcher {
    flex-shrink: 0;
    margin-left: 1rem;
}

#language-selector {
    /* 布局与尺寸 */
    padding: 8px 30px 8px 12px;
    min-width: 120px;
    height: 36px;
    
    /* 外观 */
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background-color: var(--light-gray);
    color: var(--text-color);
    font-size: 14px;
    
    /* 交互效果 */
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* 移除默认样式 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* 添加下拉箭头 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

#language-selector:hover {
    border-color: #b3b3b3;
    background-color: #f0f0f0;
}

#language-selector:focus {
    outline: none;
    border-color: #4d90fe;
    box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
}

#language-selector option {
    padding: 8px 12px;
    background-color: var(--white);
    color: var(--text-color);
}

/* ========== 主内容区域 ========== */
#content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: 60vh;
}

/* ========== 页脚 ========== */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-primary) 100%);
    color: var(--white);
    padding: 40px 0 20px;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页脚列布局 */
.footer-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 150px;
    margin-bottom: 25px;
    padding: 0 15px;
}

.footer-logo-column {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.footer-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--white);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: block;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-logo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

.footer-community {
    text-align: center;
    margin: 30px 0;
}

.footer-community h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.community-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.icon-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    object-fit: contain;
}

.icon-item span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
    margin-bottom: 5px;
}

.footer-records a {
    color: var(--white) !important;
    text-decoration: none;
    margin: 0 5px;
}

.footer-records a:hover {
    text-decoration: underline;
}

/* ========== 响应式设计 ========== */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        padding-bottom: 8px; /* 为滚动条留空间 */
    }
    
    #language-selector {
        min-width: 100px;
        padding: 6px 28px 6px 10px;
        font-size: 13px;
        height: 32px;
    }
    
    .footer-column {
        flex: 0 0 50%;
    }
    
    .footer-logo-column {
        flex: 0 0 100%;
        margin-top: 20px;
    }
}

@media screen and (max-width: 480px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        order: 3;
        flex: 0 0 100%;
        margin-top: 1rem;
    }
    
    .language-switcher {
        margin-left: auto;
    }
    
    .footer-column {
        flex: 0 0 100%;
    }
    
    .community-icons {
        gap: 15px;
    }
}

/* ========== 暗色模式 ========== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #f0f0f0;
    }
    
    .navbar {
        background-color: #1e1e1e;
    }
    
    #language-selector {
        background-color: #2d2d2d;
        color: #f0f0f0;
        border-color: #444;
    }
    
    #language-selector:hover {
        background-color: #3d3d3d;
        border-color: #666;
    }
    
    #language-selector option {
        background-color: #2d2d2d;
        color: #f0f0f0;
    }
}