/* Header 跳动修复 - 仅包含必要的覆盖 */
html { scrollbar-gutter: stable !important; }
#ucvpn-header, #ucvpn-header * { letter-spacing: 0px !important; }
/* ===== Language Switcher ===== */
.changeLanguage {
    position: relative;
    z-index: 1000;
}

.changebtn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
}

.changebtn:hover {
    background: rgba(255,255,255,0.08);
}

.changebtn img {
    width: 20px;
    height: 20px;
}

.changebtn .current-lang-name {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

.changebtn .arrow-icon {
    width: 10px;
    height: 10px;
    border-right: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.25s;
    margin-top: -2px;
}

.changeLanguage.open .changebtn .arrow-icon {
    transform: rotate(-135deg);
}

/* Dropdown */
.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    list-style: none;
    margin: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: langDropIn 0.2s ease-out;
}

@keyframes langDropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.changeLanguage.open .lang-menu {
    display: block;
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1px 0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: 0px !important;
    transition: all 0.15s;
    white-space: nowrap;
}

.lang-menu a:hover {
    background: #f5f5f4;
    color: #1e1d1d;
}

.lang-menu a.active {
    background: #f0f7ff;
    color: #1e1d1d;
    font-weight: 600;
}

.lang-menu a.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 13px;
    color: #4ade80;
}

.lang-menu .flag {
    font-size: 20px;
    line-height: 1;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.lang-menu .lang-name {
    flex: 1;
}

/* Scrollbar */
.lang-menu::-webkit-scrollbar {
    width: 4px;
}
.lang-menu::-webkit-scrollbar-track {
    background: transparent;
}
.lang-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

/* ===== Mobile Language Menu ===== */
.m-lang-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 16px;
    list-style: none;
    margin: 0;
}

.m-lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    width: calc(50% - 2px);
    box-sizing: border-box;
    transition: background 0.15s;
}

.m-lang-menu a:hover {
    background: #f5f5f4;
    color: #1e1d1d;
}

.m-lang-menu .flag {
    font-size: 18px;
}

/* Fix SVG flag sizing */
.changebtn .flag-img, .lang-item .flag-img, .m-lang-menu .flag-img {
    width: 24px !important;
    height: 17px !important;
    max-width: 24px !important;
    max-height: 17px !important;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}
.changebtn .flag-img {
    width: 22px !important;
    height: 16px !important;
    max-width: 22px !important;
    max-height: 16px !important;
}
