/* image-preview.css - 图片预览弹窗样式 */

/* 图片预览弹窗样式 - 全屏优化 */
.img-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    touch-action: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.img-preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* 图片容器 - 支持拖拽和任意缩放 */
.img-preview-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}
.img-preview-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    cursor: grab;
    touch-action: none;
    /* 初始状态：居中、1倍缩放、无位移 */
    transform: translate(0px, 0px) scale(1);
    transform-origin: center center;
}
.img-preview-img.grabbing {
    cursor: grabbing;
}

/* 控制按钮样式优化 */
.img-preview-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.img-preview-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}
.img-preview-prev {
    left: 20px;
}
.img-preview-next {
    right: 20px;
}
.img-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.img-preview-close:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* 缩放控制 */
.img-preview-zoom {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}
.img-preview-zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    backdrop-filter: blur(2px);
}
.img-preview-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* 图片计数 */
.img-preview-count {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10;
    backdrop-filter: blur(2px);
}

/* 适配移动端按钮大小 */
@media (max-width: 768px) {
    .img-preview-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .img-preview-close, .img-preview-zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    .img-preview-count {
        font-size: 14px;
        padding: 4px 8px;
    }
}