/* 首页 Banner */
.home-banner {
    text-align: center;
    position: relative;
}

.home-banner img {
    max-width: 100%;
    aspect-ratio: 16 / 9;
}

.home-banner a {
    position: absolute;
    top: 0;
    top: 88px;
    left: 50%;
    transform: translateX(-50%);
}

.home-banner a img {
    aspect-ratio: auto;
    width: 900px;
}

.home-banner h1 {
    margin: 20px 0 10px;
}

.home-banner p {
    color: #666;
}

/*Collection区域=============================*/
.home-collection {
    padding: 40px 0;
}

.home-collection h1 {
    text-align: center;
}

/* 视口：默认裁剪不滚（PC），移动端会开启横向滚动 */
.collection-viewport {
    overflow: hidden;
}

/* 轨道：纯 flex 布局，不负责滚动（移动端 overflow 在 viewport） */
.collection-track {
    display: flex;
    gap: 24px;
    transition: transform 0.3s ease;
    will-change: transform;
    box-sizing: border-box;
}

/* 每个 item：规范计算并避免子元素撑开 */
.collection-item {
    flex: 0 0 calc((100% - 72px) / 4);
    /* 24px gap x 3 = 72px */
    box-sizing: border-box;
    min-width: 0;
    /* 防止内部内容撑大导致溢出 */
}

.collection-item a {
    text-decoration: none;
}

/* 图片容器 */
.collection-item .img-wrap {
    overflow: hidden;
    border-radius: 8px;
}

.collection-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.collection-item .btn-collection {
    text-align: left;
    margin: 12px 0;
    color: #000;
    transition: color 0.3s ease;
    font-size: 16px;
    line-height: 20px;
    max-height: 20px;

    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collection-item:hover .btn-collection {
    text-decoration: underline;
}

/* 分页条 */
.collection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.collection-controls .progress-bar {
    flex: 1;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-right: 16px;
    overflow: hidden;
}

.collection-controls .progress-bar .progress {
    display: block;
    height: 100%;
    background: #333;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.collection-controls .pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collection-controls .pager button {
    border: none;
    width: 20px;
    height: 20px;
    background: #F2F2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.collection-controls .pager button img {
    width: 6px;
}

.collection-controls .pager button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* 移动端一屏约 1.5 个并开启 scroll-snap。
   关键点：滚动由 .collection-viewport 控制（而不是 .collection-track） */
@media (max-width: 768px) {

    .home-collection {
        padding: 20px 15px;
    }

    /* 视口负责横向滚动，隐藏滚动条并启用平滑触摸 */
    .collection-viewport {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
    }

    .collection-viewport::-webkit-scrollbar {
        display: none;
    }

    /* 轨道不需要 overflow */
    .collection-track {
        gap: 16px;
    }

    /* 每个卡片约 66.666% 宽 （≈ 1.5 个）并启用 snap */
    .collection-item {
        flex: 0 0 66.666%;
        scroll-snap-align: start;
    }

    .collection-controls {
        display: none;
    }

    .collection-item:hover img {
        transform: scale(1);
        box-shadow: none;
    }
}
/*Collection区域========================End*/

/*评论区域=========================*/
.re-container {
    display: flex;
    gap: 20px;
    padding: 40px 0;
}

.review-info-pc,
.review-info-m {
    color: #000;
    display: block;
    text-decoration: underline;
}

.review-info-pc img,
.review-info-m img {
    width: 10px;
    height: 10px;
    margin-left: 5px;
    margin-top: -2px;
}

.review-info-m {
    display: none;
}

.re-container .left {
    width: 30%;
    height: 300px;
    padding-top: 13px;
}

.re-container .right {
    width: 70%;
}

/* 图片区域：外层容器裁切，内层 track 用 transform 滑动 */
.img-container {
    position: relative;
}

.img-list {
    display: flex;
    gap: 10px;
    overflow-x: hidden;
    scrollbar-width: none;
}

.img-list::-webkit-scrollbar {
    display: none;
}

.img-list img {
    flex: 0 0 auto;
    width: 384px;
    aspect-ratio: 1 / 1;
    opacity: .5;
    transition: opacity .35s ease;
}

.img-list img.active {
    opacity: 1;
}

/* 滚动条 & 按钮 */
.scrollbar-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-top: 10px;
    height: 40px;
    gap: 10px;
}

.custom-scrollbar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 3px;
    position: relative;
    display: block;
    overflow: hidden;
}

.scroll-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-buttons .prev,
.scroll-buttons .next {
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    background: #F2F2F2;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background-color: #F2F2F2;
}

.scroll-buttons .prev img,
.scroll-buttons .next img {
    width: 6px;
}

