/* 图片和 Mermaid 图表查看器样式 */

/* 为可点击的图片和 Mermaid 添加指针样式 */
.post-content img,
.post-content .mermaid {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.post-content img:hover,
.post-content .mermaid:hover {
    opacity: 0.9;
}

/* 图片查看器遮罩层 */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.image-viewer-overlay.active {
    display: flex !important;
}

/* 图片容器 */
.image-viewer-content {
    max-width: 95%;
    max-height: 95%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.image-viewer-content img,
.image-viewer-content svg {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    display: block !important;
    position: relative;
    z-index: 10002;
}

/* 关闭按钮 */
.image-viewer-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10003;
    backdrop-filter: blur(10px);
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* 提示文字 */
.image-viewer-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10003;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .image-viewer-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
    }
    
    .image-viewer-hint {
        bottom: 20px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .image-viewer-content {
        max-width: 98%;
        max-height: 98%;
    }
}

@media screen and (max-width: 480px) {
    .image-viewer-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .image-viewer-hint {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}
