/* ===== 灯箱组件 Lightbox — Arco Design 对齐（token 化） =====
   用法：
   1. 页面引入本 CSS + lightbox.js
   2. 给需要点击放大的图片容器加 class="dt-lightbox-item"
   3. 容器内 <img> 的 src 即大图源（thumb 可用 data-thumb 或直接小图）
   可选 data-caption 设置图注
*/

.dt-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(12, 14, 18, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.dt-lightbox-stage {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dt-lightbox-img-wrap {
    position: relative;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.dt-lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-sm, 6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    background: var(--dt-raised, #23272f);
    user-select: none;
    -webkit-user-drag: none;
}

/* 图注 — 固定在视口底部，不被缩放图片覆盖 */
.dt-lightbox-caption {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    font-size: var(--fs-sm, 12px);
    line-height: 20px;
    color: #fff;
    text-align: center;
    max-width: 80vw;
    pointer-events: none;
}

/* 计数器 — 固定在图注上方 */
.dt-lightbox-count {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    font-family: var(--font-mono, monospace);
    font-size: var(--fs-xs, 12px);
    color: var(--dt-text4, #94a3b8);
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* 关闭按钮 — 纯叉图标，固定视口右上角 */
.dt-lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1002;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.dt-lightbox-close:hover {
    color: #fff;
}

.dt-lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* 左右箭头 — 固定在视口左右两侧 */
.dt-lightbox-prev,
.dt-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(22, 39, 47, 0.9);
    color: #e5e8eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.dt-lightbox-prev {
    left: 24px;
}

.dt-lightbox-next {
    right: 24px;
}

.dt-lightbox-prev:hover,
.dt-lightbox-next:hover {
    background: rgba(60, 60, 78, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.dt-lightbox-prev.disabled,
.dt-lightbox-next.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.dt-lightbox-prev svg,
.dt-lightbox-next svg {
    width: 18px;
    height: 18px;
}

/* 加载动画 */
.dt-lightbox-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dt-lightbox-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dt-lightbox-spin 0.8s linear infinite;
}

@keyframes dt-lightbox-spin {
    to { transform: rotate(360deg); }
}

/* 源图点击样式 */
.dt-lightbox-item {
    cursor: zoom-in;
    position: relative;
}

.dt-lightbox-item img {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dt-lightbox-item:hover img {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 响应式：小屏箭头放内部 */
@media (max-width: 767px) {
    .dt-lightbox-prev {
        left: 8px;
    }

    .dt-lightbox-next {
        right: 8px;
    }

    .dt-lightbox-close {
        top: 12px;
        right: 12px;
    }

    .dt-lightbox-prev,
    .dt-lightbox-next {
        width: 38px;
        height: 38px;
        background: rgba(22, 39, 47, 0.72);
    }

    .dt-lightbox-stage {
        max-width: 96vw;
    }

    .dt-lightbox-img-wrap,
    .dt-lightbox-img {
        max-width: 96vw;
    }
}

/* 缩放状态 */
.dt-lightbox-img.zoomable {
    cursor: grab;
}

.dt-lightbox-img.zooming {
    cursor: grabbing;
    transition: none !important;
    animation: none !important;
}

.dt-lightbox-img.zoomed {
    cursor: grab;
}

/* 缩放提示条 — 顶部纯文字，不做背景和边框，始终显示 */
.dt-lightbox-zoom-hint {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    color: rgba(255, 255, 255, 0.45);
    font-size: var(--fs-xs, 12px);
    line-height: 20px;
    white-space: nowrap;
    pointer-events: none;
}

/* 动画 */
.dt-lightbox-img-wrap img.dt-lightbox-enter {
    animation: dt-lightbox-zoom 0.18s ease;
}

@keyframes dt-lightbox-zoom {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}