/* ============================================================
   顶栏：社媒图标 + 简洁语言下拉
   下拉面板固定定位、挂在 body，展开位置不受页面滚动影响。
   ============================================================ */

/* ---------- 顶栏社媒图标 ---------- */
.pf-top-social {
    gap: 5px;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, .14);
}

.pf-top-social a {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    /* 顶栏为深蓝底，图标必须固定为白色，避免被模板链接色覆盖成同色 */
    color: #fff !important;
    font-size: 11px;
    line-height: 1;
    text-decoration: none;
    opacity: .88;
    transition: background .15s ease, opacity .15s ease;
}

.pf-top-social a i,
.pf-top-social a .fa-brands {
    color: #fff !important;
}

.pf-top-social a:hover,
.pf-top-social a:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
    opacity: 1;
    outline: none;
}

/* ---------- 顶栏语言入口 ---------- */
.pf-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: .01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: .92;
    transition: opacity .15s ease;
}

.pf-lang-btn:hover,
.pf-lang-btn:focus-visible {
    opacity: 1;
    outline: none;
}

.pf-lang-btn:focus-visible .pf-lang-btn-label,
.pf-lang-btn:focus-visible .pf-lang-btn-code {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pf-lang-globe {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: #fff;
    stroke: #fff;
    opacity: .9;
}

.pf-lang-btn-code {
    display: none;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .1em;
}

.pf-lang-btn-label {
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-lang-btn-caret {
    width: 5px;
    height: 5px;
    margin-top: -3px;
    margin-left: 2px;
    border-right: 1.3px solid rgba(255, 255, 255, .7);
    border-bottom: 1.3px solid rgba(255, 255, 255, .7);
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.pf-lang-btn[aria-expanded="true"] .pf-lang-btn-caret {
    margin-top: 1px;
    transform: rotate(225deg);
}

/* ---------- 点击外部关闭用的透明层（不压暗页面） ---------- */
.pf-lang-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: transparent;
    opacity: 0;
    transition: opacity .12s ease;
}

.pf-lang-backdrop.is-open {
    opacity: 1;
}

/* ---------- 语言下拉 ---------- */
.pf-lang-panel {
    position: fixed;
    z-index: 100000;
    top: 50px;
    right: max(10px, calc((100vw - 1320px) / 2 + 8px));
    width: 208px;
    padding: 5px;
    background: #fff;
    border: 1px solid #e7e9ef;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(17, 19, 45, .16), 0 2px 6px rgba(17, 19, 45, .04);
    opacity: 0;
    pointer-events: none;
    transition: opacity .13s ease;
}

.pf-lang-panel.is-open {
    opacity: 1;
    pointer-events: auto;
}

.pf-lang-grid {
    display: block;
}

.pf-lang-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 28px 0 7px;
    border-radius: 7px;
    color: #14133b;
    text-decoration: none;
    transition: background .13s ease;
}

.pf-lang-item:hover {
    background: #f5f7f6;
}

.pf-lang-item:focus-visible {
    outline: 2px solid rgba(0, 141, 0, .45);
    outline-offset: -1px;
}

.pf-lang-badge {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #f1f3f7;
    color: #6b7184;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
}

.pf-lang-item.is-active .pf-lang-badge {
    background: #008d00;
    color: #fff;
}

.pf-lang-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-lang-item.is-active {
    background: #f2f8f2;
}

.pf-lang-item.is-active .pf-lang-name {
    color: #006f00;
}

.pf-lang-item.is-active::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: #008d00;
}

.pf-lang-item.is-active > .pf-lang-check {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 5.5px;
    height: 3px;
    margin-top: -3px;
    border-left: 1.4px solid #fff;
    border-bottom: 1.4px solid #fff;
    transform: rotate(-45deg);
    z-index: 1;
}

/* ---------- 移动端 ---------- */
@media (max-width: 991.98px) {
    .pf-top-contact {
        width: auto !important;
        justify-content: flex-end !important;
        gap: 0;
        flex: 0 0 auto;
    }

    .pf-top-info {
        flex: 1 1 auto;
        min-width: 0;
    }

    .pf-top-social {
        gap: 3px;
        margin-right: 7px;
        padding-right: 7px;
    }

    .pf-top-social a {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .pf-top-info .part p {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .pf-lang-btn {
        height: 26px;
        margin-left: 0;
    }

    .pf-lang-btn-label {
        display: none;
    }

    .pf-lang-btn-code {
        display: inline-block;
    }

    .pf-lang-panel {
        top: 51px;
        right: 8px;
        left: auto;
        width: 200px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        border-radius: 9px;
    }
}

@media (max-width: 359.98px) {
    .pf-top-social a:nth-child(n+3) {
        display: none;
    }

    .pf-lang-name {
        font-size: 12.5px;
    }
}
