.image-preview-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding:50px;
}

.image-preview-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 图片内层容器 - 负责在滚动区域内居中 */
.image-preview-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: move;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* --- 修改结束 --- */

/* 预览图片 - 保持比例 */
.image-preview-img {
    position: absolute;
    transform-origin: center;
    max-width: none;
    max-height: none;
    transition: transform 0.2s ease;
}

.image-preview-img:active {
    cursor: grabbing;
}


.image-preview-controls {
    position: absolute;
    bottom: -40px;
    right: 0;
    display: flex;
    gap: 10px;
}

.image-preview-close{
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
}

/* 优化后的关闭按钮样式 - 简洁现代 */
.image-preview-btn {
    padding: 5px 10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* hover效果 - 背景变白，文字变黑 */
.image-preview-btn:hover {
    background: rgba(200, 200, 200, 0.2); /* 半透明白色背景 */
    color: #666666;
    transform: scale(1.05); /* 轻微放大 */
}

/* 点击效果 */
.image-preview-close:active {
    transform: scale(0.98);
}

.image-preview-close:focus {
    outline: none;
}

/* 禁止背景滚动 */
body.image-preview-open {
    overflow: hidden;
}