/* ========== 图片灯箱样式 ========== */

/* ===== 灯箱打开时锁定滚动 ===== */
body.lightbox-open {
    overflow: hidden;
    /* ===== 补偿滚动条宽度，防止页面晃动 ===== */
    padding-right: var(--scrollbar-width, 0px);
}
/* 主容器 */
.image-lightbox-container {
    width: 100%;
    margin: 0 auto;
    /*padding: 20px;*/
    font-family: Arial, sans-serif;
}

/* ===== 大图区域 ===== */
.lightbox-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

/* ===== 大图容器 ===== */
.main-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;  /* 16:9 比例，保持容器高度 */
    overflow: hidden;
    /* ===== 关键：容器本身不可点击 ===== */
    pointer-events: none;
}

/* ===== 居中容器：宽高自适应图片，水平垂直居中 ===== */
.image-center-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ===== 关键：容器本身不可点击 ===== */
    pointer-events: none;
}

/* ===== 图片本身：宽度自适应，高度100%，保持比例 ===== */
.image-center-container .main-image {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: #f5f5f5;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    position: relative;
}

/* 大图导航按钮 */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
	user-select: none;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.05);
}
.nav-btn .icon-shangyiye:before, .nav-btn .icon-qianjin:before{font-size: 20px;}
.nav-btn.prev-btn {
    left: 15px;
}

.nav-btn.next-btn {
    right: 15px;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

/* ===== 缩略图区域 ===== */
.lightbox-thumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* ===== 缩略图滚动容器 - 确保可滚动 ===== */
.thumb-list-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.thumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    transform: translateX(0);
    transition: transform 0.3s ease;
    will-change: transform;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
}

.thumb-list::-webkit-scrollbar {
    height: 0;
    display: none;
}
.thumb-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.thumb-item {
    flex: 0 0 112px;
    width: 112px;
    height: 72px;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid transparent;
    opacity: 0.6;
    position: relative;
	box-sizing:border-box;
}

.thumb-item:hover {
    opacity: 1;
}

.thumb-item.active {
    border-color: #ff6651;opacity: 1;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: block;
}

/* ===== 缩略图导航按钮 ===== */
.thumb-nav {
    flex: 0 0 30px;
    height: 70px;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    color: #333;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* ===== 问题1修复：移除禁用样式，始终可点击 ===== */
    pointer-events: auto !important;
}

.thumb-nav:hover {
    background: #ccc;
}

/* ===== 灯箱（全屏弹窗） ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 1);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-image {
    height: 100vh;
    object-fit: fill;
	object-position: top;
}

/* ===== 灯箱关闭按钮 - 靠右上角 ===== */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ===== 灯箱导航按钮 - 靠最左和最右 ===== */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
	user-select: none;
}

.lightbox-nav .icon-shangyiye:before, .lightbox-nav .icon-qianjin:before{font-size: 35px;}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== 靠屏幕最左侧 ===== */
.lightbox-prev {
    left: 20px;
}

/* ===== 靠屏幕最右侧 ===== */
.lightbox-next {
    right: 20px;
}

/* ===== 图片计数 - 右下角圆弧形 ===== */
.lightbox-counter {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 30px;
    z-index: 100000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
    user-select: none;
}

/* 灯箱打开时锁定滚动 */
body.lightbox-open {
    overflow: hidden;
}

/* 去掉按钮的边框*/
.nav-btn,
.thumb-nav,
.lightbox-nav,
.lightbox-close {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* 针对 Firefox 的 focus 样式 */
.nav-btn::-moz-focus-inner,
.thumb-nav::-moz-focus-inner,
.lightbox-nav::-moz-focus-inner,
.lightbox-close::-moz-focus-inner {
    border: 0;
}

/* ===== Loading 动画 ===== */
.lightbox-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100002;
    display: none;
}

.lightbox-loading.show {
    display: block;
}

.lightbox-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 灯箱图片加载完成前隐藏 ===== */
.lightbox-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
    .image-lightbox-container {
        padding: 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .nav-btn.prev-btn {
        left: 8px;
    }
    .nav-btn.next-btn {
        right: 8px;
    }
    
    .thumb-item {
        width: 60px;
        height: 45px;
    }
    
    .thumb-nav {
        flex: 0 0 25px;
        height: 45px;
        font-size: 18px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .lightbox-image-wrapper {
        height: 75vh;
    }
    
    .lightbox-counter {
        bottom: 20px;
        right: 20px;
        font-size: 14px;
        padding: 6px 16px;
    }
}

@media (max-width: 480px) {
    .thumb-item {
        width: 50px;
        height: 38px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 5px;
    }
    .lightbox-next {
        right: 5px;
    }
    
    .lightbox-image-wrapper {
        height: 60vh;
    }
    
    .lightbox-counter {
        bottom: 15px;
        right: 15px;
        font-size: 12px;
        padding: 5px 12px;
    }
}