/* ---- Floating Buttons & Scroll Animation ---- */

.xhp-floating-buttons {
    position: fixed;
    right: 24px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}
.xhp-floating-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s;
    position: relative;
    font-size: 0;
    outline: none;
}
.xhp-floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.20);
}
.xhp-floating-btn svg {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    fill: currentColor;
    stroke: none;
    display: block;
}
.xhp-floating-btn--email { color: #D14836; }
.xhp-floating-btn--whatsapp { color: #25D366; }
.xhp-floating-btn--wechat { color: #07C160; }
.xhp-floating-btn--top {
    color: #555;
    background: #f0f0f0;
}
.xhp-floating-btn--top:hover { background: #ddd; }
.xhp-floating-btn i {
    font-size: 28px;
    line-height: 1;
    width: auto;
    height: auto;
}
.xhp-floating-btn--top.xhp-hidden { display: none; }

.xhp-floating-btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.xhp-wechat-popup {
    position: absolute;
    right: calc(100% + 16px);
    bottom: 0;
    background: #ffffff;
    padding: 16px 16px 12px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    width: 160px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 99999;
    pointer-events: none;
}
.xhp-wechat-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.xhp-wechat-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 18px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #ffffff;
}
.xhp-wechat-popup__qr {
    width: 100%;
    height: auto;
    max-width: 140px;
    margin: 0 auto 8px;
    display: block;
    border-radius: 4px;
}
.xhp-wechat-popup__label {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin: 0 0 4px;
}
.xhp-wechat-popup__close {
    position: absolute;
    top: 4px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #bbb;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 4px;
}
.xhp-wechat-popup__close:hover { color: #333; }

.xhp-scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.xhp-scroll-animate.xhp-scroll-visible {
    opacity: 1;
    transform: translateY(0);
}
.xhp-scroll-animate--delay-1 { transition-delay: 0.05s; }
.xhp-scroll-animate--delay-2 { transition-delay: 0.10s; }
.xhp-scroll-animate--delay-3 { transition-delay: 0.15s; }
.xhp-scroll-animate--delay-4 { transition-delay: 0.20s; }

@media (max-width: 768px) {
    .xhp-floating-buttons {
        right: 12px;          /* 减小右侧间距，防止溢出 */
        bottom: 60px;
        gap: 10px;
    }
    .xhp-floating-btn {
        width: 44px;
        height: 44px;
    }
    .xhp-floating-btn svg {
        width: 24px;
        height: 24px;
    }
    .xhp-floating-btn i {
        font-size: 24px;
    }
    .xhp-wechat-popup {
        width: 140px;
        right: calc(100% + 10px);  /* 确保气泡不超出左侧 */
        padding: 12px;
    }
    .xhp-wechat-popup::after {
        right: -6px;
        border-left-width: 6px;
    }
    .xhp-wechat-popup__qr {
        max-width: 110px;
    }
}

@media (max-width: 480px) {
    .xhp-floating-buttons {
        right: 8px;
        bottom: 50px;
        gap: 8px;
    }
    .xhp-floating-btn {
        width: 38px;
        height: 38px;
    }
    .xhp-floating-btn svg {
        width: 20px;
        height: 20px;
    }
    .xhp-floating-btn i {
        font-size: 20px;
    }
    .xhp-wechat-popup {
        width: 120px;
        right: calc(100% + 8px);
        padding: 10px;
    }
    .xhp-wechat-popup__qr {
        max-width: 90px;
    }
}