/* 通用图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    will-change: opacity, visibility;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background-color;
}

.image-modal-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 40px 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.image-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.9);
    will-change: transform;
}

.image-modal.active .image-modal-img {
    transform: scale(1);
}

.image-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #333;
    line-height: 1;
    opacity: 0;
    transform: scale(0.8);
    will-change: opacity, transform;
}

.image-modal.active .image-modal-close {
    opacity: 1;
    transform: scale(1);
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.image-modal-close:active {
    transform: scale(0.9);
}

.image-modal-scroll-hint {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.image-modal.active .image-modal-scroll-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .image-modal-overlay {
        padding: 10px;
    }
    
    .image-modal-container {
        padding: 60px 0 20px 0;
    }
    
    .image-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .image-modal-scroll-hint {
        top: 60px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 为所有详情页面的内容图片添加可点击样式 */
.detail-content img:not(.logo):not(.icon):not(.avatar):not(.small-thumb) {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-content img:not(.logo):not(.icon):not(.avatar):not(.small-thumb):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 评论区图片样式增强 */
.comment-image {
    cursor: pointer !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 8px;
}

.comment-image:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* 主图片样式增强 */
.main-image, 
.feature-image,
.content-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-image:hover,
.feature-image:hover,
.content-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 图片加载状态 */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}