.works-page {
    background: #f7f7f7;
    min-height: 100vh;
    padding: 0 0 220px;
}

.works-inner {
    width: 94vw;
    max-width: 1800px;
    margin: 0 auto;
}

.works-header {
    padding: 0 0 78px;
}

.works-back {
    display: inline-flex;
    align-items: center;
}

.works-header-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-search {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.search-input {
    appearance: none;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    padding: 10px 46px 10px 18px;
    font-size: .95rem;
    color: #111827;
    background: #fff;
    outline: none;
    width: 320px;
    transition: border-color .2s, box-shadow .2s;
}

.search-input::placeholder {
    color: #7f86c9;
    font-weight: 300;
    opacity: .85;
}

.search-input:focus {
    border-color: #7f86c9;
    box-shadow: 0 0 0 2px rgba(127,134,201,.15);
}

.search-btn {
    position: absolute;
    right: 12px;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 6px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.search-btn:hover {
    color: #7f86c9;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 6px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.search-clear-btn:hover {
    color: #6b7280;
}

.search-input.has-value {
    padding-right: 76px;
}

.search-input.has-value ~ .search-btn {
    right: 34px;
}

.works-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 400;
    color: #1f2937;
}

.works-years {
    font-size: 1.05rem;
    color: #b3b9c3;
    letter-spacing: .02em;
}

.filters {
    padding: 0 0 24px;
}

.filter-row {
    display: flex;
    align-items: baseline;
    gap: 44px;
    padding: 8px 0;
}

.filter-label {
    width: 44px;
    color: #111827;
    font-size: .92rem;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 18px;
    min-width: 0;
    flex: 1;
}

.filter-btn {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: .92rem;
    color: #111827;
    cursor: pointer;
    text-underline-offset: 6px;
}

.filter-row[data-kind=sessions] .filter-btn {
    font-weight: 400;
}

    .filter-row[data-kind=sessions] .filter-btn:not(.active) {
        color: #a3a9b4;
    }

.filter-row[data-kind=awards] .filter-btn.active, .filter-row[data-kind=categories] .filter-btn.active {
    color: #7f86c9;
    
}

.divider {
    display: none;
}

.filter-options > .filter-btn {
    margin-right: 0;
}

.filter-options > .filter-btn:last-of-type {
    margin-right: 0;
}

.filter-options > .filter-btn:not(:last-of-type)::after {
    content: "|";
    color: #cdd2db;
    font-weight: 300;
    margin: 0 26px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 56px;
    margin-top: 28px;
}

.work-card {
    background: #fff;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,.04);
    box-shadow: none;
    cursor: pointer;
    overflow: hidden;
}

    .work-card.is-hidden {
        display: none !important;
    }

.work-image {
    flex: 0 0 auto;
    min-height: 0;
    background: #e5e7eb;
    overflow: hidden;
    aspect-ratio: 7 / 4;
}

    .work-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        opacity: 0;
        transition: opacity .4s ease, transform .4s ease;
    }

    .work-image:hover img {
        transform: scale(1.08);
    }

.work-meta {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

.work-name {
    margin: 0;
    font-size: .95rem;
    font-weight: 400;
    color: #111827;
    white-space: normal;
}

.meta-block {
    margin-top: 0;
    color: #4b5563;
    font-size: .88rem;
    line-height: 1.7;
    white-space: normal;
}

body.detail-open {
    overflow: hidden;
}

.work-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px,4vw,80px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease,visibility .25s ease;
    background: #dcdcdc40;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    --detail-frame-height: auto;
}

    .work-detail-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.work-detail-panel {
    position: relative;
    z-index: 1;
    width: min(1400px,92vw);
    max-height: calc(100vh - 140px);
    overflow: hidden;
    margin-top: clamp(6px,2vh,24px);
}

