/* ==========================================================================
   前台语言切换（中文 | EN）
   电脑端：右下角固定小胶囊
   手机端：页面内容末尾居中内联
   ========================================================================== */

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    font-size: 12px;
    line-height: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lang-switch a {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    color: #6b7280;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.lang-switch a:hover {
    color: #2563eb;
    background: #eff6ff;
}

.lang-switch a.is-active {
    color: #fff;
    background: #2563eb;
}

.lang-switch .lang-switch-sep {
    width: 1px;
    height: 12px;
    background: #e5e7eb;
}

/* 电脑端：右下角固定 */
.lang-switch--fixed {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
}

/* 手机端：纯文本极简（自动 | 中文 | EN），无边框无底色 */
.lang-text-switch {
    display: block;
    margin: 18px auto 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lang-text-switch a {
    display: inline-block;
    padding: 4px 0;
    color: #9aa3b2;
    font-weight: 400;
    text-decoration: none;
}

.lang-text-switch a.is-active {
    color: #2563eb;
    font-weight: 600;
}

.lang-text-switch .lang-text-sep {
    display: inline-block;
    padding: 0 9px;
    color: #d5d9e2;
}

/* 深色主题（登录用户个性化） */
html[data-uc-theme="dark"] .lang-switch,
html[data-m-theme="dark"] .lang-switch {
    border-color: #374151;
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

html[data-uc-theme="dark"] .lang-switch a,
html[data-m-theme="dark"] .lang-switch a {
    color: #9ca3af;
}

html[data-uc-theme="dark"] .lang-switch a.is-active,
html[data-m-theme="dark"] .lang-switch a.is-active {
    color: #fff;
    background: #2563eb;
}

/* 纯文本切换的深色（含 iOS 6 按时间兜底的 data-m-auto） */
html[data-m-theme="dark"] .lang-text-switch a,
html[data-m-auto="dark"] .lang-text-switch a {
    color: #8b95a9;
}

html[data-m-theme="dark"] .lang-text-switch a.is-active,
html[data-m-auto="dark"] .lang-text-switch a.is-active {
    color: #9db9f6;
}

html[data-m-theme="dark"] .lang-text-switch .lang-text-sep,
html[data-m-auto="dark"] .lang-text-switch .lang-text-sep {
    color: #3a4256;
}

@media (max-width: 767px) {
    .lang-switch--fixed {
        right: 12px;
        bottom: 76px;
    }
}

@media print {
    .lang-switch {
        display: none !important;
    }
}
