/* Lightbox / Modal 样式 */
.img-modal {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    /* 加深背景色 */
    z-index: 2000;
    /* 确保在所有元素之上 */
    padding: 40px;
    backdrop-filter: blur(5px);
    /* 添加模糊效果 */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.img-modal[aria-hidden="false"] {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.img-modal-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    background-color: #000;
    /* 防止透明图显示背景 */
    display: block;
    margin: 0 auto;
    opacity: 1;
    visibility: visible;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
}

.img-modal[aria-hidden="false"] .img-modal-img {
    /* 初始进入状态由 JS 控制或保持 scale(1) */
}

.img-modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 2001;
}

.img-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.img-modal-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
    font-weight: 300;
    letter-spacing: 1px;
}