.custom-scrollbar .scrollbar {
    width: 14.2857%;
    /* 初始占比 1/7 */
    height: 100%;
    background: #333;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
    transition: all .3s ease-in-out;
}

/* 文字动画初始状态 */
.left .xingxing,
.left .title,
.left .text,
.left .name {
    color: #000;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.45s ease;
}

/* 有 enter 时的状态 */
.left .enter {
    opacity: 1;
    transform: translateX(0);
}

.left .xingxing {
    font-size: 16px;
}

.left .title {
    font-weight: 600;
    font-size: 24px;
}

.left .text {
    font-weight: 400;
    font-size: 16px;
    color: #222222;
    line-height: 26px;
    margin: 6px 0 12px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    overflow: hidden;
}

.left .h-title {
    margin-bottom: 8px;
    font-weight: 400;
    font-size: 16px;
    color: #222222;
    line-height: 19px;
}

.h-title-M {
    display: none;
    font-weight: 600;
    font-size: 24px;
    color: #222222;
    line-height: 29px;
    text-align: center;
}

.scrollbar-m {
    display: none;
}

@media screen and (max-width: 768px) {
    .re-container {
        padding: 20px 15px;
        flex-direction: column;
    }

    .scrollbar-pc {
        display: none;
    }

    .scrollbar-m {
        display: block;
        order: 3;
    }

    .scroll-buttons {
        display: none;
    }

    .review-info-pc {
        display: none;
    }

    .review-info-m {
        display: block;
        text-align: center;
    }


    .re-container .left,
    .re-container .right {
        width: 100%;
        padding: 0;
    }

    .re-container .left {
        height: auto;
        order: 2;
        width: 100%;
        overflow: hidden;
    }

    .re-container .right {
        order: 1;
    }

    .left .text {
        max-height: 180px;
        -webkit-line-clamp: 4;
    }

    .img-list img {
        width: 100%;
    }

    .left .h-title {
        display: none;
    }

    .h-title-M {
        display: block;
    }
}

/* 新品发布区域======================= */
.new-container {
    display: flex;
    gap: 24px;
    overflow: hidden;
}

#new-app .new-banner {
    margin-bottom: 20px;
    position: relative;
}

#new-app .new-banner .new-banner-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -10%);
    color: #fff;
    text-align: center;
    width: 80%;
}

#new-app .new-banner .new-banner-text h2 {
    font-size: 46px;
}

#new-app .new-banner .new-banner-text p {
    font-size: 26px;
}

#new-app .collection-item {
    display: flex;
    gap: 16px;
    border: 2px solid #f3f3f3;
    padding: 10px 16px;
    text-decoration: none;
}

#new-app .collection-item .img {
    overflow: hidden;
    width: 140px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

#new-app .collection-item .info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#new-app .collection-item .info h4 {
    margin: 10px 0;
    font-size: 12px;
    color: #000000;
    line-height: 20px;
    max-height: 40px;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
}


#new-app .collection-item .info .price {
    color: #CE2226;
}

#new-app .collection-item .info .price ins {
    color: #CE2226;
}

#new-app .collection-item .info button {
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    margin-top: auto;
    margin-bottom: 15px;
}

@media (max-width: 1439px) {
    #new-app .collection-item .img {
        width: 100px;
    }
}

@media (max-width: 1023px) {
    #new-app .collection-item {
        flex: 0 0 40%;
    }

    #new-app .new-banner .new-banner-text h2 {
        font-size: 24px;
    }

    #new-app .new-banner .new-banner-text p {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    #new-app .collection-item .img {
        width: 80px;
    }

    #new-app .collection-item {
        flex: 0 0 80%;
    }
}

/* 新品发布区域=====================END */

/* 本周促销==================== */
.home-promotion {
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.home-promotion .promotion-viewport {
    flex: 0 0 20%;
}

.home-promotion .promotion-viewport .promotion-time {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    background: #FEEBEB;
    border-radius: 20px;
    padding: 4px 8px;

}

.home-promotion .promotion-viewport .promotion-time .time {
    width: 115px;
}

.home-promotion .promotion-viewport .promotion-time .clock {
    width: 16px;
}

.home-promotion .promotion-product {
    flex: 0 0 80%;
}

.home-promotion .promotion-viewport .btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.home-promotion .promotion-viewport .btn img {
    width: 16px;
}

@media screen and (max-width: 768px) {
    .home-promotion {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 15px;
    }

    .home-promotion .promotion-viewport,
    .home-promotion .promotion-product {
        flex: 1;
        width: 100%;
    }

    .home-promotion .promotion-viewport {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 0 10px 0;
    }

    .home-promotion .promotion-viewport h1 {
        margin: 0 0 10px 0;
    }

    .home-promotion .promotion-viewport p {
        margin: 0 0 10px 0;
        text-align: center;
    }

    .home-promotion .promotion-viewport .promotion-time {
        width: auto;
        justify-content: center;
    }
}

/* 本周促销=================END */

/* 布料区域================= */
.swatch {
    padding: 40px 0;

}

.swatch .swatch-viewport {
    position: relative;
}

.swatch .swatch-viewport .swatch-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    width: 80%;
}

