﻿
:root {
    --accent: #e8c547;
}

.main-slider {
    background-color: #FFF;
}

/* ========== 轮播容器 ========== */
.hero-carousel {
    position: relative;
    overflow: hidden;
    background: #111;
}

    /* ========== 16:9 撑高，保证图片完整 ========== */
    .hero-carousel .carousel-item {
        position: relative;
        height: 0;
        padding-top: 56.25%;
        overflow: hidden;
    }

        .hero-carousel .carousel-item img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            display: block;
        }

@media (min-width: 576px) {
    .hero-carousel .carousel-item {
        max-height: 420px;
    }
}

@media (min-width: 768px) {
    .hero-carousel .carousel-item {
        max-height: 520px;
    }
}

@media (min-width: 1200px) {
    .hero-carousel .carousel-item {
        max-height: 640px;
    }
}

/* ========== 遮罩 ========== */
.hero-carousel .carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient( to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.30) 45%, rgba(0,0,0,0.05) 100% );
    pointer-events: none;
    z-index: 1;
}

/* ========== 浮动文字 ========== */
.carousel-caption-custom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 1.5rem 1.25rem 3rem;
    text-align: left;
}

@media (min-width: 768px) {
    .carousel-caption-custom {
        padding: 2rem 3rem 3.5rem;
        max-width: 70%;
    }
}

@media (min-width: 1200px) {
    .carousel-caption-custom {
        padding: 2rem 5rem 4.5rem;
        max-width: 55%;
    }
}

.carousel-caption-custom .slide-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(232,197,71,0.10);
    border: 1px solid rgba(232,197,71,0.25);
    padding: 0.25em 0.9em;
    margin-bottom: 0.8rem;
    border-radius: 2px;
}

.carousel-caption-custom h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.3rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.carousel-caption-custom p {
    font-size: clamp(0.82rem, 1.4vw, 1rem);
    font-weight: 300;
    color: rgba(255,255,255,0.78);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.carousel-caption-custom .slide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: gap 0.3s ease, color 0.3s ease;
}

    .carousel-caption-custom .slide-link:hover {
        gap: 0.9rem;
        color: #fff;
    }

/* ========== 指示器 ========== */
.hero-carousel .carousel-indicators {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    margin: 0;
    padding: 0 0 0.9rem 1.25rem;
    justify-content: flex-start;
    gap: 0.45rem;
}

@media (min-width: 768px) {
    .hero-carousel .carousel-indicators {
        padding-left: 3rem;
        padding-bottom: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .hero-carousel .carousel-indicators {
        padding-left: 5rem;
        padding-bottom: 1.5rem;
    }
}

.hero-carousel .carousel-indicators [data-bs-target] {
    width: 30px;
    height: 3px;
    border: none;
    border-radius: 2px;
    background: rgba(255,255,255,0.30);
    opacity: 1;
    margin: 0;
    transition: width 0.4s ease, background 0.4s ease;
}

.hero-carousel .carousel-indicators .active {
    width: 44px;
    background: var(--accent);
}

/* ========== 箭头 ========== */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 44px;
    height: 44px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next {
    opacity: 1;
}

.hero-carousel .carousel-control-prev {
    left: 1.25rem;
}

.hero-carousel .carousel-control-next {
    right: 1.25rem;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 22px;
    height: 22px;
    background-size: 50%;
    filter: invert(1) drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}

@media (max-width: 575.98px) {
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next {
        display: none;
    }
}

/* ========== 进度条 ========== */
.carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.08);
    z-index: 4;
    pointer-events: none;
}

.carousel-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e8c547, #f0d76e);
}

/* ========== 文字入场动画 ========== */
.carousel-caption-custom .slide-tag,
.carousel-caption-custom h2,
.carousel-caption-custom p,
.carousel-caption-custom .slide-link {
    opacity: 0;
    transform: translateY(22px);
}

.carousel-item.active .slide-tag {
    animation: capUp 0.55s ease forwards;
    animation-delay: 0.15s;
}

.carousel-item.active h2 {
    animation: capUp 0.55s ease forwards;
    animation-delay: 0.35s;
}

.carousel-item.active p {
    animation: capUp 0.55s ease forwards;
    animation-delay: 0.50s;
}

.carousel-item.active .slide-link {
    animation: capUp 0.55s ease forwards;
    animation-delay: 0.65s;
}

@keyframes capUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
