/* Lightbox styles */
.lightbox {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 9999;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: hidden;
    /* Disable scroll */
    /* Start transparent for transition */
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;

    /* Flex layout for centering */
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Modal Content (image) */
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    /* Remove absolute positioning and transform centering as we use flex now */
    border-radius: 8px;
    /* Will be controlled by JS for FLIP animation */
    /* Ensure transform origin is center for accurate scaling */
    transform-origin: center center;
    will-change: transform;
    /* Default transition for window resize etc */
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* The Close Button */
.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    z-index: 10000;
    cursor: pointer;

    /* Animation initial state */
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.lightbox.open .close {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.1s;
    /* Show slightly after image starts */
}

.close:hover {
    color: #ffffff;
    transform: rotate(90deg);
    /* Rotate effect on hover */
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .lightbox-content {
        width: 95%;
    }
}