.swatch .swatch-viewport img:nth-child(2) {
    display: none;
}

.swatch .swatch-viewport .swatch-text h2 {
    font-size: 46px;
}

.swatch .swatch-viewport .swatch-text p {
    font-size: 26px;
}

.swatch .swatch-viewport .swatch-text .btn {
    display: inline-block;
    margin: 20px auto;
    padding: 10px 40px;
    border-radius: 20px;
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
    box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

@media screen and (max-width: 768px) {
    .swatch {
        padding: 20px 15px;
    }

    .swatch .swatch-viewport img:nth-child(1) {
        display: none;
    }

    .swatch .swatch-viewport img:nth-child(2) {
        display: block;
    }

    .swatch .swatch-viewport .swatch-text h1 {
        font-size: 24px;
        margin: 0 0 10px 0;
    }

    .swatch .swatch-viewport .swatch-text p {
        display: none;
        font-size: 16px;
        margin: 0 0 10px 0;
    }

    .swatch .swatch-viewport .swatch-text .btn {
        margin: 10px auto;
        padding: 8px 20px;
        font-size: 12px;
    }
}

.home-service {
    padding: 40px 30px;
}

.home-service h1 {
    text-align: center;
}

.home-service .service-viewport {
    display: flex;
    flex-direction: row;
    gap: 16%;
    justify-content: center;

}

.home-service .service-viewport .service-item {
    text-align: center;
}

.home-service .service-viewport .service-item img {
    width: 64px;
    height: 64px;
}

.home-service .service-viewport .service-item h4 {
    margin: 12px 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.home-service .service-viewport .service-item p {
    margin: 0;
    font-size: 14px;
}

@media screen and (max-width: 768px) {
    .home-service {
        padding: 20px 15px;
    }

    .home-service h1 {
        font-size: 24px;
        margin: 0 0 20px 0;
    }

    .home-service .service-viewport {
        gap: 20px;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .home-service .service-viewport .service-item {
        flex: 0 0 60%;
    }

}

/* 布料区域==============END */

/* 视频区域 */
.home-video{
    padding: 40px 0;
    text-align: center;
}
/* --- 容器样式 --- */
.gallery-container {
    display: grid;
    gap: 10px;
    margin: 0 auto;

    /* PC端核心修正： */
    /* 1. 设置5列，但中间列（2fr）比两边（1fr）宽，符合图1视觉 */
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr;

    /* 2. 行高固定，保证对齐 */
    grid-auto-rows: 200px;
}

/* --- 图片通用样式 --- */
.gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* --- 核心：指定第5张图为“C位大图” --- */
/* 原理：Grid布局中，只要定死了这张图的位置，
           浏览器会自动把剩下的图填到剩下的格子里 (1,2,4,6,7,8,9...)
        */
.gallery-item:nth-child(5) {
    /* 放在第3列 */
    grid-column: 3 / 4;
    /* 跨越2行 */
    grid-row: 1 / 3;
}

/* --- 移动端适配 (参考图2) --- */
@media (max-width: 768px) {
    .home-video{
        padding: 20px 15px;
    }
    .gallery-container {
        /* 变为3列布局 */
        grid-template-columns: repeat(3, 1fr);
        /* 移动端行高稍小 */
        grid-auto-rows: 150px;
    }

    /* 移动端大图样式调整 */
    .gallery-item:nth-child(5) {
        /* 根据图2：大图在第二行，占据左侧 2/3 的宽度 
                   Grid 自动流会将它排在第4个位置左右
                */
        grid-column: 3 / 4;
        grid-column: span 2;
        /* 占据2列 */
        grid-row: span 2;
        /* 占据2行 */

        /* 如果你想强制它在视觉上处于特定位置，可以用 order */
        order: 4;
    }

    .gallery-item:nth-child(1) {
        order: 1;
    }

    .gallery-item:nth-child(2) {
        order: 2;
    }

    .gallery-item:nth-child(3) {
        order: 3;
    }

    .gallery-item:nth-child(4) {
        order: 5;
    }

    .gallery-item:nth-child(6) {
        order: 6;
    }

    .gallery-item:nth-child(7) {
        order: 7;
    }

    .gallery-item:nth-child(8) {
        order: 8;
    }

    .gallery-item:nth-child(9) {
        order: 9;
    }
}

/* 视频区域================END */