.work-detail-close {
    position: fixed;
    top: calc((var(--header-height, 94px) - 46px) / 2);
    right: calc((100vw - min(1800px,94vw))/2);
    width: 46px;
    height: 46px;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #7f86c9;
    transition: color .2s ease;
    /* 强制独立合成层，规避父级 backdrop-filter 的影响 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.work-detail-close:hover,
.work-detail-close:focus-visible {
    color: #f7a35c;
    outline: none;
}

.work-detail-close svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.work-detail-body {
    display: grid;
    grid-template-columns: clamp(240px,28vw,360px) minmax(0,1fr);
    gap: clamp(20px,4vw,64px);
    align-items: start;
    min-height: 0;
}

.work-detail-info {
    display: flex;
    flex-direction: column;
    gap: 26px;
    color: #5b616b;
    font-size: .93rem;
    line-height: 2;
    min-height: 0;
    height: var(--detail-frame-height);
    max-height: var(--detail-frame-height);
}

.detail-text-block {
    flex: 1 1 auto;
    max-height: min(520px,62vh);
    overflow-y: auto;
    padding-right: 24px;
    border-right: 1px solid rgba(0,0,0,.28);
    font-weight: 300;
    scrollbar-width: none;
}

    .detail-text-block::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

.detail-lead {
    margin: 0 0 26px;
    font-size: .94rem;
    color: #4b5563;
}

.detail-text {
    color: #4b5563;
    white-space: pre-line;
    font-weight: 300;
    word-break: break-word;
    line-height: 1.85;
}

    .detail-text p {
        margin: 0 0 18px;
    }

    .detail-text p:last-child {
        margin-bottom: 0;
    }

.detail-meta p {
    margin: 0;
    color: #4b5563;
    font-size: .92rem;
    line-height: 1.7;
    word-break: break-word;
}

.detail-meta span {
    color: #2b2b2b;
    margin-right: 6px;
}

.detail-meta {
    display: grid;
    gap: 12px;
    margin-top: auto;
}

    .detail-meta strong {
        font-weight: 500;
        color: #2b2b2b;
    }

.work-detail-media {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-items: start;
    gap: clamp(12px,2vw,24px);
    min-width: 0;
    justify-self: stretch;
}

.detail-frame {
    position: relative;
    background: #fff;
    padding: clamp(24px,4vw,48px);
    box-shadow: 0 20px 60px #00000014;
    max-width: 100%;
    width: min(760px,100%);
    aspect-ratio: 7 / 5;
    height: var(--detail-frame-height);
    min-width: 0;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .detail-frame img {
        display: block;
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: contain;
    }

.work-detail-swiper {
    width: 100%;
    height: 100%;
    /* 切断 swiper-wrapper(loop 模式下 N×slide 宽)反向撑大容器的反馈链 */
    min-width: 0;
    overflow: hidden;
}

.work-detail-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.work-detail-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.work-detail-swiper .swiper-slide-video {
    position: relative;
    cursor: pointer;
}

.work-detail-swiper .swiper-slide-video video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    pointer-events: none;
}

.video-play-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}

.thumb-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

.thumb-video-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 4px 0 4px 7px;
    border-color: transparent transparent transparent #fff;
}

.work-detail-swiper .swiper-button-prev,
.work-detail-swiper .swiper-button-next {
    color: #7f86c9;
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-detail-swiper:hover .swiper-button-prev,
.work-detail-swiper:hover .swiper-button-next {
    opacity: 1;
}

.work-detail-swiper .swiper-button-prev::after,
.work-detail-swiper .swiper-button-next::after {
    font-size: 18px;
}

.work-detail-swiper .swiper-pagination {
    bottom: 8px;
}

.work-detail-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #7f86c9;
    opacity: 0.4;
}

.work-detail-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

.work-detail-swiper:not(.has-multiple) .swiper-button-prev,
.work-detail-swiper:not(.has-multiple) .swiper-button-next,
.work-detail-swiper:not(.has-multiple) .swiper-pagination {
    display: none;
}

.detail-thumbs {
    width: 100%;
    max-width: min(760px,100%);
    justify-self: center;
    margin-top: 12px;
    position: relative;
    /* 超出 slide 裁切；左右按钮 absolute 定位不超出此容器 */
    overflow: hidden;
    padding: 0 36px;
}

.work-detail-thumbs {
    width: 100%;
    padding: 4px 0;
}

.work-detail-thumbs .swiper-slide {
    width: 80px;
    height: 80px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    opacity: 0.6;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    position: relative;
    background: #f3f4f6;
    box-sizing: border-box;
}

.work-detail-thumbs .swiper-slide:hover {
    opacity: 0.9;
}

.work-detail-thumbs .swiper-slide-thumb-active {
    border-color: #7f86c9;
    opacity: 1;
}

.work-detail-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 2px;
}

/* 缩略图左右切换按钮（absolute 在 .detail-thumbs 容器两侧，避开缩略图本体） */
.thumbs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f86c9;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
    padding: 0;
}
.thumbs-nav:hover {
    background: #7f86c9;
    color: #fff;
}
/* Swiper 11 在已到边界时会给按钮加 .swiper-button-disabled */
.thumbs-nav.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}
.thumbs-prev { left: 0; }
.thumbs-next { right: 0; }

.thumbs-prev::after,
.thumbs-next::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}
.thumbs-prev::after { transform: rotate(-135deg); margin-left: 2px; }
.thumbs-next::after { transform: rotate(45deg); margin-right: 2px; }

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
 
}

.lightbox-image {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-video {
    max-width: 95vw;
    max-height: 90vh;
    display: none;
    outline: none;
    background: #000;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 210;
}

.lightbox-close:before,
.lightbox-close:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: #fff;
}

.lightbox-close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    z-index: 210;
    transition: background 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:before,
.lightbox-next:before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
}

.lightbox-prev:before {
    transform: translate(-30%, -50%) rotate(45deg);
}

.lightbox-next:before {
    transform: translate(-70%, -50%) rotate(-135deg);
}

