* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

.product-container {
    width: 1140px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: relative;
	z-index: 1;
}

.product-gallery {
    width: 500px;
    flex-shrink: 0;
}

.main-image {
    width: 100%;
    height: auto;
    cursor: zoom-in;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.02);
}

.product-info {
}

.product-title {
    font-size: 24px;
	font-weight:bold !important;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.spec-list {
    margin-bottom: 30px;
    font-size: 16px !important;
}

.spec-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.spec-item dt {
    width: 100px;
    font-weight: bold;
    color: #666;
}

.spec-item dd {
    flex: 1;
    color: #444;
}

.price-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-price {
    color: #e4393c;
    font-size: 28px;
    font-weight: bold;
}

.original-price {
    color: #999;
    font-size: 16px;
}

.buy-button {
    display: inline-block;
    background: #e4393c;
    color: #fff;
    padding: 12px 45px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 18px;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.buy-button:hover {
    background: #c03537;
	color: #fff;
}

/* 放大镜样式 */
.zoom-container {
    display: none;
    position: absolute;
    left: 540px;
    width: 500px;
    height: 500px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    background-size: 150%;
    background-position: center;
    background-repeat: no-repeat;
}

.zoom-container.active {
    display: block;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* 放大镜容器 */
.magnifier-wrap {
    position: relative;
    width: 500px;
    height: 500px;
    overflow: hidden;
}

.magnifier-mask {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.3);
    border: 2px solid #fff;
    cursor: move;
    pointer-events: none;
    display: none;
}

.magnifier-view {
    position: absolute;
    left: 540px;
    width: 500px;
    height: 500px;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    background-repeat: no-repeat;
    display: none;
    z-index: 100;
}

/* 商品详情通栏 */
.product-detail {
    width: 1140px;
    margin: 30px auto 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.detail-title {
    padding: 20px 30px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    border-bottom: 3px solid #e4393c;
    position: relative;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.detail-title::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #e4393c;
}

.detail-content {
    padding: 30px;
    line-height: 1.8;
    color: #666;
}

.detail-content img {
    width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 6px;
}

.detail-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.detail-content li {
    margin-bottom: 12px;
    padding-left: 10px;
    position: relative;
}

.detail-content li::before {
    content: "?";
    color: #e4393c;
    position: absolute;
    left: -15px;
}

/* 平板设备 (768px-1199px) */
@media (max-width: 1199px) {
    .product-container {
        width: 95%;
        max-width: 1140px;
        gap: 30px;
        padding: 20px;
    }

    .product-detail {
        width: 95%;
        max-width: 1140px;
    }

    .magnifier-view {
        left: calc(100% + 20px);
        width: 400px;
        height: 400px;
    }

    .product-title {
        font-size: 22px;
    }

    .current-price {
        font-size: 24px;
    }
}

/* 小屏平板 (480px-767px) */
@media (max-width: 767px) {
    .product-container {
        flex-direction: column;
        gap: 20px;
    }

    .product-gallery {
        width: 100%;
    }

    .magnifier-wrap {
        width: 100%;
        height: auto;
    }

    .magnifier-view {
        display: none !important; /* 移动端隐藏放大镜 */
    }

    .product-info {
        padding: 0 15px;
    }

    .detail-title {
        padding: 15px 20px;
        font-size: 18px;
    }

    .buy-button {
        width: 100%;
        text-align: center;
    }
}

/* 手机设备 (<=479px) */
@media (max-width: 479px) {
    body {
        padding: 15px 0;
    }

    .product-container {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .product-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .spec-item {
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .spec-item dt {
        width: 100%;
        margin-bottom: 5px;
    }

    .price-box {
        flex-wrap: wrap;
        gap: 8px;
    }

    .current-price {
        font-size: 22px;
    }

    .product-detail {
        width: 100%;
        margin-top: 20px;
        border-radius: 0;
    }

    .detail-content {
        padding: 20px 15px;
    }

    /* 移动端优化触摸事件 */
    .magnifier-mask {
        display: none !important;
    }

    .main-image {
        cursor: pointer;
    }
}
/* 推荐商品通栏 */
.recommend-section {
    width: 1140px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    padding: 30px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e4393c;
}

.section-title h2 {
    font-size: 20px;
    color: #333;
    position: relative;
    padding-left: 15px;
}

.section-title h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #e4393c;
}

.carousel-controls button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.carousel-controls button:hover {
    background: #e4393c;
    color: #fff;
    border-color: #e4393c;
}

.recommend-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 15px;
}

/* 隐藏默认滚动条 */
.recommend-list::-webkit-scrollbar {
    display: none;
}

.product-card {
    flex: 0 0 calc(33.333% - 20px);
    min-width: 340px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.product-name {
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    color: #e4393c;
    font-size: 18px;
    font-weight: bold;
}

.product-views {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url(../images/click.png) no-repeat;
}

/* 响应式适配 */
@media (max-width: 1199px) {
    .recommend-section {
        width: 95%;
    }
}

@media (max-width: 767px) {
    .recommend-section {
        padding: 20px;
    }
    
    .product-card {
        min-width: 280px;
    }
    
    .product-thumb {
        height: 180px;
    }
}

@media (max-width: 479px) {
    .recommend-section {
        width: 100%;
        border-radius: 0;
        margin: 20px 0;
    }
    
    .section-title h2 {
        font-size: 18px;
    }
    
    .carousel-controls button {
        width: 30px;
        height: 30px;
    }
}

/* 商品列表样式 */

.main-container {
    width: 1140px;
    margin: 0 auto;
    padding: 8px 0;
}

/* 搜索筛选 */
.filter-group {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-label {
    color: #666;
    font-size: 14px;
    min-width: 80px;
    padding-top: 6px;
}

.filter-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
}

.filter-list li {
    padding: 8px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

/* 非活动项样式 */
.filter-list li:not(.active):hover {
    border-color: #e4393c;
    color: #e4393c;
}

/* 活动项样式 */
.filter-list li.active {
    background: #e4393c;
    color: #fff;
    border-color: #e4393c;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(228,57,60,0.2);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .filter-group {
        flex-direction: column;
    }
    
    .filter-label {
        margin-bottom: 12px;
    }
    
    .filter-list {
        width: 100%;
    }
    
    .filter-list li {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .filter-list li {
        flex: 1 0 45%;
        margin-bottom: 8px;
    }
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    width: 1140px;
    margin: 0 auto;
    padding: 20px 0;
}

.product-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

/* 修改图片相关样式 */
.image-container {
    width: 100%;
    height: 240px; /* 保持容器高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.image-container img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 关键修改 */
    transition: transform 0.3s;
}

.product-item:hover img {
    transform: scale(1.05);
}

/* 响应式适配调整 */
@media (max-width: 768px) {
    .image-container {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .image-container {
        height: 180px;
    }
}


.product-item:hover {
    transform: translateY(-3px);
}

.product-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.product-item h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    color: #e4393c;
    font-size: 18px;
    font-weight: bold;
}

.views {
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    /* 修改这两行 */
    width: 100%;
    max-width: 1140px;
    /* 保持这行 */
    margin: 0 auto;
}

.pagination a, .pagination span {
    display: block;
    padding: 8px 15px;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #f8f8f8;
}

.pagination .active {
    background: #e4393c;
    color: #fff;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .product-grid {
        gap: 20px;
    }
    
    .product-item img {
        height: 200px;
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .filter-group span {
        width: 100%;
        margin-bottom: 10px;
    }
}