/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
}

/* 主容器：三列布局 */
.product-detail-container {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 650px 80px 1fr;
    gap: 30px;
    align-items: flex-start;
}

/* 左侧主图区域 */
.main-image-wrapper {
    width: 650px;
    height: 650px;
    position: sticky;
    top: 40px;
    box-sizing: border-box;
}

.main-image-container {
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    overflow: hidden;
    cursor: ns-resize;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    transition: opacity 0.3s ease;
}

/* 中间区域：竖线指示器 + 缩略图 */
.middle-section {
    display: flex;
    gap: 15px;
    padding-top: 1px;
}

/* 左侧竖线指示器 */
.thumbnail-indicator {
    width: 1px;
    height: 650px;
    background-color: #ddd;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc((650px - (8px * var(--total-images, 5))) / (var(--total-images, 5) - 1));
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #bbb;
    margin-left: -3.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background-color: #000;
    transform: scale(1.3);
}

/* 中间缩略图区域 */
.thumbnail-wrapper {
    display: flex;
    align-items: center;
    height: 650px;
}

.thumbnail-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumbnail-container::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent; /* 移除默认边框 */
    filter: grayscale(60%) opacity(70%);
    transition: all 0.3s ease;
}

/* 选中缩略图样式：底部黑线 */
.thumbnail.active {
    filter: none; /* 恢复彩色和透明度 */
    border-bottom: 2px solid #000; /* 底部黑线 */
    transform: scale(1.05);
}

.thumbnail:hover:not(.active) {
    filter: grayscale(30%) opacity(85%);
}

/* 右侧产品信息区域 */
.product-info-wrapper {
    padding: 20px 0;
}

.product-info-content {
    max-width: 600px;
}

.product-title {
    font-size: 28px;
    font-weight: 400;
    margin-top: 20px;
    margin-bottom: 60px;
    line-height: 1.3;
    text-align: center;
    color: #333;
    border-bottom: 2px solid #000000;
    padding-bottom: 20px;
}

.product-description {
    color: #555;
    line-height: 1.8;
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 0px;
    min-height: 490px;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }

    .main-image-wrapper {
        width: 100%;
        height: auto;
        max-height: 650px;
        position: static;
    }

    .middle-section {
        width: 100%;
        margin: 20px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 0;
    }

    .thumbnail-indicator {
        width: 100%;
        height: 1px;
        flex-direction: row;
        gap: calc((100% - (8px * var(--total-images, 5))) / (var(--total-images, 5) - 1));
    }

    .indicator-dot {
        margin-left: 0;
        margin-top: -3.5px;
    }

    .thumbnail-wrapper {
        width: 100%;
        height: auto;
    }

    .thumbnail-container {
        flex-direction: row;
        max-height: auto;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .thumbnail {
        flex: 0 0 48px;
    }
}

@media (max-width: 768px) {
    .product-detail-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .main-image-wrapper {
        max-height: 500px;
    }

    .product-title {
        font-size: 24px;
    }
}