/* 语言切换器样式 */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-flag {
    font-size: 16px;
}

.language-name {
    white-space: nowrap;
}

.language-code {
    font-weight: 600;
    font-size: 13px;
    min-width: 25px;
}

.language-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-switcher.active .language-btn i {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-switcher.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
    font-size: 14px;
}

.language-option:hover {
    background-color: #f5f5f5;
}

.language-option.active {
    background-color: #e8f4fd;
    color: #0055a4;
    font-weight: 600;
}

.language-option .language-flag {
    font-size: 16px;
}

/* 导航栏中的语言切换器 */
.nav-links .language-switcher {
    margin-left: 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .language-btn {
        width: 100%;
        justify-content: center;
    }
    
    .language-dropdown {
        position: static;
        width: 100%;
        margin-top: 5px;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    
    .language-switcher.active .language-dropdown {
        display: block;
    }
}

/* 顶部信息栏中的语言切换器 */
.top-bar .language-switcher {
    margin-left: 10px;
}

.top-bar .language-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 10px;
    font-size: 13px;
}

.top-bar .language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .language-dropdown {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .language-option {
        color: #e2e8f0;
    }
    
    .language-option:hover {
        background-color: #4a5568;
    }
    
    .language-option.active {
        background-color: #2c5282;
        color: #90cdf4;
    }
}

/* 图标式语言切换器 */
.language-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.language-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.language-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.language-icon-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-icons {
        margin-left: 10px;
        gap: 6px;
    }
    
    .language-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}
