/* :root {
    font-size: var(--base-font-size, 16px);
} */

.contact-floating {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 9999;        /* 确保浮动窗显示在最上层 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.whatsapp-floating-btn {
    display: block;
    width: 76px;
    height: 76px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    line-height: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.whatsapp-floating-btn:focus,
.whatsapp-floating-btn:active,
.whatsapp-send-btn:focus,
.whatsapp-send-btn:active,
.whatsapp-qr-close:focus,
.whatsapp-qr-close:active {
    outline: none;
}

.contact-floating img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.55);
}

.whatsapp-qr-popup {
    position: fixed;
    right: 30px;
    bottom: 116px;
    z-index: 10000;
    display: none;
    width: 470px;
    overflow: hidden;
    background: #f7fff9;
    border-radius: 26px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.whatsapp-qr-popup.is-visible {
    display: block;
}

.whatsapp-chat-header {
    min-height: 82px;
    padding: 22px 28px 16px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: #25d366;
    color: #fff;
}

.whatsapp-chat-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.whatsapp-chat-logo {
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    background: #25d366;
    flex: 0 0 auto;
}

.whatsapp-chat-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.55);
}

.whatsapp-qr-close {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #11843f;
    color: #fff;
    cursor: pointer;
    font-size: 36px;
    font-weight: 300;
    line-height: 42px;
}

.whatsapp-chat-body {
    min-height: 192px;
    padding: 28px 32px 24px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f4fff8 0%, #fbfffc 100%);
}

.whatsapp-chat-message {
    position: relative;
    max-width: 360px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
    color: #444;
    font-size: 20px;
    line-height: 1.3;
}

.whatsapp-chat-message:before {
    content: "";
    position: absolute;
    left: -18px;
    top: 34px;
    width: 32px;
    height: 16px;
    background: #fff;
    border-radius: 0 0 0 24px;
    box-shadow: -3px 4px 8px rgba(0, 0, 0, 0.1);
}

.whatsapp-send-wrap {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.whatsapp-send-qr {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 156px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.96);
    transform-origin: right bottom;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.whatsapp-send-wrap:hover .whatsapp-send-qr,
.whatsapp-send-wrap:focus-within .whatsapp-send-qr {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: whatsappQrPop 220ms ease-out;
}

.whatsapp-send-qr:after {
    content: "";
    position: absolute;
    right: 30px;
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.whatsapp-send-qr img {
    width: 100%;
    height: auto;
    display: block;
}

.whatsapp-send-btn {
    min-width: 138px;
    min-height: 54px;
    padding: 0 32px;
    border: 0;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.18);
}

@keyframes whatsappQrPop {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.94);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* 响应式设计：在小屏设备上调整浮动窗的位置和样�?*/
@media (max-width: 48rem) {
    .contact-floating {
        right: 18px;
        bottom: 18px;
    }

    .whatsapp-floating-btn {
        width: 64px;
        height: 64px;
    }

    .contact-floating .chinese span {
        font-size: 0.875rem;
    }

    .whatsapp-qr-popup {
        left: 16px;
        right: 16px;
        bottom: 92px;
        width: auto;
    }

    .whatsapp-chat-header {
        min-height: 96px;
        padding: 28px 28px 18px;
    }

    .whatsapp-chat-body {
        padding: 34px 28px 24px;
    }

    .whatsapp-chat-brand {
        font-size: 24px;
    }

    .whatsapp-qr-close {
        width: 48px;
        height: 48px;
        font-size: 36px;
        line-height: 44px;
    }

    .whatsapp-chat-message {
        max-width: none;
        font-size: 18px;
    }

    .whatsapp-send-btn {
        min-width: 130px;
        min-height: 56px;
        font-size: 20px;
    }
}


