.sec-work .content-wrp {
    padding-top: 144px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
}
.sec-work .content-wrp .content-upper {
    max-width: unset;
    width: 100%;
}
.sec-work .title-sec {
    grid-column: 1 / 5;
    margin-bottom: 40px;
    text-align: center;
    color: var(--light-grey);
}
.sec-work .content-wrp .workFilter-list {
    display: none;
    opacity: 0;
    z-index: -1;
    grid-column: 8 / 13;
    line-height: 1.3;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
}

.sec-work .content-wrp .works-list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0;
    grid-column: 1 / 13;
}
.work-item {
    position: relative;
}
.work-item .work-item-img-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    overflow: hidden;
    background-color: var(--grey);
}
.work-item:nth-child(even) .work-item-img-box {
    background-color: #252525;
}
.work-item-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.work-item .work-item-title {
    padding: 0 2% 48px;
    line-height: 1.3;
    font-size: var(--fs-lg);
    color: var(--black);
    font-weight: 100;
}
.work-item .work-item-title span {
    padding: 8px;
    display: inline-block;
    margin-top: -15%;
    background-color: #ABCD05;
    font-weight: 600;
}

.sec-detail {
    width: 100vw;
    height: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: var(--black);
    transition: height .3s ease-in-out;
    overflow: hidden;
    margin-bottom: 0 !important;
}
.sec-detail.active {
    z-index: 1;
    height: 100vh;
}
.sec-detail .content-wrp {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}
.work-detail-info-container {
    column-gap: 48px;
    position: relative;
    top: 128px;
}
.sec-detail .actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    font-size: 2vh;
    display: flex;
    width: fit-content;
    text-align: start;
    gap: 24px;
    padding-top: 3.5vh;
    margin: auto;
}
.sec-detail .actions .btn {
    background: none;
    height: 40px;
    cursor: pointer;
    color: var(--grey);
    border: none;
    font-size: 16px;
    display: inline-flex;  
    align-items: center;   
}
.sec-detail .title-detail {
    width: fit-content;
    margin: 0 24px;
    left: 0;
    display: block;
    background-color: #000000;
    padding: 16px;
    font-size: 16px;
    color: var(--light-grey);
    z-index: 2;
    box-sizing: border-box;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: calc(100vw - 48px);
}
.work-detail-list {
    display: flex;
    gap: 80px;
    justify-content: center;
    padding-left: 24px;
    box-sizing: border-box;
    text-align: start;
    bottom: 24px;
    left: 0;
    width: 100%;
    padding-top: 3.5vh;
}

.work-detail-item-label {
    font-size: 16px;
    text-transform: lowercase;
    margin-bottom: 8px;
    line-height: 1;
}
.work-detail-item-label span {
    background-color: #ABCD05; 
    padding: 4px;
}
.work-detail-item-info {
    font-size: 2vh;
    font-weight: 600;
}

/* 🌟 縮圖列表容器 */
.work-detail-imgs-list {
    /* align-items: flex-end; */
    align-items: center;
    height: 12vh; 
    width: 100%;
    max-height: calc(100vh - 144px - 40px);
    display: flex;
    column-gap: 24px; 
    overflow-x: auto; 
    overflow-y: hidden; /* 🎯 阻止縱向干擾 */
    scrollbar-width: none;
    box-sizing: border-box;
    padding-left: 50%;
    padding-right: 50%;
    overscroll-behavior-x: contain; 
    -webkit-overflow-scrolling: touch; 
    
    /* 🎯 【修復】改用 proximity 避免邊界強行 Snap 卡死 */
    scroll-snap-type: x proximity; 
}

.work-detail-imgs-list::-webkit-scrollbar {
    display: none;
}

/* 🌟 縮圖 Item */
.work-detail-img-thumbnail {
    display: block;
    height: 100%;
    cursor: pointer;
    flex-shrink: 0; 
    scroll-snap-align: center; 
    /* 🎯 【修復】移除 scroll-snap-stop: always，防止手勢被鎖死在第 2 張 */
}

