/**
 * 评论图片灯箱：滚轮/捏合缩放（transform），可滚动视口平移
 */
.comment-inline-img {
    cursor: zoom-in;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.comment-inline-img:hover {
    opacity: 0.95;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.comment-img-lightbox {
    --lightbox-strip-offset: 56px;
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    -webkit-text-size-adjust: 100%;
}
.comment-img-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.comment-img-lightbox__top {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 0.5rem 0.25rem;
    box-sizing: border-box;
}

.comment-img-lightbox__inner {
    position: relative;
    width: 100%;
    max-width: min(96vw, 1680px);
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.comment-img-lightbox__frame {
    flex: 1 1 0;
    min-height: 160px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* 可滚动视口：放大后拖移查看 */
.comment-img-lightbox__viewport {
    width: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 2.75rem;
    touch-action: pan-x pan-y;
}

.comment-img-lightbox__zoom-layer {
    display: inline-block;
    line-height: 0;
    transform-origin: center center;
    transition: transform 0.06s ease-out;
    will-change: transform;
    max-width: 100%;
    max-height: 100%;
}

.comment-img-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: min(85vh, calc(100dvh - 180px));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
    vertical-align: middle;
}

.comment-img-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.comment-img-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.comment-img-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.comment-img-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.26);
}
.comment-img-lightbox__nav--prev {
    left: 0.15rem;
}
.comment-img-lightbox__nav--next {
    right: 0.15rem;
}

.comment-img-lightbox__meta {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.35rem 0.5rem 0;
    min-height: 1.5rem;
}

.comment-img-lightbox__zoom-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    user-select: none;
}

.comment-img-lightbox__counter {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    user-select: none;
}

@media (max-width: 640px) {
    .comment-img-lightbox__viewport {
        padding: 0 2.5rem;
    }
}

/* 底部图集 */
.comment-img-lightbox__strip-panel {
    flex-shrink: 0;
    width: 100%;
    max-height: 148px;
    padding: 8px 12px 14px;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.35));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-img-lightbox__strip-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.comment-img-lightbox__strip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 8px 6px;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.comment-img-lightbox__strip::-webkit-scrollbar {
    height: 6px;
}
.comment-img-lightbox__strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

.comment-img-lightbox__thumb {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    padding: 0;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.comment-img-lightbox__thumb:hover {
    border-color: rgba(255, 255, 255, 0.35);
}
.comment-img-lightbox__thumb.is-active {
    border-color: #00ff9d;
    box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.45);
}

.comment-img-lightbox__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html.comment-img-lightbox-open,
body.comment-img-lightbox-open {
    overflow: hidden !important;
    overscroll-behavior: none;
    width: 100%;
    height: 100%;
    scroll-behavior: auto !important;
}
