/* ==========================================================================
   MX Floating Inquiry Module - 终极无懈可击版 (整合所有间距、边框与防污染补丁)
   ========================================================================== */

/* --- 1. 微型防御盾 (Mini Shield) --- */
.mx-floating-wrapper *,
.mx-floating-wrapper *::before,
.mx-floating-wrapper *::after {
    box-sizing: border-box;
}

.mx-floating-wrapper img, 
.mx-floating-wrapper svg {
    max-width: none; 
    margin: 0;
    padding: 0;
    display: block;
}

.mx-floating-wrapper input,
.mx-floating-wrapper textarea,
.mx-floating-wrapper button {
    font-family: inherit;
    margin: 0;
}

/* --- 2. 核心外层容器 --- */
.mx-floating-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: inherit;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

/* 隐藏原始 Checkbox */
.mx-toggle-checkbox {
    display: none;
}

/* --- 3. 触发按钮 --- */
.mx-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #004488;
    color: #ffffff;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease;
    border: 1px solid #003366;
}

.mx-trigger-btn:hover {
    background-color: #003366;
}

.mx-trigger-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.mx-trigger-text {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* --- 4. 展开面板 --- */
.mx-inquiry-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 340px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}

/* 纯 CSS 核心控制 */
.mx-toggle-checkbox:checked ~ .mx-inquiry-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.mx-toggle-checkbox:checked ~ .mx-trigger-btn {
    display: none;
}

/* --- 5. 面板内部样式 --- */
.mx-panel-header {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mx-panel-title {
    font-weight: 700;
    font-size: 15px;
}

.mx-close-btn {
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.mx-close-btn:hover {
    opacity: 1;
}

.mx-panel-body {
    padding: 20px;
}

/* --- 6. 信任区 (强制防御：边框、间距、行高、对齐) --- */
.mx-floating-wrapper .mx-trust-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #f8f9fa !important;
    border: 1px solid #eeeeee !important;
    padding: 12px !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
}

.mx-floating-wrapper .mx-trust-item {
    font-size: 12px !important;
    color: #555555 !important;
    width: 100%;
    display: flex !important;
    align-items: center !important;
    
    /* 彻底清空外部污染 */
    padding: 0 !important;
    background: transparent !important;
    min-height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    
    /* 强制靠左对齐，防止元素被首页规则向两边扯开 */
    justify-content: flex-start !important; 
    gap: 0 !important;

    /* 行高与间距锁定 (防止首页文字拥挤) */
    line-height: 1.5 !important;      
    margin-bottom: 8px !important;    
    letter-spacing: normal !important;
}

.mx-floating-wrapper .mx-trust-item:last-child {
    margin-bottom: 0 !important;
}

/* 恢复前面的对勾图标 */
.mx-floating-wrapper .mx-trust-item::before {
    content: "✓";
    color: #004488;
    margin-right: 8px;
    font-weight: bold;
}

/* 确保加粗文字周围没有奇怪的边距 */
.mx-floating-wrapper .mx-trust-item strong {
    display: inline !important;
    font-size: inherit !important;
    color: inherit !important;
    font-weight: 700 !important;
    margin: 0 4px 0 0 !important; 
    padding: 0 !important;
}

/* --- 7. 表单样式 --- */
.mx-form-group {
    margin-bottom: 15px;
}

/* 强制统一输入框样式，抵御外部圆角和边框颜色干扰 */
.mx-floating-wrapper .mx-input, 
.mx-floating-wrapper .mx-textarea {
    width: 100%;
    padding: 10px !important;
    border: 1px solid #cccccc !important; 
    background-color: #ffffff !important;
    font-size: 14px !important;
    outline: none !important;
    border-radius: 0 !important;          
    box-shadow: none !important;          
}

.mx-floating-wrapper .mx-input:focus, 
.mx-floating-wrapper .mx-textarea:focus {
    border-color: #004488 !important;
}

.mx-floating-wrapper .mx-textarea {
    resize: vertical;
    min-height: 80px;
}

.mx-floating-wrapper .mx-submit-btn {
    width: 100%;
    background-color: #004488;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 0 !important;
}

.mx-floating-wrapper .mx-submit-btn:hover {
    background-color: #003366;
}

/* --- 8. 移动端响应式 --- */
@media (max-width: 768px) {
    .mx-floating-wrapper {
        bottom: 20px;
        right: 20px;
    }
    
    .mx-trigger-btn {
        padding: 12px;
        border-radius: 50%;
    }
    
    .mx-trigger-icon {
        margin-right: 0;
    }
    
    .mx-trigger-text {
        display: none; 
    }
    
    .mx-inquiry-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-right: none;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    }
}