/* 🌟 縮圖內膽 */
.work-detail-img-thumbnail .img-wrapper {
    height: 100%;
    position: relative;
    /* transform-origin: bottom center;  */
    transform-origin: center; 
    z-index: 1;
    will-change: transform, opacity;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.25s linear;
}

.work-detail-img-thumbnail .img-wrapper img {
    filter: brightness(50%);
}

.work-detail-img-thumbnail img {
    height: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
    object-fit: cover; 
    pointer-events: none; 
    border-radius: 4px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
}

.work-detail-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 992px) {
    .sec-work .content-wrp {
        padding-top: 96px;
        display: block;
    }
    .work-item .work-item-title {
        font-size: 16px;
    }

    .work-detail-img-thumbnail img {
        width: 100%;
    }
}

/* Tablet */
@media (min-width: 426px) {
    .sec-work .content-wrp .works-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stacked-txt-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 0.75;
    position: absolute;
    top: 50%;
    opacity: .05;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    max-width: 100vw;
    overflow: hidden;
}

.text-row {
    font-size: 30vh;
    font-weight: 900;
    letter-spacing: 2px;
    position: relative;
    text-transform: uppercase;
    color: white;
    white-space: nowrap;
    line-height: .8;
}

.text-row:not(.layer-center) {
  -webkit-text-stroke: 2px white;
}

.row-2 {
    clip-path: inset(45% 0% 0% 0%);
    transform: scaleY(0.9);
    transform-origin: top center;
    opacity: 0.9;
    margin-top: -6vh;
}
.row-3 {
    clip-path: inset(60% 0% 0% 0%);
    transform: scaleY(0.8);
    transform-origin: top center;
    opacity: 0.7;
    margin-top: -11vh;
}
.row-4 {
    clip-path: inset(70% 0% 0% 0%);
    transform: scaleY(0.8);
    transform-origin: top center;
    opacity: 0.5;
    margin-top: -16vh;
}
.row-5 {
    clip-path: inset(80% 0% 0% 0%);
    transform: scaleY(0.8);
    transform-origin: top center;
    opacity: 0.3;
    margin-top: -18vh;
}
.row-6 {
    clip-path: inset(90% 0% 0% 0%);
    transform: scaleY(0.8);
    transform-origin: top center;
    opacity: .3;
    margin-top: -20vh;
}

/* 主畫面容器 */
.work-detail-img-box {
    position: relative;
    width: 100%;
    height: 50vh;
    overflow: hidden;
    border-radius: 12px;
    grid-column: 4 / 10;
    padding: 24px 24px 32px;
    box-sizing: border-box;
}

.work-detail-img-box img,
.work-detail-img-box video,
.work-detail-img-box iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-text-stroke: 1px black;
    text-stroke: 1px black;
}

.work-detail-img-thumbnail.active .img-wrapper img {
    filter: none;
}

