/* 全站通用语言切换器样式 */
.global-lang-switcher {
    position: fixed;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 位置设置 */
.global-lang-switcher[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

.global-lang-switcher[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

.global-lang-switcher[data-position="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

.global-lang-switcher[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

/* 下拉容器 */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

/* 下拉按钮 */
.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 120px;
    justify-content: space-between;
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.lang-dropdown-btn.active {
    background: rgba(255, 255, 255, 1);
    border-color: #007bff;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

/* 标志和文本 */
.lang-flag {
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.lang-name {
    flex: 1;
    text-align: left;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #666;
}

.lang-dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 200px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.lang-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 语言选项 */
.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(0, 123, 255, 0.05);
}

.lang-option.selected {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    font-weight: 600;
}

.lang-option .lang-flag {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lang-option .lang-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .global-lang-switcher[data-position="top-right"] {
        top: 15px;
        right: 15px;
    }
    
    .global-lang-switcher[data-position="top-left"] {
        top: 15px;
        left: 15px;
    }
    
    .lang-dropdown-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .lang-dropdown-menu {
        min-width: 180px;
        right: 0;
        left: auto;
    }
    
    .lang-option {
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .global-lang-switcher[data-position="top-right"] {
        top: 10px;
        right: 10px;
    }
    
    .lang-dropdown-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 90px;
    }
    
    .lang-name {
        display: none; /* 在小屏幕上只显示标志 */
    }
    
    .lang-dropdown-menu {
        min-width: 160px;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .lang-dropdown-btn {
        background: rgba(40, 40, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .lang-dropdown-btn:hover {
        background: rgba(60, 60, 60, 1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .lang-dropdown-menu {
        background: rgba(40, 40, 40, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .lang-option {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .lang-option:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .lang-option.selected {
        background: rgba(0, 123, 255, 0.2);
        color: #66b3ff;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .lang-dropdown-btn {
        border-width: 2px;
        border-color: #000;
    }
    
    .lang-dropdown-menu {
        border-width: 2px;
        border-color: #000;
    }
    
    .lang-option {
        border-color: #000;
    }
}

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

.lang-dropdown-menu.show {
    animation: fadeInScale 0.2s ease-out;
} 