/* === 全局基础样式 === */
    body { font-family: "Microsoft YaHei", sans-serif; margin: 0; }

    /* === 核心容器：悬浮组件 === */
    .floating-widget {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* 默认靠右对齐 */
    }

    /* === 表单容器样式 (PC默认) === */
    .lead-form-container {
        background: white;
        width: 300px; /* PC端固定宽度 */
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.2);
        margin-bottom: 15px;
        
        /* 动画过渡 */
        transform-origin: bottom right;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        opacity: 1;
        transform: scale(1) translateY(0);
        visibility: visible;
    }

    /* === 隐藏状态 === */
    .lead-form-container.hidden {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
        visibility: hidden;
        pointer-events: none;
        height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    /* === 表单元素美化 === */
    .lead-form-container h3 {
        margin: 0 0 15px 0;
        color: #333;
        font-size: 18px;
        text-align: center;
    }

    .form-group { margin-bottom: 12px; }

    .form-group input, 
    .form-group select {
        width: 100%;
        padding: 12px; /* 增加点击区域 */
        border: 1px solid #ddd;
        border-radius: 6px;
        box-sizing: border-box;
        font-size: 14px;
        outline: none;
        transition: border-color 0.3s;
    }

    .form-group input:focus,
    .form-group select:focus {
        border-color: #007BFF;
    }

    .submit-btn {
        width: 100%;
        background-color: #b71c1c;
        color: white;
        border: none;
        padding: 14px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        margin-top: 5px;
    }

    .submit-btn:active { background-color: #b71c1c; }

    /* === 切换按钮样式 === */
    .toggle-btn {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background-color: #b71c1c;
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(255, 0, 4, 0.4);
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 24px;
        transition: transform 0.2s;
        -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    }

    .toggle-btn:active { transform: scale(0.95); }

    /* 图标切换 */
    .icon-close { display: block; }
    .icon-open { display: none; }
    .floating-widget.collapsed .icon-close { display: none; }
    .floating-widget.collapsed .icon-open { display: block; }

    /* =========================================
       !!! 响应式核心代码 (针对手机屏幕) !!!
       ========================================= */
    @media (max-width: 768px) {
        .floating-widget {
            bottom: 15px;
            right: 15px;
            /* 让容器宽度适应屏幕，防止表单溢出 */
            left: 15px; 
            align-items: flex-end; /* 按钮保持在右边 */
            pointer-events: none; /* 容器本身不阻挡点击，只让子元素阻挡 */
        }

        .toggle-btn {
            pointer-events: auto; /* 恢复按钮点击 */
        }

        .lead-form-container {
            pointer-events: auto; /* 恢复表单点击 */
            width: 100%; /* 宽度占满容器（即屏幕宽度减去左右margin） */
            max-width: none; /* 移除最大宽度限制 */
        }

        /* 针对iOS的优化：字体小于16px会导致输入框聚焦时页面缩放 */
        .form-group input, 
        .form-group select {
            font-size: 16px; 
        }
    }