/* --- 刻意极简：二级页面 (产品矩阵) 专用视觉体系 --- */

/* 平滑滚动体验锚定 */
html {
    scroll-behavior: smooth;
}

.matrix-page {
    background-color: #fcfcfc;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* 顶部统领级视觉 Hero */
.matrix-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 120px 0 80px;
    text-align: center;
}

.matrix-title {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.matrix-desc {
    font-size: 1.25rem;
    color: #94a3b8;
    font-weight: 300;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 页面核心双列骨架 */
.matrix-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 80px;
    padding-top: 80px;
    padding-bottom: 120px;
    align-items: start;
}

/* 静态雷达侧边栏 (ScrollSpy) */
.matrix-nav {
    position: sticky;
    top: 120px;
    background: transparent;
}

.matrix-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e2e8f0;
}

.matrix-nav li {
    margin: 0;
}

.matrix-nav a {
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.matrix-nav a:hover {
    color: #0f172a;
    background-color: rgba(241, 245, 249, 0.4);
}

.matrix-nav a::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #2563eb;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.matrix-nav a.active {
    color: #2563eb;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(37,99,235,0.04) 0%, transparent 100%);
}

.matrix-nav a.active::before {
    transform: scaleY(1);
}

/* --- 二级导航：抽屉与折叠物理引擎 --- */
.matrix-nav .nav-group {
    position: relative;
    overflow: hidden; /* 防止内部高度跳动破坏外层 */
}

.matrix-nav .nav-sub {
    border-left: none; /* 清除默认的主边线继承 */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    padding: 0;
}

.matrix-nav .nav-group.expanded .nav-sub {
    max-height: 400px; /* 足以容纳6-7个子项的高度限额 */
    opacity: 1;
    margin-bottom: 8px;
}

.matrix-nav .nav-sub .sub-link {
    padding: 10px 16px 10px 24px;
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
    border-left: 2px solid transparent;
    transition: all 0.3s;
}

/* 覆盖上层 ::before 特效 */
.matrix-nav .nav-sub .sub-link::before {
    display: none; 
}

.matrix-nav .nav-sub .sub-link:hover {
    color: #334155;
    background-color: transparent;
}

.matrix-nav .nav-sub .sub-link.active-sub {
    color: #2563eb;
    font-weight: 500;
    border-left-color: rgba(37,99,235, 0.2); /* 轻度聚焦感 */
    background: transparent;
}

/* 产品大类模块间距定位 */
.matrix-category {
    margin-bottom: 120px;
    scroll-margin-top: 120px; /* 锚点精准补偿 Header 高度 */
}

.matrix-category:last-child {
    margin-bottom: 0;
}

.cat-header {
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.cat-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* 矩阵独立卡片 */
.product-card {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 48px;
    margin-bottom: 40px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    scroll-margin-top: 130px; /* 锚点精准补偿 Header 高度，防止被遮挡 */
}

.product-card:last-child {
    margin-bottom: 0;
}

.product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: rgba(37,99,235,0.1);
}

.p-card-image {
    width: 100%;
    height: 270px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f1f5f9; 
}

/* 微克制自然滤镜引擎 */
.p-card-image img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    opacity: 0.95; 
    filter: saturate(80%) contrast(0.95); /* 轻度克制，不破坏原色相 */
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(1.02); /* 预留放大景深 */
}

.product-card:hover .p-card-image img {
    opacity: 1; 
    filter: saturate(105%) contrast(1.05); /* 悬浮激发，呈现清透生机 */
    transform: scale(1.08); /* 沉浸式放大 */
}

/* 卡片文本区域 */
.p-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.p-card-info h3 {
    font-size: 1.20rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    transition: color 0.3s;
}

.product-card:hover .p-card-info h3 {
    color: #2563eb;
}

.p-card-info p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 24px;
}

/* 定制化悬停交互按钮 */
.mt-4 { margin-top: 1rem; }
.btn-outline-hover {
    align-self: flex-start;
    padding: 10px 28px;
    border: 1px solid #2563eb;
    color: #2563eb;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.btn-outline-hover:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px 0 rgba(37,99,235,0.39);
}

/* JS 驱动视差隐入动画 (Fade In Up) */
.lazy-image { opacity: 0; }
.fade-into-view {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-into-view.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.lazy-image.is-visible {
    opacity: 1;
}

/* 移动端降级 (Mobile Graceful Degradation: Sticky Accordion) */
@media (max-width: 992px) {
    .matrix-body {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 40px;
    }

    .matrix-hero { padding: 90px 4% 50px; }
    .matrix-nav { display: none; }

    .matrix-category {
        scroll-margin-top: 70px; /* 移动头偏小 */
        margin-bottom: 80px;
    }

    .product-card {
        grid-template-columns: 1fr;
        padding: 0; 
        gap: 20px;
        box-shadow: none;
        border: none;
        border-bottom: 1px solid #e2e8f0;
        border-radius: 0;
        padding-bottom: 30px;
    }
    .product-card:hover {
        transform: none;
        box-shadow: none;
    }

    .p-card-image {
        height: 220px;
        border-radius: 8px;
    }
    
    /* 移动端标题：由于屏幕变窄，应用模糊吸顶技术，保持大分类认知 */
    .cat-header.sticky-mobile {
        position: sticky;
        top: 60px; 
        z-index: 20;
        background: rgba(252, 252, 252, 0.85);
        backdrop-filter: blur(12px);
        margin: 0 -5% 30px;
        padding: 20px 5% 16px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .cat-header.sticky-mobile h2 {
        font-size: 1.6rem;
        margin: 0;
    }
}
