/* Fancybox 5 暗色主题覆盖 */

.fancybox__backdrop {
    background: rgba(10, 10, 10, 0.92);
}

.fancybox__toolbar {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    padding: 16px 20px;
}

.fancybox__toolbar__column {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fancybox__toolbar .end-counter {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.fancybox__toolbar button {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.fancybox__toolbar button:hover {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.fancybox__toolbar button svg {
    width: 18px;
    height: 18px;
}

.fancybox__nav button {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.fancybox__nav button:hover {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.fancybox__nav button svg {
    width: 20px;
    height: 20px;
}

.fancybox__caption {
    color: #e0e0e0;
    font-size: 14px;
    padding: 12px 16px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    margin: 12px;
    max-width: calc(100% - 24px);
}

.fancybox-caption-title {
    font-size: 15px;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.fancybox-caption-desc {
    font-size: 13px;
    color: #aaa;
    margin: 0;
}

.fancybox__thumbs .carousel__slide {
    border: 2px solid transparent;
    border-radius: 4px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.fancybox__thumbs .carousel__slide.is-selected {
    border-color: #0084ff;
    opacity: 1;
}

.fancybox__thumbs .carousel__slide img {
    border-radius: 2px;
}

.fancybox__content {
    background: transparent;
}

.fancybox__slide {
    background: transparent;
}

/* 防止控件自动隐藏（仅在打开状态时强制显示，关闭时允许正常淡出） */
html.with-fancybox.is-open .fancybox__toolbar,
html.with-fancybox.is-open .fancybox__nav,
html.with-fancybox.is-open .fancybox__thumbs {
    opacity: 1 !important;
    transition: none !important;
}

/* 移除 body 滚动锁定和滚动条补偿 */
html.with-fancybox body.hide-scrollbar {
    overflow: visible !important;
    margin-right: 0 !important;
}

html.with-fancybox {
    --fancybox-scrollbar-compensate: 0px !important;
    --fancybox-body-margin: 0px !important;
}

/* HTML5 视频在灯箱中的样式 */
.fancybox__content video,
.fancybox__slide video {
    max-width: 100%;
    max-height: 90vh;
    outline: none;
    background: #000;
    display: block;
    margin: 0 auto;
}
