/* ========================================
   图片查看器样式 (image-viewer)
   ======================================== */

.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    user-select: none;
}

.modal-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-viewer-modal .modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    cursor: grab;
    transform-origin: center center;
}

.image-viewer-modal .modal-content.grabbing {
    cursor: grabbing;
}

.image-viewer-modal #caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    pointer-events: none;
}

.image-viewer-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.image-viewer-modal .close-btn:hover,
.image-viewer-modal .close-btn:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.viewer-toolbar {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: linear-gradient(135deg, rgba(33, 37, 41, 0.85) 0%, rgba(52, 58, 64, 0.9) 100%);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tool-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
}

.tool-btn::after,
.close-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: normal;
    line-height: 1.4;
    text-shadow: none;
}

.close-btn::after {
    bottom: -40px;
    top: auto;
    font-size: 14px;
}

.tool-btn:hover::after,
.close-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tool-btn:hover {
    background: linear-gradient(135deg, #a9fde4 0%, #63b0d4 100%);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 176, 212, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.tool-btn:active {
    transform: translateY(0) scale(0.95);
    background: linear-gradient(135deg, #63b0d4 0%, #a9fde4 100%);
}

#post-content img {
    cursor: zoom-in;
    transition: 0.3s;
}
#post-content img:hover {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

@media only screen and (max-width: 768px) {
    .viewer-toolbar {
        bottom: 60px;
        padding: 8px 15px;
        gap: 10px;
    }
    .tool-btn {
        font-size: 1rem;
        padding: 5px;
    }
    .image-viewer-modal .close-btn {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}