/* 🎬 Video Modal Container */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.video-modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-body iframe,
.video-modal-body video {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    outline: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.ys button.video-modal-close {
    position: absolute;
    top: 24px;
    right: 16px;
    background: none;
    border: none;
    color: #000;
    background: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    z-index: 1;
    transition: transform 0.2s ease;
    padding: 2px 16px;
}

.video-modal-close:hover {
    transform: scale(1.2);
}

/* DESKTOP */
@media (min-width: 993px) {
    .sec-work .content-wrp .content-upper {
        display: grid;
        grid-column: 1 / 13;
        grid-template-columns: repeat(12, 1fr);
    }
    .sec-work .title-sec {
        grid-column: 1 / 5;
        text-align: start;
        margin-bottom: 64px;
    }

    .sec-work .content-wrp .workFilter-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        column-gap: 64px;
    }
    .sec-work .content-wrp .works-list {
        grid-template-columns: repeat(3, 1fr);
    }
    .work-detail-info-container {
        column-gap: 48px;
        top: 48%;
        left: 50%;
        transform: translate(-50%, -50%);
        position: relative;
        top: 50%;
        height: 60vh;
    }
    .sec-detail .title-detail {
        width: auto;
        position: absolute;
        bottom: calc(100% + 24px);
        font-size: 3.2vh;
        margin-left: 0;
        left: 50%;
        transform: translate(-50%, 0);
        background-color: #000000;
        padding: 16px 32px;
        color: var(--light-grey);
        z-index: 2;
        box-sizing: border-box;
        text-wrap: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        text-align: center;
        max-width: calc(100vw - 96px);
    }

    .work-detail-imgs-list {
        height: 60vh; 
        width: 100%;
        max-height: calc(100vh - 144px - 40px);
    }
    .work-detail-img-thumbnail {
        height: 40%;  
        width: 35.5vh; 
    }
    .work-detail-img-thumbnail.active .img-wrapper img {
        filter: none;
        width: auto;
        object-fit: contain;
        max-width: 100%;
    }
    .work-detail-img-thumbnail.active .img-wrapper {
        transform: scale(2.5); 
        z-index: 10; 
    }

    .work-detail-img-thumbnail img {
        width: 100%;
    }

    .work-detail-imgs-list:has(.work-detail-img-thumbnail.active) .work-detail-img-thumbnail:has(~ .active) .img-wrapper {
        transform: translateX(-27vh);
    }
    .work-detail-img-thumbnail.active + .work-detail-img-thumbnail .img-wrapper,
    .work-detail-img-thumbnail.active + .work-detail-img-thumbnail ~ .work-detail-img-thumbnail .img-wrapper {
        transform: translateX(27vh);
    }

    .work-detail-img-box img,
    .work-detail-img-box video,
    .work-detail-img-box iframe {
        object-fit: cover;
    }

    .sec-detail .actions {
        position: static;
        gap: 24px;
    }

    .sec-detail .actions .btn {
        font-size: 2vh;
    }

    .ys button.video-modal-close {
        top: 24px;
        right: 32px;
        font-size: 36px;
        padding: 2px 16px;
    }
}

.sec-detail.active {
    height: 100vh;
    height: 100dvh;
}

.sec-detail .content-wrp {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
}

/* 📱 手機版調整 */
@media (max-width: 992px) {
    .work-detail-info-container {
        top: 0 !important;
        transform: none !important;
        padding-top: 128px; 
        padding-bottom: 90px; 
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        box-sizing: border-box;
    }

    .sec-detail .title-detail {
        margin: 0 auto 16px auto !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        max-width: 90vw !important;
        font-size: 18px;
    }

    .work-detail-img-box {
        width: 100% !important;
        height: 38vh !important; 
        max-height: 350px;
        padding: 0 16px !important;
        margin-bottom: 24px;
        grid-column: auto !important;
    }

    /* 🎯 【修復】精準計算Padding，保證第1同最後1個Item可以精準居中同滾動返去 */
    .work-detail-imgs-list {
        height: 70px !important; 
        width: 100% !important;
        margin-bottom: 16px;
        padding-left: calc(50vw - 35px) !important;
        padding-right: calc(50vw - 35px) !important;
        scroll-snap-type: x proximity !important; 
    }

    .work-detail-img-thumbnail {
        height: 100% !important;
        width: auto !important;
    }

    .work-detail-img-thumbnail .img-wrapper img {
        height: 100% !important;
        width: auto !important;
        max-height: 70px;
    }

    .sec-detail .actions {
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%);
        width: 100%;
        justify-content: center;
        z-index: 10;
        background: linear-gradient(to top, rgba(0,0,0,0.9) 70%, transparent);
        padding: 12px 0 !important;
        margin: 0 !important;
    }
}