/*
 * 全站微信悬浮入口。
 * 右侧贴边圆形按钮 + 呼吸渐变光晕，点击展开后台配置的微信二维码。
 * 只在模板渲染出 .wx-float 时生效（后台未配二维码且不填微信号则整块不输出）。
 */

.wx-float,
.wx-float * {
    box-sizing: border-box;
}

.wx-float {
    --wx-green: #07c160;
    position: fixed;
    right: 22px;
    bottom: 116px;
    z-index: 9000;
}

/* ---------- 圆形呼吸按钮 ---------- */
.wx-float__btn {
    position: relative;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4fd18b 0%, var(--wx-green) 55%, #059b4c 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(7, 193, 96, .32);
    animation: wx-breathe 2.8s ease-in-out infinite;
    transition: transform .2s ease;
}
.wx-float__btn:hover,
.wx-float__btn:focus-visible {
    transform: scale(1.07);
    outline: none;
}

/* 扩散光晕：与按钮呼吸错开，形成持续的「呼吸渐变」 */
.wx-float__btn::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(7, 193, 96, .5);
    animation: wx-halo 2.8s ease-out infinite;
    pointer-events: none;
}
.wx-float__btn svg {
    width: 36px;
    height: 36px;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15));
}
/* 反白图标：气泡纯白、眼睛透出按钮绿底；写死 Fill 避免被全局 svg 样式染黑 */
.wx-float__btn svg path { fill: #fff; }
.wx-float__btn svg circle { fill: var(--wx-green); }

@keyframes wx-breathe {
    0%, 100% {
        box-shadow: 0 6px 18px rgba(7, 193, 96, .30), 0 0 0 0 rgba(7, 193, 96, .28);
    }
    50% {
        box-shadow: 0 9px 26px rgba(7, 193, 96, .48), 0 0 0 9px rgba(7, 193, 96, 0);
    }
}
@keyframes wx-halo {
    0%   { transform: scale(.94); opacity: .85; }
    70%  { transform: scale(1.38); opacity: 0; }
    100% { transform: scale(1.38); opacity: 0; }
}

/* ---------- 二维码卡片 ---------- */
.wx-float__panel {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: 224px;
    padding: 16px;
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(8, 11, 18, .18);
    text-align: center;
    opacity: 0;
    transform: translateY(10px) scale(.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.wx-float.is-open .wx-float__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 指向按钮的小尖角 */
.wx-float__panel::after {
    content: "";
    position: absolute;
    right: 21px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #ededed;
    border-bottom: 1px solid #ededed;
    transform: rotate(45deg);
}

.wx-float__qr {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    background: #f5f5f5;
}
.wx-float__title {
    margin: 12px 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}
.wx-float__desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #8a8a8a;
}
.wx-float__id {
    margin: 10px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--wx-green);
    word-break: break-all;
}
.wx-float__panel:not(:has(.wx-float__qr)) .wx-float__id {
    margin-top: 2px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
    .wx-float {
        right: 12px;
        bottom: 92px;
    }
    .wx-float__btn {
        width: 46px;
        height: 46px;
    }
    .wx-float__btn svg {
        width: 32px;
        height: 32px;
    }
    .wx-float__panel {
        width: 202px;
        bottom: 58px;
        padding: 13px;
    }
    .wx-float__panel::after {
        right: 18px;
    }
}

/* 无障碍：尊重系统减少动画设置 */
@media (prefers-reduced-motion: reduce) {
    .wx-float__btn,
    .wx-float__btn::before {
        animation: none;
    }
    .wx-float__panel {
        transition: none;
    }
}
