/**
 * image-viewer.css - 全局图片预览弹窗样式
 * 适用于：聊天、画廊、一键同款、精准控制等所有页面
 */

/* ============================================
   🖼️ 全局图片预览弹窗 - 统一展示尺寸
   ============================================ */
#imageViewerModal {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92); 
    z-index: 20000;
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(8px);
    opacity: 0; 
    transition: opacity 0.3s ease;
}
#imageViewerModal.active { opacity: 1; }

#imageViewerModal img {
    /* 🌟 统一展示尺寸：无论缩略图还是高清图，都以相同的视觉框架展示 */
    /* 最小尺寸确保小图不会显得太小 */
    min-width: 400px;
    min-height: 400px;
    /* 最大尺寸限制，适应不同屏幕 */
    max-width: min(90vw, 1200px);
    max-height: 85vh;
    /* 图片在容器内保持比例居中 */
    object-fit: contain;
    /* 视觉效果 */
    border-radius: 12px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.1);
    /* 动画效果 */
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* 交互 */
    cursor: grab;
    user-select: none;
    /* 🌟 高质量图像渲染，让高清图细节更清晰，同时不影响缩略图 */
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
}
#imageViewerModal.active img { 
    transform: scale(1); 
}

/* 预览加载提示样式 */
#viewerLoadingHint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.9), rgba(10, 120, 95, 0.9));
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 20005;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(16, 163, 127, 0.4);
    backdrop-filter: blur(4px);
}

.close-viewer-btn {
    position: absolute; 
    top: 20px; right: 30px; 
    color: white; 
    font-size: 48px;
    cursor: pointer; 
    background: linear-gradient(135deg, #ff4d4f, #ff7875); 
    border: 3px solid rgba(255, 255, 255, 0.5); 
    border-radius: 50%;
    width: 60px; height: 60px;
    display: flex;
    box-shadow: 0 4px 20px rgba(255, 77, 79, 0.6);
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 20005;
    transition: all 0.2s ease;
}
.close-viewer-btn:hover { 
    color: white; 
    background: linear-gradient(135deg, #ff7875, #ff4d4f);
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(255, 77, 79, 0.8);
}

/* 响应式调整 - 移动端 */
@media (max-width: 768px) {
    #imageViewerModal img {
        min-width: 280px;
        min-height: 280px;
        max-width: 95vw;
        max-height: 80vh;
        border-radius: 8px;
    }
    .close-viewer-btn {
        top: 10px; right: 10px;
        width: 50px; height: 50px;
        font-size: 36px;
    }
}
