/* 语言切换样式 */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.language-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.language-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.language-flag.current-flag {
    font-size: 20px;
    line-height: 1;
    display: block;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    min-width: 130px;
    z-index: 1000;
    margin-top: 5px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-switcher:hover .language-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 保持下拉菜单显示，直到鼠标离开整个容器 */
.language-switcher {
    padding: 2px;
}

.language-switcher:hover {
    position: relative;
}

.language-switcher:hover .language-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 确保下拉菜单在鼠标移动过程中保持显示 */
.language-dropdown {
    transition-delay: 0.2s;
}

.language-switcher:hover .language-dropdown {
    transition-delay: 0s;
}

.language-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.language-item:hover {
    background-color: #f5f5f5;
}

.language-item.active {
    background-color: #e8f4f8;
    cursor: default;
}

.language-flag {
    margin-right: 10px;
    font-size: 18px;
    line-height: 1;
}

.language-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.language-active {
    color: #4CAF50;
    font-size: 14px;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .language-dropdown {
        left: 0;
        right: auto;
        min-width: 120px;
    }
    
    .language-flag.current-flag {
        font-size: 18px;
    }
    
    .language-flag {
        font-size: 16px;
    }
}
