/* ============================================================
   Floating Consult Button v2 · 2026-04-30
   微信咨询气泡 + 在线留言 — 永远可见，但不打扰
   ============================================================ */

/* 浮动按钮容器外观（覆盖原有样式） */
.site-floating-actions {
    position: fixed !important;
    right: 1.5rem !important;
    bottom: 2rem !important;
    display: flex !important;
    flex-direction: column;
    gap: 0.65rem !important;
    z-index: 998 !important;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .site-floating-actions {
        right: 1rem !important;
        bottom: 1.25rem !important;
    }
}

.site-float-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--brand-500, #1480e1) 0%, var(--brand-700, #0b519d) 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    box-shadow:
        0 8px 24px -8px rgba(20, 128, 225, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1));
    position: relative;
    overflow: visible;
}

.site-float-action::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1));
    z-index: -1;
}

.site-float-action:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 16px 32px -12px rgba(20, 128, 225, 0.7),
        0 0 0 1px rgba(96, 165, 250, 0.6) inset !important;
}

.site-float-action:hover::before { opacity: 1; }

.site-float-action svg { width: 22px; height: 22px; }

/* 微信按钮特别色 */
.site-float-wechat {
    background: linear-gradient(135deg, #07c160 0%, #1aad3e 100%) !important;
    border-color: rgba(70, 235, 137, 0.5) !important;
    box-shadow:
        0 8px 24px -8px rgba(7, 193, 96, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
    animation: floatWechatPulse 2.6s ease-in-out infinite;
}

@keyframes floatWechatPulse {
    0%, 100% { box-shadow: 0 8px 24px -8px rgba(7, 193, 96, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
    50%      { box-shadow: 0 12px 32px -8px rgba(7, 193, 96, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 0 0 8px rgba(7, 193, 96, 0.15); }
}

.site-float-wechat:hover {
    box-shadow:
        0 16px 32px -12px rgba(7, 193, 96, 0.85),
        0 0 0 1px rgba(70, 235, 137, 0.7) inset !important;
}

/* 微信浮窗包裹 */
.float-wechat-wrap {
    position: relative;
}

/* 弹层 */
.float-wechat-popover {
    position: absolute;
    bottom: 50%;
    right: calc(100% + 1.25rem);
    transform: translateY(50%) translateX(8px);
    width: 240px;
    padding: 1.25rem 1rem 1rem;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: var(--radius-xl, 24px);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 24px 48px -16px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(56, 189, 248, 0.1);
    text-align: center;
    color: #f1f5f9;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.35s var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1)),
        visibility 0.35s,
        transform 0.35s var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1));
    z-index: 999;
}

.float-wechat-wrap:hover .float-wechat-popover,
.float-wechat-wrap.is-open .float-wechat-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(50%) translateX(0);
}

.float-wechat-popover-arrow {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(15, 23, 42, 0.92);
    border-right: 1px solid rgba(96, 165, 250, 0.25);
    border-top: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 0 4px 0 0;
}

.float-wechat-popover-title {
    font-size: 0.875rem;
    font-weight: var(--font-semibold, 600);
    color: #e2e8f0;
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.float-wechat-popover-sub {
    font-size: 0.7rem;
    color: rgba(186, 230, 253, 0.75);
    margin-bottom: 0.85rem;
    letter-spacing: 0.04em;
}

.float-wechat-popover-qr {
    display: block;
    margin: 0 auto 0.65rem;
    width: 180px;
    height: 180px;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.float-wechat-popover-foot {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.85);
    letter-spacing: 0.04em;
}

/* 移动端：弹层向上展开（避免被屏幕右边切掉） */
@media (max-width: 768px) {
    .float-wechat-popover {
        right: 0;
        bottom: calc(100% + 0.75rem);
        transform: translateY(8px);
        width: 220px;
    }
    .float-wechat-wrap:hover .float-wechat-popover,
    .float-wechat-wrap.is-open .float-wechat-popover {
        transform: translateY(0);
    }
    .float-wechat-popover-arrow {
        right: 14px;
        top: auto;
        bottom: -8px;
        transform: rotate(135deg);
    }
    .float-wechat-popover-qr {
        width: 160px;
        height: 160px;
    }
}

/* 兼容暗色 hero 上的浮层显示 */
body.home-template .site-floating-actions {
    z-index: 998 !important;
}
