﻿/* 图片查看器样式 - Lightbox功能 */

/* 遮罩层 */
.image-viewer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-viewer-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* 主容器 */
.image-viewer-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-viewer-overlay.active .image-viewer-container {
    transform: scale(1);
}

/* 图片包装器 */
.image-viewer-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* 图片本身 */
.image-viewer-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.image-viewer-image.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
}

/* 图片信息 */
.image-viewer-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    max-width: 600px;
    text-align: center;
}

.image-viewer-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.image-viewer-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.image-viewer-counter {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

/* 关闭按钮 */
.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

.image-viewer-close::before,
.image-viewer-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.image-viewer-close::before {
    transform: rotate(45deg);
}

.image-viewer-close::after {
    transform: rotate(-45deg);
}

/* 左右切换按钮 */
.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.image-viewer-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.image-viewer-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-viewer-nav.disabled:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%);
}

.image-viewer-prev {
    left: 20px;
}

.image-viewer-next {
    right: 20px;
}

.image-viewer-nav::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
}

.image-viewer-prev::before {
    border-width: 12px 18px 12px 0;
    border-color: transparent #fff transparent transparent;
    margin-left: -3px;
}

.image-viewer-next::before {
    border-width: 12px 0 12px 18px;
    border-color: transparent transparent transparent #fff;
    margin-right: -3px;
}

/* 缩放控制栏 - 移到顶部 */
.image-viewer-zoom-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.95), rgba(66, 165, 245, 0.95));
    padding: 12px 20px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.image-viewer-zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.image-viewer-zoom-btn:active {
    transform: scale(0.95);
}

.image-viewer-zoom-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.image-viewer-zoom-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1);
}

/* 缩放级别显示 */
.image-viewer-zoom-level {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 0 8px;
    min-width: 55px;
    text-align: center;
}

/* 控制栏分隔线 */
.image-viewer-controls-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* 加载动画 */
.image-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: image-viewer-spin 1s linear infinite;
}

@keyframes image-viewer-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-viewer-container {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-viewer-wrapper {
        max-height: 70vh;
    }
    
    .image-viewer-image {
        max-height: 70vh;
    }
    
    .image-viewer-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .image-viewer-close::before,
    .image-viewer-close::after {
        width: 20px;
        height: 2px;
    }
    
    .image-viewer-nav {
        width: 50px;
        height: 50px;
    }
    
    .image-viewer-prev {
        left: 10px;
    }
    
    .image-viewer-next {
        right: 10px;
    }
    
    .image-viewer-info {
        padding: 12px 20px;
        max-width: 90%;
    }
    
    .image-viewer-title {
        font-size: 16px;
    }
    
    .image-viewer-desc {
        font-size: 13px;
    }
    
    .image-viewer-zoom-controls {
        top: 15px;
        padding: 10px 16px;
        gap: 10px;
    }
    
    .image-viewer-zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .image-viewer-zoom-level {
        font-size: 13px;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .image-viewer-wrapper {
        max-height: 60vh;
        margin-bottom: 15px;
    }
    
    .image-viewer-image {
        max-height: 60vh;
    }
    
    .image-viewer-info {
        padding: 10px 15px;
    }
    
    .image-viewer-title {
        font-size: 14px;
    }
    
    .image-viewer-desc {
        font-size: 12px;
    }
    
    .image-viewer-zoom-controls {
        top: 10px;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .image-viewer-zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .image-viewer-zoom-level {
        font-size: 12px;
        min-width: 45px;
    }
}

/* 可点击图片的提示样式 */
.clickable-image {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-image:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.clickable-image::after {
    content: '??';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clickable-image:hover::after {
    opacity: 1;
}
