/* ==========================================================================
   MX Matrix Engine - Contact Us Component
   Layout: 1600px Max-Width (Via Global Shield) / Pure CSS / No JS
   ========================================================================== */

/* =========================================
   🛡️ 第一步：MX Matrix 终极防御盾 (Contact Us 模块)
   ========================================= */

/* 1. 外部绝对清零：彻底击穿干掉 WordPress 主题默认的 20px 留白 */
body .inside-article:has(.mx-contact-wrapper),
body .entry-content:has(.mx-contact-wrapper) {
    padding: 0 !important; 
}

/* 2. 电脑端 (≥769px)：容器接管，上下左右绝对 30px */
@media (min-width: 769px) {
    .mx-matrix-wrapper:has(.mx-contact-wrapper) .mx-container {
        padding: 30px !important; 
        max-width: 1640px; 
        margin: 0 auto;    
    }
}

/* 3. 手机端 (≤768px)：容器接管，上下 30px，左右 10px */
@media (max-width: 768px) {
    .mx-matrix-wrapper:has(.mx-contact-wrapper) .mx-container {
        padding: 30px 10px !important; 
    }
}

/* 修改这里 */
.mx-contact-wrapper {
    width: 100%;
    background-color: #f8f9fa; 
    padding: 0 !important; /* 👈 核心修改：原为 40px 0 0，强制改为 0，干掉顶部红框多余留白 */
    font-family: inherit;
}

/* 此时无需在此重写容器宽度，全站底层 .mx-container 已经接管了 1640px - (20px*2) 的完美安全区 */

/* 总部信息栏 */
.mx-global-contact-bar {
    margin-bottom: 40px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 25px;
}

/* 总部信息栏标题（全局） */
.mx-section-title {
    font-size: 32px;
    color: #222222;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 15px;      
}

.mx-global-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mx-label {
    color: #1a202c;
    font-weight: 700;
}

.mx-value {
    color: #222222;
    font-weight: 400; 
}

.mx-link {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mx-link:hover {
    color: #3182ce;
    text-decoration: underline;
}

.mx-team-intro {
    font-size: 14px;
    color: #222222;
    margin: 0 0 21px 0;
    line-height: 1.6;
}

.mx-team-intro p {
    margin: 0;
}

.mx-form-intro {
    font-size: 14px;
    color: #222222;
    margin: 0 0 21px 0;
    line-height: 1.6;
}

/* 专家矩阵 */
.mx-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.mx-expert-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    /* 👇 核心修改：将原本的 35px 30px 30px 改为 55px 30px 30px */
    padding: 55px 30px 30px; 
    border-radius: 0; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mx-expert-card[id] {
    scroll-margin-top: 120px; 
}

.mx-expert-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #edf2f7;
    color: #4a5568;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0px;
}

.mx-badge-primary {
    background-color: #3182ce;
    color: #ffffff;
}

.mx-expert-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 20px;
    /* 👇 新增防御：强行把头像和名字区域往下推 10px，彻底避开右上角标签 */
    margin-top: 10px; 
}

.mx-expert-avatar {
    width: 68px !important;
    height: 68px !important;
    border-radius: 50%; 
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.mx-expert-headings {
    display: flex;
    flex-direction: column;
}

.mx-expert-name {
    font-size: 21px;
    color: #111827;
    font-weight: 700 !important; 
    
    /* 👇 核心防御：强制覆盖主题的 margin，并收紧行高，确保 Flexbox 计算精准 */
    margin: 0 0 4px 0 !important;
    line-height: 1.2 !important; 
    
    border-left: none !important; 
    padding-left: 0 !important;   
}

.mx-expert-title {
    font-size: 14px;
    color: #64748b !important; 
    font-weight: 400 !important; 
    
    /* 👇 核心防御：强制清零底部 margin，收紧行高，消除隐形留白 */
    margin: 0 !important;
    line-height: 1.4 !important; 
    
    text-transform: none !important; 
    letter-spacing: 0; 
}

.mx-expert-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mx-expert-desc {
    font-size: 14px;
    color: #222222;
    line-height: 1.6;
    margin: 0 0 21px 0;
}

.mx-expert-contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto; 
}

