/* 标准语言选择器样式 */
.language-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 20px;
    font-family: PlusJakartaSans-Medium, '微软雅黑', sans-serif;
    height: 100%;
    vertical-align: middle;
}

.language-selector-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    color: rgb(102, 112, 133);
    font-size: 12px;
    font-weight: 500;
    position: relative;
}

.language-selector-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgb(254, 43, 71);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.language-selector-button:hover {
    background: rgba(102, 112, 133, 0.1);
    color: rgb(29, 41, 57);
}

.language-selector-button:hover::after {
    width: 100%;
}

.language-flag {
    width: 15.4px;
    height: 11px;
    border-radius: 1px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* 国旗样式 - 英国国旗 */
.flag-en {
    background: #012169;
    position: relative;
}

.flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* 简化版英国国旗：白色十字 */
        linear-gradient(to bottom, transparent 30%, #fff 30%, #fff 70%, transparent 70%),
        linear-gradient(to right, transparent 30%, #fff 30%, #fff 70%, transparent 70%);
}

.flag-en::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* 红色十字 */
        linear-gradient(to bottom, transparent 40%, #c8102e 40%, #c8102e 60%, transparent 60%),
        linear-gradient(to right, transparent 40%, #c8102e 40%, #c8102e 60%, transparent 60%);
}

.flag-zh {
    background: #de2910;
    position: relative;
}

.flag-zh::before {
    content: '★';
    position: absolute;
    top: 0.5px;
    left: 1px;
    color: #ffde00;
    font-size: 4px;
    line-height: 1;
}

.flag-nl {
    background: linear-gradient(to bottom, #ae1c28 0%, #ae1c28 33%, #fff 33%, #fff 66%, #21468b 66%);
}

/* 语言文字已移除，仅保留国旗 */

.dropdown-arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
}

.language-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e4e7ec;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
    min-width: 60px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(8px);
    margin-top: 2px;
}

.language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgb(71, 84, 103);
    font-size: 12px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254, 43, 71, 0.1), transparent);
    transition: left 0.5s ease;
}

.language-option:hover {
    background: #f8f9fa;
    color: rgb(29, 41, 57);
    transform: translateX(2px);
}

.language-option:hover::before {
    left: 100%;
}

.language-option.active {
    background: #f0f9ff;
    color: rgb(29, 41, 57);
    font-weight: 600;
}

.language-option .language-flag {
    width: 13.2px;
    height: 8.8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-selector {
        margin-left: 8px;
    }
    
    .language-selector-button {
        padding: 3px 6px;
        min-width: 36px; /* 保证触摸目标大小 */
        justify-content: center;
    }
    
    .language-dropdown {
        right: -2px;
        min-width: 50px;
        border-radius: 6px; /* 移动端圆润的边角 */
        margin-top: 1px;
    }
    
    .language-option {
        padding: 8px 10px; /* 触摸区域 */
        min-height: 36px;
    }
    
    .language-option .language-flag {
        width: 15.4px;
        height: 11px;
    }
}

/* 确保不影响现有动效 */
.language-selector * {
    box-sizing: border-box;
}

/* 与页面主题保持一致 */
@media (prefers-color-scheme: dark) {
    .language-dropdown {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .language-option {
        color: #b3b3b3;
    }
    
    .language-option:hover,
    .language-option.active {
        background: #2a2a2a;
        color: #fff;
    }
}
