/* === 布局框架 === */
.product-detail-section {
    background-color: #fff;
    padding: 60px 0 80px;
}

.detail-layout-box {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    position: relative;
}

/* === 1. 左侧侧边栏 (固定宽度 + 粘性定位) === */
.sidebar-wrapper {
width: 230px; /* 缩小宽度 */
flex-shrink: 0; /* 防止被压缩 */
border: 1px solid #eee;
background: #fff;

/* --- 核心：粘性定位 --- */
position: -webkit-sticky;
position: sticky;
top: 100px; /* 距离顶部导航栏的高度，根据实际情况微调 */
z-index: 10;
}

.sidebar-header {
background-color: var(--brand-color); /* 绿色 */
color: #fff;
font-size: 18px;
font-weight: bold;
padding: 15px 20px;
}

.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.menu-item { border-bottom: 1px solid #eee; position: relative; }
.menu-item:last-child { border-bottom: none; }

/* 一级菜单容器 */
.menu-item-inner {
display: flex;
justify-content: space-between;
align-items: center;
transition: 0.3s;
}
.menu-item-inner:hover { background-color: #f9f9f9; }

/* 一级链接 (点击跳转) */
.menu-link {
flex-grow: 1;
padding: 14px 10px 14px 20px;
color: #333;
font-size: 15px;
font-weight: 500;
text-decoration: none;
transition: color 0.3s;
}
.menu-link:hover { color: var(--brand-color); }

/* 右侧折叠开关 (单独点击展开，不跳转) */
.menu-toggle-icon {
padding: 14px 10px;
cursor: pointer;
color: #999;
font-size: 12px;
border-left: 1px solid transparent;
}
.menu-toggle-icon:hover { color: var(--brand-color); }

/* 选中高亮状态 */
.menu-item.active > .menu-item-inner {
background-color: #f0fbf5; /* 浅绿背景 */
border-left: 3px solid var(--brand-color);
}
.menu-item.active .menu-link { color: var(--brand-color); font-weight: bold; }

/* 展开时箭头旋转 */
.menu-item.expanded .menu-toggle-icon i {
display: block;
transform: rotate(90deg);
transition: transform 0.3s;
color: var(--brand-color);
}

/* 二级子菜单 */
.sub-menu {
list-style: none; padding: 0; margin: 0;
background-color: #fcfcfc;
display: none; /* 默认隐藏 */
border-top: 1px solid #f5f5f5;
}
.sub-menu li a {
display: block;
padding: 10px 20px 10px 25px; /* 缩进 */
font-size: 13px;
color: #666;
text-decoration: none;
border-bottom: 1px dashed #eee;
transition: 0.3s;
}
.sub-menu li a:hover, .sub-menu li.current a {
color: var(--brand-color);
padding-left: 30px;
}


/* === 2. 右侧内容区域 === */
.product-main-content {
    flex-grow: 1;
    min-width: 0;
}

/* --- A. 顶部简介区 (修改版：缩略图在右侧) --- */
.product-intro-box {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

/* 左：大图区域 (带边框的大盒子) */
.product-gallery {
    width: 48%;
    flex-shrink: 0;
    border: 1px solid #eee;
    /* 外框 */
    padding: 10px;
    /* 内边距 */
    border-radius: 4px;
}

/* 大图 Swiper */
.gallery-top {
    height: 350px;
    width: 100%;
    border-radius: 4px;
}

.gallery-top .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.gallery-top img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 右：文字 + 缩略图 */
.product-info {
    min-width: 0;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 370px;
    /* 保证高度与左侧接近 */
}

.product-title {
    font-size: 30px;
    font-weight: bold;
    color: #000;
    margin-bottom: 20px;
    line-height: 1.2;
}

.product-model {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    display: block;
}

.product-brief {
    font-size: 15px;
    color: #555;
    line-height: 2;
    text-align: justify;
    margin-bottom: 30px;
    /* 文字和缩略图的间距 */
}

/* 缩略图 Swiper (现在移到了右侧) */
.gallery-thumbs {
    height: 80px;
    box-sizing: border-box;
    padding: 0;
    width: 100%;
    /* 占满右侧宽度 */
}

.gallery-thumbs .swiper-slide {
    width: 25%;
    height: 100%;
    border: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: 0.3s;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

.gallery-thumbs .swiper-slide img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

/* 缩略图选中高亮 */
.gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 1px solid var(--brand-color);
}

/* --- B. 相关产品 (带箭头) --- */
.related-products-box {
    margin-bottom: 60px;
    position: relative;
}

.detail-section-header {
    background-color: var(--brand-color);
    color: #fff;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-radius: 4px;
}

.detail-section-header a {
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    opacity: 0.9;
}

.related-swiper {
    padding: 5px;
    margin: 0 10px;
}

.related-item {
    text-align: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    transition: 0.3s;
    display: block;
    text-decoration: none;
}

.related-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /* transform: translateY(-5px); */
    border-color: var(--brand-color);
}

.related-img {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.related-img img {
    max-width: 100%;
    max-height: 100%;
}

.related-title {
    font-size: 14px;
    color: #555;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
}

/* 左右箭头 */
.related-products-box .swiper-button-next,
.related-products-box .swiper-button-prev {
    color: #999;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    top: 60%;
}

.related-products-box .swiper-button-next:after,
.related-products-box .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.related-products-box .swiper-button-next:hover,
.related-products-box .swiper-button-prev:hover {
    color: var(--brand-color);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- C. 详情与表格 --- */
.detail-block {
    margin-bottom: 40px;
}

.detail-sub-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--brand-color);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--brand-color);
    display: flex;
    align-items: center;
}

.detail-text {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
}

.tech-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tech-table th,
.tech-table td {
    border: 1px solid #eee;
    padding: 12px 15px;
    font-size: 14px;
}

.tech-table th {
    background-color: #f9f9f9;
    color: #333;
    width: 30%;
    font-weight: bold;
}

.tech-table td {
    color: #666;
}

/* 响应式 */
/* ================= 手机端适配修复 (终极版) ================= */
@media (max-width: 991.98px) {

    /* 1. 布局改为竖排 */
    .detail-layout-box {
        flex-direction: column;
        width: 100%;
        /* 确保容器不超宽 */
    }

    /* 2. 左侧侧边栏：取消粘性，恢复正常文档流 */
    .sidebar-wrapper {
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }

    /* 3. 顶部简介区：防止轮播图撑开 */
    .product-intro-box {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        overflow: hidden;
        /* 关键：截断溢出 */
    }

    /* 4. 左侧大图 */
    .product-gallery {
        width: 100%;
        /* 如果需要大图也限高，可以加 max-width */
    }

    .gallery-top {
        height: 250px;
        /* 手机端大图高度 */
    }

    /* 5. 右侧文字+缩略图 (核心修复区) */
    .product-info {
        width: 100%;
        min-height: auto;
        /* 关键：强制限制宽度，打断 Swiper 计算死循环 */
        max-width: 100%;
        overflow: hidden;
    }

    /* 6. 缩略图 */
    .gallery-thumbs {
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
        /* 再次保险 */
    }

    /* 7. 相关产品：隐藏左右箭头 */
    .related-products-box .swiper-button-next,
    .related-products-box .swiper-button-prev {
        display: none;
    }

    /* 8. 修复表格在手机端撑开页面的问题 */
    .detail-content-box {
        width: 100%;
        overflow-x: auto;
        /* 表格过宽时内部滚动，不撑开页面 */
    }

    .tech-table {
        min-width: 500px;
        /* 保证表格不被挤压，允许左右滑 */
    }

    .product-main-content {
        flex-grow: 1;
        max-width: 100%;
    }

    .sidebar-wrapper {
        display: none;
    }
}

.detail-content-box img{
    margin: 0 auto;
    display: block;
    max-width: 100%;
}