.lightbox-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 210;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 6px 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    line-height: 1;
    font-family: inherit;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-original {
    font-size: 13px;
    letter-spacing: 0.5px;
}

@media(max-width:1024px) {
    .work-detail-panel {
        padding-right: 0;
    }

    .work-detail-body {
        grid-template-columns: 1fr;
    }

    .detail-text-block {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,.25);
        padding-right: 0;
        padding-bottom: 24px;
        max-height: none;
    }

    .detail-frame img {
        max-width: min(720px,90vw);
    }

    .work-detail-media {
        grid-template-columns: 1fr;
    }

    .work-detail-info {
        height: auto;
        max-height: none;
    }

    .detail-meta {
        margin-top: 0;
    }

    .detail-frame {
        height: auto;
    }
}

@media(max-width:1024px) {
    .works-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media(max-width:1024px) and (min-width:641px) {
    .work-meta {
        padding: 10px 14px 14px;
        gap: 6px;
    }

    .work-name {
        font-size: .88rem;
    }

    .meta-block {
        font-size: .8rem;
        line-height: 1.5;
    }

    .works-grid {
        gap: 28px;
    }
}

@media(max-width:768px) {
    .works-page {
        padding-top: 22px;
    }

    .works-header {
        padding-bottom: 38px;
    }

    .divider {
        display: none;
    }

    .filter-row {
        gap: 16px;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }
}

@media(max-width:640px) {
    .work-meta {
        padding: 10px 14px 14px;
        gap: 6px;
    }

    .work-name {
        font-size: .9rem;
    }

    .meta-block {
        font-size: .82rem;
        line-height: 1.5;
    }

    .works-grid {
        gap: 18px;
    }

    .filter-row {
        gap: 10px;
    }

    .filter-row .filter-label {
        font-size: .85rem;
        width: 36px;
    }

    .filter-btn {
        font-size: .85rem;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
    }

    .work-detail-overlay {
        padding: 12px;
    }

    /* 移动端关闭按钮贴近视口右上角，避免叠在 header 上 */
    .work-detail-close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }

    /* 移动端弹窗允许垂直滚动；用 svh 避免地址栏伸缩时面板高度超出可见区 */
    .work-detail-panel {
        max-height: calc(100vh - 24px);
        max-height: calc(100svh - 24px);
        overflow-y: auto;
        margin-top: 0;
    }

    .work-detail-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* info 区域高度自适应，不被 --detail-frame-height 影响；
       右侧留出关闭按钮的空间，避免文字被按钮遮挡 */
    .work-detail-info {
        height: auto !important;
        max-height: none !important;
        gap: 18px;
        padding-right: 50px;
    }

    /* 文字块限制高度可滚动，避免撑高 body */
    .detail-text-block {
        max-height: 220px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,.25);
        padding-right: 0;
        padding-bottom: 16px;
    }

    /* detail-frame 给定确定高度；用 svh 避免大图底部被地址栏遮挡 */
    .detail-frame {
        aspect-ratio: auto;
        height: 55vh;
        height: 55svh;
        min-height: 260px;
        padding: 12px;
    }

    /* 缩略图 */
    .detail-thumbs {
        max-width: 100%;
        margin-top: 8px;
    }

    /* 移动端 thumb 缩小到 60px */
    .work-detail-thumbs .swiper-slide {
        width: 60px;
        height: 60px;
    }

    /* 移动端：返回按钮 + 标题 + 搜索框 分行布局 */
    .page-backbar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .works-header-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .works-title {
        white-space: nowrap;
        font-size: 1.2rem;
    }

    .header-search {
        width: 100%;
    }

    .search-input {
        width: 100%;
        font-size: .9rem;
    }
}

#fancybox-content {
    position: relative;
    overflow: hidden;
}

#fancybox-content .fb-zoomable {
    transform-origin: center center;
    display: block;
    max-width: none;
    max-height: none;
}

#fancybox-content img.fb-zoomable {
    cursor: grab;
}

#fancybox-content img.fb-zooming {
    cursor: grabbing;
}

.work-image.is-loading {
    position: relative;
}

.work-image.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #e5e7eb;
    border-top-color: #7f86c9;
    border-radius: 50%;
    animation: work-img-spin 0.8s linear infinite;
}

@keyframes work-img-spin {
    to { transform: rotate(360deg); }
}

.work-image img.is-loaded {
    opacity: 1;
}

.works-loader {
    text-align: center;
    padding: 32px 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

.works-loader .loader-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #7f86c9;
    border-radius: 50%;
    animation: work-img-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.works-loader.is-done {
    color: #cdd2db;
}

.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #7f86c9;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease, background .2s ease;
    z-index: 99;
    box-shadow: 0 2px 12px rgba(127,134,201,.4);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #6a72bd;
}

.back-to-top::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-left: 2.5px solid #fff;
    border-top: 2.5px solid #fff;
    transform: translate(-50%, -30%) rotate(45deg);
}
