/* 语言切换器样式 - 完全复制新利项目 */

/* 语言选择器样式 - 完全复制新利项目 */
.language-selector {
    position: relative !important;
}



.language-button {
    background-color: transparent;
    color: #374151;
    border: none;
    padding: 4px 8px;
    border-radius: 0;
    font-family: 'museo', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.3s ease;
}

.language-button:hover {
    opacity: 0.7;
}

.dropdown-arrow {
    margin-left: 6px;
    color: #6b7280;
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.language-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* 语言弹框 */
.language-popup {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    z-index: 9999 !important;
    width: 480px !important;
    max-width: 95vw !important;
    margin-top: 5px !important;
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.language-popup.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.language-popup.active {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.language-items {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.lang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    color: #374151;
    text-decoration: none;
    font-family: 'museo', sans-serif;
    font-size: 12px;
    font-weight: 400;
    transition: background-color 0.2sease;
    gap: 6px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    min-height: 60px;
    word-break: break-word;
}

.lang-item:hover {
    background-color: #f3f4f6;
    color: #1e3a8a;
}

.lang-item img {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-popup {
        width: 320px;
        right: -20px;
    }
    
    .language-items {
        grid-template-columns: repeat(3, 1fr);
        padding: 12px;
    }
    
    .lang-item {
        padding: 8px 4px;
        min-height: 50px;
        font-size: 11px;
    }
    
    .lang-item img {
        width: 14px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .language-popup {
        width: 280px;
        right: -10px;
    }
    
    .language-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

.lang-item[data-lang="English"] img {
    background: linear-gradient(to bottom, #b22234 0%, #b22234 7.7%, #ffffff 7.7%, #ffffff 15.4%, #b22234 15.4%);
}

.lang-item[data-lang="中文"] img {
    background: #de2910;
    position: relative;
}

.lang-item[data-lang="中文"] img:after {
    content: "⭐";
    position: absolute;
    top: 2px;
    left: 2px;
    color: #ffde00;
    font-size: 8px;
}

.lang-item[data-lang="Español"] img {
    background: linear-gradient(to bottom, #aa151b 0%, #aa151b 33.33%, #f1bf00 33.33%, #f1bf00 66.66%, #aa151b 66.66%);
}

.lang-item[data-lang="Français"] img {
    background: linear-gradient(to right, #0055a4 0%, #0055a4 33.33%, #ffffff 33.33%, #ffffff 66.66%, #ef4135 66.66%);
}

.lang-item[data-lang="Deutsch"] img {
    background: linear-gradient(to bottom, #000000 0%, #000000 33.33%, #dd0000 33.33%, #dd0000 66.66%, #ffce00 66.66%);
}

.lang-item[data-lang="日本語"] img {
    background: #ffffff;
    position: relative;
}

.lang-item[data-lang="日本語"] img:after {
    content: "🔴";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
}

.lang-item[data-lang="한국어"] img {
    background: #ffffff;
    position: relative;
}

.lang-item[data-lang="한국어"] img:after {
    content: "☯";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #003478;
}

.lang-item[data-lang="العربية"] img {
    background: linear-gradient(to bottom, #000000 0%, #000000 33.33%, #ffffff 33.33%, #ffffff 66.66%, #007a3d 66.66%);
}

.lang-item[data-lang="Русский"] img {
    background: linear-gradient(to bottom, #ffffff 0%, #ffffff 33.33%, #0039a6 33.33%, #0039a6 66.66%, #d52b1e 66.66%);
}

.lang-item[data-lang="Português"] img {
    background: linear-gradient(to right, #046a38 0%, #046a38 30%, #ffffff 30%, #ffffff 70%, #da020e 70%);
    position: relative;
}

.lang-item[data-lang="Português"] img:after {
    content: "⚪";
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    font-size: 6px;
    color: #ffff00;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 10px;
    }
    
    .language-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .language-popup {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 300px;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 10000;
    }
    
    .language-popup::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    .lang-item {
        padding: 12px 15px;
        font-size: 16px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .language-popup {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .lang-item {
        color: #fff;
    }
    
    .lang-item:hover {
        background-color: #444;
        color: #fff;
    }
}

/* 高对比度模式适配 */
@media (prefers-contrast: high) {
    .language-button {
        border-width: 2px;
    }
    
    .language-popup {
        border-width: 2px;
    }
    
    .lang-item:hover {
        background-color: #000;
        color: #fff;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-popup[style*="block"] {
    animation: fadeInUp 0.3s ease;
}

/* 滚动条样式 */
.language-popup::-webkit-scrollbar {
    width: 6px;
}

.language-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.language-popup::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.language-popup::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 焦点状态 */
.language-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.lang-item:focus {
    background-color: #007bff;
    color: #fff;
    outline: none;
}

/* 活跃状态 */
.lang-item.active {
    background-color: #007bff;
    color: #fff;
}

.lang-item.active:hover {
    background-color: #0056b3;
}
