/* ===== 增强版 Lightbox 样式 ===== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none; /* 禁用触摸滚动 */
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

/* Lightbox打开时锁定body滚动 */
body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
}

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

.lightbox-media {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-media video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 导航按钮 */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* 信息栏 */
.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: white;
    max-width: 90vw;
}

.lightbox-caption {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 8px;
    opacity: 0.9;
}

.lightbox-counter {
    font-size: 14px;
    opacity: 0.7;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }
    
    .lightbox-nav svg {
        width: 32px;
        height: 32px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-media img,
    .lightbox-media video {
        max-height: 70vh;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 0 20px;
    }
    
    .lightbox-counter {
        font-size: 12px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.15);
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
}

/* 加载动画 */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox.active .lightbox-media {
    animation: lightboxFadeIn 0.3s ease;
}

/* 触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav:active,
    .lightbox-close:active {
        transform: translateY(-50%) scale(0.95);
        background: rgba(255, 255, 255, 0.3);
    }
    
    .lightbox-close:active {
        transform: scale(0.95);
    }
}

