/**
 * 多语言切换器公共样式
 * 万船实业官网 i18n
 */

/* ==================== 语言切换器 ==================== */
.lang-switcher {
    position: relative;
    margin-left: 10px;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lang-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

.lang-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.lang-trigger .globe-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.lang-trigger .current-lang {
    font-weight: 500;
}

.lang-trigger .arrow-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.lang-switcher.open .arrow-icon {
    transform: rotate(180deg);
}

/* 语言下拉菜单 - 默认隐藏 */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    z-index: 1001;
    /* 强制垂直布局 */
    display: block !important;
    flex-direction: unset !important;
    gap: unset !important;
}

/* 显示语言下拉菜单 */
.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉菜单三角箭头 */
.lang-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.lang-dropdown li {
    margin: 0;
    padding: 0;
    list-style: none;
    display: block;
    width: 100%;
}

.lang-dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.lang-dropdown a:hover {
    background: #f5f5f5;
    color: #333;
}

.lang-dropdown a.active {
    background: #f0f7ff;
    color: #4f46e5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 5px;
    }

    .lang-trigger {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .lang-trigger .current-lang {
        display: none;
    }

    .lang-dropdown {
        right: 0;
        min-width: 120px;
    }
}
