/* ============================================================
 * 产品画廊小部件
 * ============================================================ */
.qing-gl { display: flex; gap: 12px; }
.qing-gl-empty { color:#999; padding:20px; }

/* 垂直（左/右）布局 */
.qing-gl-vertical { flex-direction: row; }
.qing-gl-pos-right { flex-direction: row-reverse; }

/* 水平（上/下）布局 */
.qing-gl-horizontal { flex-direction: column; }
.qing-gl-pos-top    { flex-direction: column-reverse; }

/* ── 缩略图列 ────────────────────────── */
.qing-gl-thumbs-col {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.qing-gl-vertical   .qing-gl-thumbs-col { flex-direction: column; width: var(--thumb,90px); align-items: center; }
.qing-gl-horizontal .qing-gl-thumbs-col { flex-direction: row;    height: var(--thumb,90px); justify-content: center; }

.qing-gl-nav {
    flex-shrink: 0;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all .2s;
    padding: 0;
}
.qing-gl-nav:hover { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.qing-gl-nav:disabled { opacity: .35; cursor: default; }
.qing-gl-nav svg { width: 16px; height: 16px; display: block; }

.qing-gl-thumbs-viewport { flex: 1; overflow: hidden; min-width:0; min-height:0; }
.qing-gl-vertical   .qing-gl-thumbs-viewport {
    overflow-y: hidden;
    /* 可见数量 * (缩略图尺寸 + 间隙) */
    max-height: calc(var(--qing-gl-visible, 5) * (var(--thumb,90px) + 8px));
}
.qing-gl-horizontal .qing-gl-thumbs-viewport {
    overflow-x: hidden;
    max-width: calc(var(--qing-gl-visible, 5) * (var(--thumb,90px) + 8px));
}

.qing-gl-thumbs-track {
    display: flex;
    gap: 8px;
    transition: transform .35s ease;
}
.qing-gl-vertical   .qing-gl-thumbs-track { flex-direction: column; }
.qing-gl-horizontal .qing-gl-thumbs-track { flex-direction: row; }

.qing-gl-thumb {
    flex-shrink: 0;
    width: 90px; height: 90px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f0f0f0;
    transition: border-color .2s;
}
.qing-gl-thumb img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .35s ease; }
.qing-gl-thumb.active { border-color: #2a6fdb; }
.qing-gl-thumb:hover  { border-color: #2a6fdb; }
.qing-gl-thumb:hover img { transform: scale(1.12); }

/* 视频缩略图的播放角标 */
.qing-gl-thumb-play {
    position: absolute; inset:0;
    display: flex; align-items:center; justify-content:center;
    background: rgba(0,0,0,.25);
}
.qing-gl-thumb-play::after {
    content:'';
    border-style:solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
}

/* ── 主显示区 ─────────────────────────── */
.qing-gl-main-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:12px; }

.qing-gl-main {
    position: relative;
    width: 100%;
    height: 480px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.qing-gl-stage {
    position: absolute; inset:0;
    display: none;
    align-items: center;
    justify-content: center;
}
.qing-gl-stage.active { display: flex; }

.qing-gl-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    display: block;
    transition: transform 0.4s ease;
}
.qing-gl-stage-image { overflow: hidden; width: 100%; height: 100%; }
.qing-gl-stage-image:hover img {
    transform: scale(1.05);
}
.qing-gl-stage video { width:100%; height:100%; object-fit:cover; }

/* ── Photos / Video 切换 ─────────────── */
.qing-gl-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
    align-self: center;
}
.qing-gl-tab {
    padding: 8px 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: all .2s;
}
.qing-gl-tab.active {
    background: #fff;
    color: #222;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── 灯箱 ────────────────────────────── */
.qing-gl-lightbox {
    position: fixed; inset:0; z-index:99999;
    display: flex; align-items:center; justify-content:center;
}
.qing-gl-lightbox[hidden] { display:none; }

.qing-gl-lb-overlay {
    position:absolute; inset:0;
    background: rgba(0,0,0,.88);
}

.qing-gl-lb-stage {
    position: relative; z-index:1;
    max-width: 90vw; max-height: 88vh;
    display: flex; align-items:center; justify-content:center;
}
.qing-gl-lb-stage img {
    max-width:90vw; max-height:88vh;
    object-fit:contain; display:block; border-radius:4px;
}

.qing-gl-lb-close {
    position:absolute; top:16px; right:20px; z-index:2;
    font-size:30px; line-height:1; color:#fff;
    background:none; border:none; cursor:pointer; padding:0;
}
.qing-gl-lb-counter {
    position:absolute; top:18px; left:50%; transform:translateX(-50%);
    color:#fff; font-size:14px; z-index:2;
}
.qing-gl-lb-prev, .qing-gl-lb-next {
    position:absolute; top:50%; transform:translateY(-50%);
    z-index:2; background:rgba(255,255,255,.15);
    border:none; border-radius:50%;
    width:44px; height:44px;
    display:flex; align-items:center; justify-content:center;
    color:#fff; cursor:pointer;
    transition: background .2s;
}
.qing-gl-lb-prev { left:24px; }
.qing-gl-lb-next { right:24px; }
.qing-gl-lb-prev:hover, .qing-gl-lb-next:hover { background:rgba(255,255,255,.3); }
.qing-gl-lb-prev svg, .qing-gl-lb-next svg { width:20px; height:20px; display:block; }

/* 响应式：手机端缩略图移到主图下方，横向排列 */
@media (max-width:768px) {
    .qing-gl { flex-direction: column-reverse !important; }
    .qing-gl-thumbs-col {
        flex-direction: row !important;
        width: 100% !important;
        height: auto !important;
        justify-content: center !important;
    }
    .qing-gl-thumbs-viewport {
        overflow-x: hidden !important;
        overflow-y: visible !important;
        max-height: none !important;
        max-width: calc(var(--qing-gl-visible, 5) * (64px + 8px)) !important;
    }
    .qing-gl-thumbs-track { flex-direction: row !important; }
    .qing-gl-thumb { width:64px !important; height:64px !important; }
    .qing-gl-main { height: 340px; }
    /* 竖向箭头旋转为左右 */
    .qing-gl-nav svg { transform: rotate(-90deg); }
}
