/* ===========================================
           WhatsApp浮动组件 - 核心代码开始
           =========================================== */
        
        /* 主容器 - 控制组件在页面中的位置 */
        .whatsapp-container {
            position: fixed;
            bottom: 120px;    /* 调整这个值来改变距离底部的间距 */
            right: 40px;     /* 调整这个值来改变距离右侧的间距 */
            z-index: 999999; /* 确保始终在最上层显示 */
        }

        /* 聊天弹窗容器 */
        .chat-popup {
            position: absolute;
            bottom: 80px;    /* 相对于按钮上方的距离 */
            right: 0;
            width: 280px;    /* 弹窗宽度 */
            background: white;
            border-radius: 12px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.3);
            /* 初始状态：隐藏 */
            opacity: 0;
            visibility: hidden;
            transform: translateY(30px);
            /* 动画过渡效果 */
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            z-index: 1000000;
            overflow: hidden;
        }

        /* 弹窗激活状态 - 显示时的样式 */
        .chat-popup.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        /* 聊天窗口头部 - 包含头像和用户信息 */
        .chat-header {
            background: #128C7E;  /* WhatsApp深绿色 */
            color: white;
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            /* 优化字体渲染，防止动画时模糊 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        /* 头像容器 - 包含头像和在线状态指示器 */
        .chat-avatar-container {
            position: relative;
            flex-shrink: 0;
        }

        /* 用户头像 */
        .chat-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;  /* 确保图片被裁剪为圆形 */
        }

        .chat-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;  /* 保持图片比例并填满容器 */
        }

        /* 在线状态指示器 - 小绿点 */
        .online-indicator {
            position: absolute;
            bottom: 0px;     /* 相对于头像容器的位置 */
            right: 0px;
            width: 12px;     /* 绿点大小 */
            height: 12px;
            background: #25D366;  /* WhatsApp绿色 */
            border: 2px solid white;  /* 白色边框 */
            border-radius: 50%;
            z-index: 10;
        }

        /* 用户信息区域 */
        .chat-header-info h3 {
            font-size: 16px;
            font-weight: 600;
            margin: 0 0 2px 0;
            /* 防止动画时文字模糊 */
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            will-change: auto;
        }

        .chat-header-info .status {
            font-size: 13px;
            opacity: 0.9;     /* 稍微透明，显示次要信息 */
            margin: 0;
            /* 防止动画时文字模糊 */
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            will-change: auto;
        }

        /* 聊天内容区域 */
        .chat-body {
            /* WhatsApp聊天背景图片 */
            background-image: url('../images/background-whatsapp.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            padding: 16px;
            min-height: 120px;
            position: relative;
        }

        /* 时间显示 */
        .chat-time {
            text-align: center;
            font-size: 12px;
            color: #999;
            margin-bottom: 12px;
        }

        /* 消息气泡 */
        .message-bubble {
            background: white;
            border-radius: 12px;
            padding: 12px 16px;
            margin-bottom: 16px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
            position: relative;
            max-width: 85%;
            /* 初始状态：隐藏，用于动画效果 */
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.3s ease;
        }

        /* 消息气泡显示状态 */
        .message-bubble.show {
            opacity: 1;
            transform: translateY(0);
        }

        /* 消息文本 */
        .message-text {
            font-size: 14px;
            line-height: 1.4;
            color: #333;
            margin: 0 0 8px 0;
        }

        /* 表情符号 */
        .message-emoji {
            font-size: 16px;
        }

        /* WhatsApp聊天按钮 */
        .chat-button {
            background: #25D366;  /* WhatsApp绿色 */
            color: white;
            border: none;
            border-radius: 25px;  /* 圆角按钮 */
            padding: 12px 24px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: background 0.2s;
            text-decoration: none;
            display: inline-block;
            text-align: center;
        }

        /* 按钮悬停效果 */
        .chat-button:hover {
            background: #1DA851;  /* 更深的绿色 */
            color: white;
            text-decoration: none;
        }

        /* 帮助提示气泡 */
        .help-bubble {
            position: absolute;
            bottom: 70px;    /* 相对于按钮上方的位置 */
            right: 10px;
            background: white;
            border: 2px dashed #25D366;  /* 绿色虚线边框 */
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 12px;
            color: #333;
            white-space: nowrap;  /* 防止文字换行 */
            opacity: 1;
            visibility: visible;
            transition: all 0.3s ease;
            animation: pulse 2s infinite;  /* 脉动动画 */
            z-index: 999998;
        }

        /* 气泡隐藏状态 */
        .help-bubble.hidden {
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
        }

        /* 气泡小箭头 */
        .help-bubble::after {
            content: '';
            position: absolute;
            bottom: -8px;
            right: 20px;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid #25D366;
        }

        /* 脉动动画 */
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        /* WhatsApp主按钮 */
        .whatsapp-btn {
            width: 60px;      /* 按钮大小 */
            height: 60px;
            background: #25D366;  /* WhatsApp绿色 */
            border-radius: 50%;   /* 圆形按钮 */
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);  /* 绿色阴影 */
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: none;
            position: relative;
            overflow: hidden;
            z-index: 999999;
        }

        /* 按钮悬停效果 */
        .whatsapp-btn:hover {
            transform: scale(1.1);  /* 放大效果 */
            box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
        }

        /* 按钮激活状态（显示X图标时）保持绿色 */
        .whatsapp-btn.active {
            background: #25D366;
            box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
        }

        .whatsapp-btn.active:hover {
            box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
        }

        /* 图标容器 */
        .icon-container {
            position: relative;
            width: 24px;
            height: 24px;
        }

        /* 图标基础样式 */
        .icon {
            position: absolute;
            top: 0;
            left: 0;
            width: 24px;
            height: 24px;
            transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
            fill: white;
        }

        /* WhatsApp图标显示状态 */
        .whatsapp-icon {
            opacity: 1;
            transform: rotate(0deg) scale(1);
        }

        /* 关闭图标隐藏状态 */
        .close-icon {
            opacity: 0;
            transform: rotate(-180deg) scale(0.8);
        }

        /* 按钮激活时的图标切换动画 */
        .whatsapp-btn.active .whatsapp-icon {
            opacity: 0;
            transform: rotate(180deg) scale(0.8);
        }

        .whatsapp-btn.active .close-icon {
            opacity: 1;
            transform: rotate(0deg) scale(1);
        }

        /* ===========================================
           响应式设计 - 移动端适配
           =========================================== */
        @media (max-width: 768px) {
            .chat-popup {
                width: 280px;
                right: -10px;  /* 移动端稍微调整位置 */
            }
            
            .whatsapp-container {
                bottom: 15px;  /* 移动端距离底部稍近 */
                right: 15px;   /* 移动端距离右侧稍近 */
            }

            .help-bubble {
                font-size: 11px;
                padding: 6px 12px;
                bottom: 65px;
            }
        }