/* 全局初始化 */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background: #fff;
    font-family: "Microsoft Yahei",sans-serif;
    color: #333;
    line-height: 1.7;
}

/* 顶部banner：通栏大图 */
/* 顶部横幅 */
.product-banner{
    width: 100%;
    height: 350px;
    background: url("../images/top4.jpg") no-repeat center center;
    background-size: cover;
    margin-top: 90px;
}

/* 主容器 */
.main-container {
    display: flex;
    gap: 60px;
    max-width: 1500px;
    margin: 60px auto;
    padding: 0 20px;
}

/* 左侧分类栏 */
.sidebar {
    width: 180px;
    flex-shrink: 0;
}
.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #222;
}

/* 分组头部 */
.cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    color: #222;
}
.cat-head.active {
    color: #9B182F;
}
.cat-btn {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* 子容器 折叠核心 */
.cat-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.cat-body.open {
    max-height: 300px;
}

/* 分割线 */
.line {
    height: 1px;
    background: #ddd;
    margin: 12px 0;
}

/* 子分类项 */
.cat-item {
    padding: 10px 0 10px 16px;
    font-size: 16px;
    color: #888;
    cursor: pointer;
}
.cat-item.active {
    color: #9B182F;
}
.cat-item:hover {
    color: #9B182F;
}

/* 右侧产品区 */
.product-area {
    flex: 1;
}
.product-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #222;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 20px;
    margin-bottom: 40px;
}

/* 产品卡片：常态与页面同一平面 */
.product-card {
    text-align: center;
    cursor: pointer;
    background: transparent;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    /* 常态无阴影、无上浮，和背景齐平 */
    transform: translateY(0);
    box-shadow: none;
}
/* 悬浮时：上浮 + 变白 + 阴影突出 */
.product-card:hover {
    transform: translateY(-8px);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
.product-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    margin-bottom: 12px;
}
.product-name {
    font-size: 16px;
    color: #333;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
/* 普通数字页码（保留原有边框样式） */
.page-btn[data-page] {
    /* width: 36px;
    height: 36px; */
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.page-btn[data-page].active {
    background: #9B182F;
    color: #fff;
    border-color: #9B182F;
}
.page-btn[data-page]:not(.active):hover {
    color: #9B182F;
    border-color: #9B182F;
}
/* 上一页、下一页 去除边框、改成文字样式 */
#prevPage, #nextPage {
    border: none;
    background: transparent;
    width: auto;
    height: 36px;
    padding: 0 12px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-radius: 0;
}
#prevPage:hover, #nextPage:hover {
    color: #9B182F;
}
/* 禁用态样式（首页/末页时置灰） */
#prevPage:disabled, #nextPage:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* 总页数文字样式 */
.page-total {
    font-size: 14px;
    color: #666;
    margin-left: 8px;
}

/* 移动端适配 */
@media(max-width:768px){
    .main-container {
        flex-direction: column;
        gap: 30px;
    }
    .sidebar {
        width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-banner {
        height: 220px;
        margin-top: 90px;
    }
}