/* Element 全站侧边栏（AI客服 + 小程序）+ 二维码弹层
   新增选择器，不影响其他组件。 */

/* ---- 侧边栏本体：右侧竖向窄条 ---- */
.elem-side-bar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 4px;
}

.elem-side-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 48px;
    padding: 12px 0;
    border: none;
    cursor: pointer;
    border-radius: 12px 0 0 12px;
    background: var(--vi-green-deep, #111607);
    color: var(--vi-cream, #f7f8f3);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    box-shadow: -4px 0 14px rgba(0, 0, 0, 0.18);
    transition:
        background 180ms ease,
        transform 180ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.elem-side-bar__item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.elem-side-bar__item:hover,
.elem-side-bar__item:focus-visible {
    background: var(--vi-green-mid, #272b1d);
    transform: translateX(-2px);
}

/* 竖排文字（中文标签短，横排即可；加 writing-mode 可切换） */
.elem-side-bar__item--vertical .elem-side-bar__label {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
}

/* ---- 二维码弹层 ---- */
.elem-qr-popup {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 22, 7, 0.55);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 220ms ease,
        visibility 220ms ease;
}

.elem-qr-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.elem-qr-popup__card {
    position: relative;
    width: min(320px, calc(100vw - 48px));
    padding: 22px 22px 26px;
    border-radius: 16px;
    background: var(--vi-cream, #f7f8f3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
    font-family: var(--font-sans);
}

.elem-qr-popup__title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 650;
    color: var(--vi-green-deep, #111607);
}

.elem-qr-popup__img {
    display: block;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(17, 22, 7, 0.08);
}

.elem-qr-popup__hint {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(17, 22, 7, 0.62);
}

.elem-qr-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(17, 22, 7, 0.08);
    color: var(--vi-green-deep, #111607);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.elem-qr-popup__close:hover {
    background: rgba(17, 22, 7, 0.16);
}

/* ---- 移动端 ---- */
@media (max-width: 640px) {
    .elem-side-bar {
        gap: 8px;
        padding: 0 2px;
    }

    .elem-side-bar__item {
        width: 42px;
        padding: 10px 0;
        font-size: 11px;
        border-radius: 10px 0 0 10px;
    }

    .elem-side-bar__item svg {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .elem-qr-popup__img {
        width: 200px;
        height: 200px;
    }
}
