/* 微信风格全屏图片/视频预览 */
.im-media-viewer-open {
    overflow: hidden !important;
}

.im-media-viewer.hidden {
    display: none !important;
}

.im-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #000;
    color: #fff;
    touch-action: none;
}

.im-media-viewer__mask {
    position: absolute;
    inset: 0;
    background: #000;
}

.im-media-viewer__close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 28px;
    line-height: 36px;
    cursor: pointer;
}

.im-media-viewer__counter {
    position: absolute;
    top: calc(18px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 2;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    pointer-events: none;
}

.im-media-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.im-media-viewer__nav.hidden {
    display: none !important;
}

.im-media-viewer__nav.is-prev {
    left: 12px;
}

.im-media-viewer__nav.is-next {
    right: 12px;
}

.im-media-viewer__stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.im-media-viewer__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.05s linear;
    cursor: zoom-in;
}

.im-media-viewer__video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    background: #000;
    outline: none;
}

@media (max-width: 768px) {
    .im-media-viewer__nav {
        display: none;
    }
}

/* 网盘旧 Layer 视频预览兜底（全屏） */
.disk-preview-layer.layui-layer {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

.disk-preview-layer .layui-layer-content {
    overflow: hidden !important;
    background: #000 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.disk-preview-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    line-height: 0;
}

.disk-preview-media video {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: auto !important;
    height: auto !important;
    background: #000;
}
