/* 首页图集【方案 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-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f2f6fb;
}

.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;
}

.hg4-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 48px 20px 30px;
    background: linear-gradient(to top, rgba(8, 20, 35, .78), 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);
}

.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: 40px;
    height: 40px;
    margin-top: -20px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 22, 38, .38);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease;
}

.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 (max-width: 768px) {
    .hg4-block {
        border-radius: 14px;
    }

    .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; }
}
