/*! 中英切换器（下拉式，pixelDoc 全站注入）。
    <details> 原生展开 —— 无 JS 也能点开选语言；有 JS 时选项写 cookie + 剥 URL lang 参数再跳。
    站位：
      --pc    锚搜索 tab 容器右外侧（搜索图标右边，垂直中心对齐图标）；
      --m     移动头部右上角，与搜索图标同列（右缘对齐搜索条右边距）；
              ≤369px 时汉堡（固定 left:289px）右侧放不下 → 回退挂汉堡左侧；
      --float 右下角悬浮兜底，菜单向上展开防出屏。 */

.lang-switch {
    position: absolute;
    z-index: 5;
}
/* PC：容器（w=40px）右外侧 6px，垂直中心与搜索图标一致 */
.lang-switch--pc {
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
}
/* 移动：头部右上角，右缘与搜索条右边距（10px）对齐 */
.lang-switch--m {
    right: 10px;
    top: 18px;
}
@media (max-width: 369px) {
    /* 窄屏汉堡固定 left:289px，右侧放不下 → 挂汉堡左侧（触发器右缘=283px） */
    .lang-switch--m {
        right: calc(100% - 283px);
    }
}
/* 兜底悬浮（锚点缺失页） */
.lang-switch--float {
    position: fixed;
    right: 14px;
    bottom: 78px;
    z-index: 2147483000;
}

/* 触发器（折叠态药丸：当前语言 + 下箭头） */
.lang-switch__trigger {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 6px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #d9dee5;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
    font-size: 12px;
    line-height: 1;
    color: #55606e;
    cursor: pointer;
    list-style: none;
    transition: color .15s, border-color .15s;
}
.lang-switch__trigger::-webkit-details-marker { display: none; }
.lang-switch__marker,
.lang-switch__trigger::marker { content: ""; }
.lang-switch__trigger:hover { color: #1c66b0; border-color: #9fc3e0; }
/* 下箭头三角，展开时翻转朝上 */
.lang-switch__trigger::after {
    content: "";
    display: inline-block;
    margin-left: 3px;
    margin-top: 2px;
    border: 4px solid transparent;
    border-top-color: #8a94a3;
    transition: transform .15s;
}
.lang-switch[open] .lang-switch__trigger::after {
    transform: rotate(180deg);
}

/* 下拉菜单：右对齐触发器向左下展开（窄头部不溢出视口） */
.lang-switch__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 96px;
    padding: 4px;
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    z-index: 10;
    animation: lang-switch-in .14s ease-out;
}
@keyframes lang-switch-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
.lang-switch__menu a {
    display: block;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #3a4552;
    text-decoration: none;
    white-space: nowrap;
}
.lang-switch__menu a:hover { background: #eef4fb; color: #1c66b0; }
.lang-switch__menu a.is-active { color: #1c66b0; font-weight: 600; }

/* 悬浮兜底：菜单向上开，避免出屏 */
.lang-switch--float .lang-switch__menu {
    top: auto;
    bottom: calc(100% + 6px);
}