.mx-contact-line {
    font-size: 14px;
    color: #1a202c;
    display: flex; 
}

.mx-contact-line strong {
    color: #1a202c;
    font-weight: 700;
    width: 90px;
    flex-shrink: 0; 
}

.mx-contact-line a {
    color: #222222;
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s ease;
}

.mx-contact-line a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* 询盘表单 */
.mx-inquiry-form-container {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #e2e8f0;
    margin-bottom: 60px;
}

.mx-form-title {
    font-size: 32px;
    color: #222222;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 15px;      
}

.mx-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.mx-input, .mx-select, .mx-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd !important; 
    background: #fcfcfc !important;
    color: #333333;
    font-size: 16px;
    font-family: inherit;
    border-radius: 0 !important; 
    box-shadow: none !important; 
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.mx-input::placeholder,
.mx-textarea::placeholder {
    color: #999999;
    font-weight: 400;
    opacity: 1;
}

.mx-select {
    color: #999999 !important; 
    cursor: pointer;
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    padding-right: 40px !important; 
}

.mx-select option {
    color: #333333; 
}

.mx-textarea {
    resize: none; 
}

.mx-input:focus, .mx-select:focus, .mx-textarea:focus {
    outline: none !important;
    border-color: #222 !important;
    background: #ffffff !important;
}

.mx-btn-submit {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 14px 36px;
    font-size: 18px;
    font-weight: 500;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.mx-btn-submit:hover {
    background-color: #0056B3;
}

.mx-map-container {
    background: #ffffff;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

.mx-map-container iframe {
    display: block;
    vertical-align: bottom;
}

/* 地图版块专项样式 */
.mx-map-header {
    text-align: center;
    margin-top: 60px;     
    margin-bottom: 30px;  
    padding: 0 15px;      
}

.mx-section-title.mx-text-center {
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 0; 
}

.mx-section-title.mx-text-center::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #0056b3; 
    border-radius: 0px;
}

.mx-map-intro {
    font-size: 15px;
    color: #4a5568;       
    max-width: 700px;     
    margin: 20px auto 0;  
    line-height: 1.6;
}

@media (max-width: 1400px) {
    .mx-contact-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 移动端 (手机) 响应式 */
@media (max-width: 768px) {
    .mx-section-title { margin-top: 0 !important; }
    
    .mx-global-contact-bar { 
        margin-bottom: 25px; 
        padding-bottom: 20px; 
        /* 👇 核心修改：把下面这两行删掉，消除红框里的多余留白 */
        /* padding-left: 15px;  */
        /* padding-right: 15px; */
    }
    
    .mx-team-intro {
        /* 👇 顺手把这里也删掉，防止下方的文字也被往里挤 */
        /* padding-left: 15px; */
        /* padding-right: 15px; */
    }

    .mx-contact-grid { grid-template-columns: 1fr; }
    .mx-form-row { flex-direction: column; gap: 20px; margin-bottom: 20px; }
    
    .mx-inquiry-form-container { 
        /* 👇 核心修改：将原本的 15px 改为上下 30px，左右 10px */
        padding: 30px 10px !important; 
        margin-bottom: 30px !important; 
    }

    .mx-btn-submit {
        padding: 12px 24px;
        font-size: 16px;    
        width: 100%;        
    }
    
    .mx-map-header {
        margin-top: 0 !important;      
        margin-bottom: 20px !important;
    }
}

.mx-card-btn {
    display: inline-block;
    margin-top: 15px;
    background-color: #f8f9fa; 
    color: #1a202c;
    text-align: center;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 0; 
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mx-card-btn:hover {
    background-color: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}