/* =========================================
   🛡️ MX Matrix 终极防御盾 (视频模块接管版)
   ========================================= */

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

/* 基础背景色 */
.mx-video-page-wrapper {
    background-color: #f8f9fa;
}

/* 2. 电脑端 (≥769px)：外围包装器恢复 30px 留白，维持 1600px 宽度 */
@media (min-width: 769px) {
    .mx-matrix-wrapper:has(.mx-video-page-wrapper) .mx-video-page-wrapper {
        padding: 30px !important; /* 👈 此处已从 20px 修改为 30px */
    }
    /* 🛡️ 修复点：限定只清零视频模块内部的 container，保护全局 Header 不被误伤 */
    .mx-video-page-wrapper .mx-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 1600px !important; 
        margin: 0 auto;
    }
}

/* 3. 手机/平板端 (≤768px)：外围包装器 上下 30px，左右 10px */
@media (max-width: 768px) {
    .mx-matrix-wrapper:has(.mx-video-page-wrapper) .mx-video-page-wrapper {
        padding: 30px 10px !important; 
    }
    /* 🛡️ 修复点：限定只清零视频模块内部的 container，保护全局 Header 不被误伤 */
    .mx-video-page-wrapper .mx-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* mx-matrix-engine: Hero Video Module Styles */
.mx-hero-video-section {
    width: 100%;
    background-color: #0a0a0a;
    padding: 0;
    margin-bottom: 40px; 
    border-bottom: none; 
    border-radius: 0 !important; 
}

.mx-hero-container {
    position: relative;
}

/* 修改点 1：主宣传片容器占位高度 */
.mx-hero-video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.24%; /* 👈 从 56.25% 修改为精确的 1538:865 比例 */
    overflow: hidden;
    background: #000;
    border-radius: 0 !important; 
}

.mx-hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s;
    border-radius: 0 !important;
}

.mx-hero-video-wrap:hover .mx-hero-video {
    opacity: 0.9;
}

.mx-hero-overlay {
    position: absolute;
    bottom: 10%;
    left: 5%;
    z-index: 2;
}

.mx-hero-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.mx-matrix-wrapper .mx-hero-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #cc0000;
    color: #ffffff !important; 
    font-weight: 600;
    text-decoration: none !important;
    border: 2px solid #cc0000;
    border-radius: 0 !important; 
    transition: all 0.3s ease;
}

.mx-matrix-wrapper .mx-hero-btn:hover {
    background-color: transparent !important;
    color: #cc0000 !important; 
}

.mx-matrix-wrapper .mx-hero-btn.mx-hero-btn-outline {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

.mx-matrix-wrapper .mx-hero-btn.mx-hero-btn-outline:hover {
    background-color: #ffffff !important; 
    color: #111418 !important;            
    border-color: #ffffff !important;
    transform: translateY(-2px);          
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); 
}

/* mx-matrix-engine: Video Grid Module Styles */
.mx-video-grid-wrapper {
    width: 100%;
    padding: 0 !important; 
}

.mx-video-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 30px;
}

.mx-video-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 0 !important; 
    transition: all 0.3s ease;
    overflow: hidden;
}

.mx-video-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #003366;
}

.mx-video-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 修改点 2：产品列表视频容器占位高度 */
.mx-video-thumbnail-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.21%; /* 👈 修改为精确的 491:276 比例 */
    background: #000;
}

.mx-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important; 
}

.mx-product-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #003366;
    color: #ffffff;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 2;
    border-radius: 0 !important;
}

.mx-video-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8); 
    color: #ffffff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 3; /* 👈 【修改点】：将原先的 2 改为 3 */
    pointer-events: none; 
    border-radius: 0 !important;
}

.mx-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    background-color: rgba(0, 51, 102, 0.85);
    border: 2px solid #fff;
    border-radius: 0 !important; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 2;
}

.mx-video-card:hover .mx-video-play-btn {
    background-color: #cc0000;
}

.mx-video-play-btn::before {
    content: '';
    display: block;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

.mx-video-content {
    padding: 20px;
}

.mx-video-content .mx-video-title {
    border-left: none !important; 
    padding-left: 0 !important;
    font-weight: 700; 
    color: #111418;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.4;
    border-radius: 0 !important;
}

.mx-video-content a:last-child {
    display: inline-block !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important; 
}

.mx-video-card:hover .mx-video-content a:last-child {
    color: #cc0000 !important; 
    transform: translateX(4px); 
    letter-spacing: 0.5px; 
}

@media screen and (max-width: 768px) {
    .mx-hero-title {
        font-size: 1.75rem; 
        letter-spacing: 1px;
    }
    
    /* 👈 【新增点】：在原有的媒体查询内部，直接插入这三行 */
    .mx-hero-overlay {
        right: 5%; 
    }

    .mx-matrix-wrapper .mx-hero-btn {
        padding: 10px 20px; 
        font-size: 0.9rem;
        flex: 1 1 auto; 
        text-align: center;
    }
    .mx-video-grid-container {
        gap: 15px; 
    }
}

/* =========================================
   通用分页导航样式 (MX Pagination)
   ========================================= */
.mx-video-grid-wrapper .mx-pagination {
    text-align: center;
    margin: 30px auto 0 auto; 
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mx-video-grid-wrapper .mx-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;  
    min-height: 48px; 
    padding: 0 12px;
    background-color: #f4f5f7; 
    color: var(--mx-text-dark, #111418); 
    font-size: 14px;
    font-weight: 600; 
    text-decoration: none !important;
    border-radius: 0 !important; 
    border: none; 
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mx-video-grid-wrapper .mx-pagination a.page-numbers:hover,
.mx-video-grid-wrapper .mx-pagination a.page-numbers:focus-visible {
    background-color: var(--mx-border-light, #e5e7eb) !important;
    color: var(--mx-text-dark, #111418) !important;
    outline: none;
}

.mx-video-grid-wrapper .mx-pagination .page-numbers.current {
    background-color: var(--mx-accent-blue, #2b4c9b) !important; 
    color: var(--mx-bg-white, #ffffff) !important;
    pointer-events: none;
    border: none !important; 
}

.mx-video-grid-wrapper .mx-pagination span.dots {
    background-color: transparent;
    color: var(--mx-text-gray, #4b5563);
    min-width: auto;
}