/* Hero 区域样式 */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    min-height: 500px;
}

.hero-slider {
    position: relative;
    height: 100%;
    width: 100%;
}

.hero-slides {
    position: relative;
    height: 100%;
    width: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

.hero-text {
    max-width: 800px;
}

.hero-title {
    font-size: 4vw;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5vw;
    font-weight: 300;
    line-height: 1.5;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #000; /* 视频加载前的背景色 */
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* 默认隐藏视频 */
    transition: opacity 1s ease;
    position: relative;
    z-index: 1;
}

.hero-video.playing {
    opacity: 1; /* 视频播放时显示 */
}

.fallback-img {
    display: block; /* 默认显示 */
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.fallback-img.hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* 幻灯片控制 */
.slider-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

.prev-slide,
.next-slide {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.prev-slide:hover,
.next-slide:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    gap: 15px;
    padding: 0 10px;
}

.dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

.dot.active {
    background: transparent;
    border: 2px solid #fff;
}

.dot.active::after {
    background: #fff;
}

.dot:hover {
    transform: scale(1.2);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero {
        min-height: 450px;
    }
    .hero-title {
        font-size: 28px;
        padding: 0 15px;
        line-height: 1.4;
    }
    .hero-subtitle {
        font-size: 16px;
        padding: 0 20px;
    }
    .slider-controls {
        bottom: 30px;
        padding: 12px 20px;
        gap: 20px;
    }

    .prev-slide,
    .next-slide {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .dot {
        width: 14px;
        height: 14px;
    }

    .dot::after {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 350px;
    }
    .hero-title {
        font-size: 24px;
        padding: 0 10px;
        line-height: 1.4;
    }
    .hero-subtitle {
        font-size: 14px;
        padding: 0 15px;
    }
    .hero-content {
        padding: 0 15px;
    }
    .slider-controls {
        bottom: 20px;
        padding: 10px 15px;
        gap: 15px;
    }

    .prev-slide,
    .next-slide {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .dot {
        width: 12px;
        height: 12px;
    }

    .dot::after {
        width: 5px;
        height: 5px;
    }
    
    .hero-video {
        object-fit: cover;
        object-position: center;
        width: 100%;
        height: 100%;
    }
    
    .hero-background {
        background-color: #000; /* 视频加载前的背景色 */
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 350px;
    }
    .hero-title {
        font-size: 20px;
        padding: 0 8px;
        line-height: 1.4;
    }
    .hero-subtitle {
        font-size: 12px;
        padding: 0 10px;
    }
}

/* 低网速优化 */
.hero-slide.loading .hero-overlay {
    background: rgba(0, 0, 0, 0.5); /* 略微透明以便看到背景图 */
}

/* 视频加载状态 */
.hero-video.loading {
    opacity: 0;
}

.hero-video.loaded {
    opacity: 1;
    z-index: 2; /* 加载完成后显示在图片上层 */
    transition: opacity 1s ease;
}

/* 新增样式确保图片高质量 */
.hero-background img {
    max-width: 100%;
    height: 100%;
    object-fit: cover;
} 