.nav #languageToggle.language-flipswitch {
    position: relative;
    display: block;
    flex: 0 0 86px;
    width: 86px;
    height: 32px;
    margin: 0;
    padding: 0;
}

.nav #languageToggle::before,
.nav #languageToggle::after {
    content: none !important;
}

.language-flipswitch__checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.language-flipswitch__label {
    position: relative;
    display: block;
    width: 100%;
    height: 32px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(91, 126, 166, 0.58);
    border-radius: 8px;
    background: #e7edf3;
    box-shadow: inset 0 0 8px rgba(8, 22, 39, 0.2), 0 7px 18px rgba(0, 18, 42, 0.2);
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.language-flipswitch__inner {
    position: relative;
    display: flex;
    width: 200%;
    height: 100%;
    margin-left: 0;
    transition: margin-left 300ms ease-in;
}

.language-flipswitch__side {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    width: 50%;
    height: 30px;
    box-sizing: border-box;
    font-family: "Trebuchet MS", Arial, "Microsoft YaHei", sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 30px;
}

.language-flipswitch__side--zh {
    justify-content: flex-start;
    padding-left: 10px;
    background: linear-gradient(135deg, #168cf5, #176ab5);
    color: #fff;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
}

.language-flipswitch__side--en {
    justify-content: flex-end;
    padding-right: 12px;
    background: #e7edf3;
    color: #52677c;
}

.language-flipswitch__switch {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 31px;
    margin: -2px;
    border: 1px solid rgba(95, 119, 144, 0.72);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(6, 24, 43, 0.28);
    transition: right 300ms ease-in, background-color 300ms ease;
}

.language-flipswitch__checkbox:checked + .language-flipswitch__label .language-flipswitch__inner {
    margin-left: -100%;
}

.language-flipswitch__checkbox:checked + .language-flipswitch__label .language-flipswitch__switch {
    right: 55px;
}

.language-flipswitch__checkbox:focus-visible + .language-flipswitch__label,
.language-flipswitch__label:hover {
    border-color: rgba(53, 230, 208, 0.9);
    box-shadow: 0 0 0 3px rgba(22, 140, 245, 0.16), 0 0 16px rgba(53, 230, 208, 0.2);
}

:root[data-theme="dark"] .language-flipswitch__label {
    border-color: rgba(104, 135, 190, 0.42);
    background: #182233;
}

:root[data-theme="dark"] .language-flipswitch__side--zh {
    background: linear-gradient(135deg, #168cf5, #0f5d9f);
}

:root[data-theme="dark"] .language-flipswitch__side--en {
    background: #182233;
    color: #d8e8fb;
}

:root[data-theme="dark"] .language-flipswitch__switch {
    border-color: rgba(86, 124, 164, 0.75);
    background: #f6fbff;
}

@media (max-width: 900px) {
    .nav #languageToggle.language-flipswitch {
        flex: 0 0 auto;
        width: 86px !important;
        min-width: 86px !important;
        height: 32px !important;
        min-height: 32px !important;
        margin: 0.35rem auto;
        padding: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-flipswitch__label,
    .language-flipswitch__inner,
    .language-flipswitch__switch {
        transition: none;
    }
}
