/* ========== 灯箱样式 ========== */

/* 遮罩层 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 图片容器 */
.lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 85vh;
}

/* 灯箱图片 */
.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* 进度条容器 */
.lightbox-progress {
    position: absolute;
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    display: none;
}

/* 进度条填充 */
.lightbox-progress-bar {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.05s linear;
}

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-family: monospace;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10001;
}

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

/* ============================================================
   ★ 底部面板（缩略图条 + 工具栏，包在一起）
   ============================================================ */
.lightbox-bottom-panel {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 92vw;
    z-index: 10001;
    cursor: default;
}

/* ============================================================
   ★ 缩略图条
   ============================================================ */
.lightbox-thumbs {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 90vw;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.lightbox-thumbs::-webkit-scrollbar {
    height: 4px;
}
.lightbox-thumbs::-webkit-scrollbar-track {
    background: transparent;
}
.lightbox-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* 单张缩略图 */
.lightbox-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.5;
    background: #1e293b;
    padding: 0;
    box-sizing: border-box;
}

.lightbox-thumb:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ============================================================
   ★ 底部切换栏：上一张 / 计数器 / 下一张，居中在底部
   ============================================================ */
.lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: default;
}

/* ============================================================
   ★ 切换按钮 —— 无圆圈版
   ★ 默认只有箭头，hover 时才有一个淡淡的圆形背景
   ============================================================ */
.lightbox-prev,
.lightbox-next {
    /* 定位 */
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;

    /* 尺寸：只占箭头大小的点击区域 */
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;

    /* 清空字号，避免字号撑高 */
    font-size: 0;
    line-height: 0;

    /* 布局 */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* 外观：默认透明无背景 */
    border: none;
    outline: none;
    color: #fff;
    cursor: pointer;
    user-select: none;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* ★ 只有 hover 时才出现淡淡的圆形背景 */
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.12);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(0.9);
}

/* ============================================================
   ★ 用 ::before 画箭头
   ★ absolute + translate(-50%,-50%) 保证箭头严格居中
   ============================================================ */
.lightbox-prev::before,
.lightbox-next::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-top: 2.5px solid #fff;
    border-right: 2.5px solid #fff;
    border-radius: 2px;
    box-sizing: border-box;
}

/* 左箭头：旋转 -135° */
.lightbox-prev::before {
    transform: translate(-50%, -50%) rotate(-135deg);
    margin-left: -1px;
}

/* 右箭头：旋转 45° */
.lightbox-next::before {
    transform: translate(-50%, -50%) rotate(45deg);
    margin-right: -1px;
}

/* 计数器：放在两个按钮中间 */
.lightbox-counter {
    position: static;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: ui-monospace, monospace;
    letter-spacing: 1px;
    min-width: 56px;
    text-align: center;
    user-select: none;
    padding: 0 4px;
}

/* 图片说明 */
.lightbox-caption {
    position: absolute;
    bottom: 140px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ddd;
    font-size: 14px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    max-width: 80%;
    margin: 0 auto;
    border-radius: 30px;
    pointer-events: none;
    z-index: 10001;
}

/* ============================================================
   响应式：移动端底部面板更紧凑
   ============================================================ */
@media (max-width: 768px) {
    .lightbox-bottom-panel {
        bottom: 16px;
        gap: 6px;
    }

    .lightbox-thumbs {
        gap: 4px;
        padding: 5px 8px;
        border-radius: 12px;
    }

    .lightbox-thumb {
        width: 44px;
        height: 44px;
        border-radius: 6px;
    }

    .lightbox-toolbar {
        gap: 12px;
        padding: 6px 14px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 32px;
        height: 32px;
    }

    .lightbox-prev::before,
    .lightbox-next::before {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }

    .lightbox-counter {
        font-size: 12px;
        min-width: 48px;
    }

    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 15px;
        width: 44px;
        height: 44px;
    }

    .lightbox-caption {
        font-size: 12px;
        bottom: 120px;
    }

    .lightbox-progress {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .lightbox-thumb {
        width: 38px;
        height: 38px;
        border-radius: 5px;
    }

    .lightbox-thumbs {
        gap: 3px;
        padding: 4px 6px;
    }

    .lightbox-caption {
        bottom: 108px;
    }
}