/* ===== 图片灯箱样式 ===== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.lightbox-open {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 2px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-image.lightbox-loaded {
    opacity: 1;
}

/* Loading spinner */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lightbox-spin 0.7s linear infinite;
}

@keyframes lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100001;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Navigation arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    z-index: 100000;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.lightbox-nav.lightbox-nav-disabled {
    opacity: 0.15;
    cursor: default;
}

.lightbox-nav.lightbox-nav-disabled:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}

.lightbox-nav::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-left: 3px solid #fff;
    border-top: 3px solid #fff;
}

.lightbox-prev::before {
    transform: rotate(-45deg);
    margin-left: 6px;
}

.lightbox-next::before {
    transform: rotate(135deg);
    margin-right: 6px;
}

/* Counter */
.lightbox-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 100001;
}

/* Caption */
.lightbox-caption {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    max-width: 60vw;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 100001;
}

/* Prevent body scroll */
body.lightbox-body-locked {
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 60px;
    }

    .lightbox-prev {
        left: 4px;
    }

    .lightbox-next {
        right: 4px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }

    .lightbox-counter {
        bottom: 16px;
        font-size: 12px;
    }
}
