/* =========================================================
   设备展示页 - 原生推拉灯箱样式
   ========================================================= */

#equipmentLightbox {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(0, 0, 0, 0.95); 
    z-index: 999999; 
    flex-direction: column; 
    box-sizing: border-box;
}

.lightbox-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    color: #fff; 
    font-size: 18px; 
    flex-shrink: 0;
    z-index: 10;
}

#lightboxCounter {
    font-weight: bold; 
    font-family: monospace;
}

.lightbox-close-btn {
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 36px; 
    cursor: pointer; 
    line-height: 1; 
    padding: 0; 
    margin: 0;
    transition: transform 0.2s;
}

/* 中间主区域 */
.lightbox-main-area {
    flex: 1; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; /* 关键：裁掉多余的轨道 */
    width: 100%;
}

/* ★★★ 核心：推拉轨道 (绝对定位，宽度动态由 JS 撑开) ★★★ */
.lightbox-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

/* 每一张图片/视频的独立容器 */
.lightbox-slide {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lightbox-slide img, 
.lightbox-slide video {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 左右箭头 */
.lightbox-nav-btn {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 40px; 
    cursor: pointer; 
    padding: 10px 15px; 
    border-radius: 50%; 
    transition: background 0.2s, color 0.2s; 
    z-index: 10;
}

#lightboxPrevBtn { 
    left: 20px; 
}
#lightboxNextBtn { 
    right: 20px; 
}

/* =========================================================
   大图下方标题文字
   ========================================================= */
.lightbox-title {
    position: absolute;
    bottom: 20px; /* 距离底部的距离，如果想离大图更近可以改大点 */
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    z-index: 10;
    width: 90%;
    pointer-events: none; /* 防止文字挡住点击事件 */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* 底部缩略图区域 */
.lightbox-thumbs-area {
    padding: 20px; 
    display: flex; 
    justify-content: center; /* 让内部容器居中 */
    flex-shrink: 0;
    z-index: 10;
    overflow: hidden; 
}
.lightbox-thumbs-area::-webkit-scrollbar { 
    display: none; 
}
/* 精确控制可视窗口 */
#lightboxThumbsWrapper {
    width: 890px; /* PC 端固定显示 10 个的宽度 */
    overflow: hidden; 
    position: relative;
}
#lightboxThumbs {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    transition: transform 0.3s ease; 
}

.lightbox-thumb-item {
    width: 80px;
    height: 60px;
    border: 3px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    flex-shrink: 0;
}

.lightbox-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-thumb-item.active {
    border-color: #ff781e;
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-thumb-item .thumb-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* 隐藏箭头（如果只有1张图） */
.hidden-arrow { 
    display: none !important; 
}
body.lightbox-open { 
    overflow: hidden !important; 
}

/* 移动端自适应 */
@media (max-width: 768px) {
    .lightbox-header { 
        padding-top: calc(15px + env(safe-area-inset-top)); 
    }
    .lightbox-thumbs-area { 
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .lightbox-nav-btn { 
        font-size: 24px !important; 
        padding: 8px 12px !important; 
    }
    #lightboxNextBtn { 
        right: 10px !important; 
    }

    .lightbox-title {
        bottom: 15px;
        font-size: 15px;
        width: 80%;
    }
    #lightboxThumbsWrapper {
        width: 290px;
    }
    #lightboxThumbs {
        /* 移动端：默认显示 5 个，每个宽 50px + gap 10px = 290px */
        width: 290px; 
    }
    .lightbox-thumb-item {
        width: 50px !important;
        height: 40px !important;
        border-width: 2px !important;
    }
    .lightbox-thumb-item .thumb-video-icon { 
        font-size: 14px !important; 
    }
    #lightboxCounter { 
        font-size: 14px !important; 
    }
}