/* 首页图集【方案 4 · 轮播】20261008
   与 gallery.css(v1)、gallery-v3.css(v3) 完全独立，类名前缀 hg4- */

/* ---- 区块头部 ---- */
.hg4-block {
    margin: 0 0 24px;
    background: #fff;
    border: 1px solid rgba(130, 130, 130, .1);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px -16px rgba(30, 47, 62, .35);
}

.hg4-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(130, 130, 130, .08);
}

.hg4-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e2f3e;
    letter-spacing: -.2px;
    position: relative;
    padding-left: 14px;
}

.hg4-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.hg4-sub {
    margin: 0;
    font-size: 13px;
    color: #7d8ea0;
}

/* ---- 轮播主体 ---- */
.hg4-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f2f6fb;
    outline: none;
}

.hg4-carousel:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, .6);
}

.hg4-slides {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    height: 100%;
}

/* 非当前图用 opacity 隐藏而不是 display:none：
   图片仍在渲染树里，百度蜘蛛能抓到 5 张，不会被判为隐藏内容 */
.hg4-slide {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity .5s ease;
}

.hg4-slide.is-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.hg4-slide > a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hg4-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 6s ease;
}

/* 当前图缓慢放大（Ken Burns），增强质感；减弱动效模式下关闭 */
.hg4-slide.is-active img {
    transform: scale(1.04);
}

.hg4-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 56px 24px 32px;
    background: linear-gradient(to top, rgba(8, 20, 35, .82), rgba(8, 20, 35, 0));
    color: #fff;
}

.hg4-cap-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    transition: transform .5s ease, opacity .5s ease;
    transform: translateY(6px);
    opacity: .92;
}

.hg4-slide.is-active .hg4-cap-title {
    transform: translateY(0);
    opacity: 1;
}

.hg4-cap-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e6edf7;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

/* ---- 箭头 ---- */
.hg4-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 22, 38, .38);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: background .2s ease, opacity .25s ease;
}

/* 桌面端悬停才显示箭头，触屏/键盘焦点常显 */
.hg4-carousel:hover .hg4-arrow,
.hg4-carousel:focus-within .hg4-arrow {
    opacity: 1;
}

@media (hover: none) {
    .hg4-arrow {
        opacity: 1;
    }
}

.hg4-arrow:hover {
    background: rgba(10, 22, 38, .62);
}

.hg4-prev { left: 14px; }
.hg4-next { right: 14px; }

/* ---- 指示点 ---- */
.hg4-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 3;
    display: flex;
    gap: 7px;
    transform: translateX(-50%);
}

.hg4-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}

.hg4-dot.is-active {
    width: 22px;
    background: #fff;
}

/* ---- 减弱动效 ---- */
@media (prefers-reduced-motion: reduce) {
    .hg4-slide,
    .hg4-slide img,
    .hg4-cap-title,
    .hg4-dot {
        transition: none;
    }

    .hg4-slide.is-active img {
        transform: none;
    }
}

/* ---- 移动端 ---- */
@media (max-width: 768px) {
    .hg4-block {
        border-radius: 14px;
    }

    .hg4-head {
        padding: 12px 14px 10px;
    }

    .hg4-title {
        font-size: 17px;
    }

    .hg4-carousel {
        aspect-ratio: 4 / 3;
    }

    .hg4-caption {
        padding: 34px 14px 26px;
    }

    .hg4-cap-title {
        font-size: 17px;
    }

    .hg4-cap-desc {
        font-size: 12.5px;
    }

    .hg4-arrow {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        font-size: 20px;
    }

    .hg4-prev { left: 8px; }
    .hg4-next { right: 8px; }
}
