/* 英雄区轮播样式 - 游戏网站风格（动感）*/
/* 支持所有浏览器：Chrome, Firefox, Safari, Edge, IE11+ */
/* 避免闪屏，过渡自然 */

/* ========================================
   1. 轮播容器基础样式
   ======================================== */
.carousel {
    position: relative;
    overflow: hidden;
    background: var(--gaming-black); /* 防止闪白 */
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ========================================
   2. 轮播项 - 适配 Fade 模式（修正布局消失问题）
   ======================================== */
.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    /* 硬件加速 */
    will-change: opacity;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: block;
}

.carousel-fade .carousel-item {
    opacity: 0 !important;
    transition-property: opacity !important;
    transition-duration: 1.2s !important;
    transform: none !important;
    -webkit-transform: none !important;
}

.carousel-fade .carousel-item.active,
.carousel-fade .carousel-item-next.carousel-item-start,
.carousel-fade .carousel-item-prev.carousel-item-end {
    z-index: 1;
    opacity: 1 !important;
}

.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
    z-index: 0;
    opacity: 0 !important;
    transition: opacity 1.2s !important;
}

/* ========================================
   3. 徽章动画 - 缩放弹跳进入（优化：更慢，更有力）
   ======================================== */
.hero-badge {
    opacity: 0 !important;
    -webkit-transform: scale(0.5) translateY(-20px) !important;
    transform: scale(0.5) translateY(-20px) !important;
    filter: blur(10px);
    -webkit-transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.hero-badge.animate-in {
    opacity: 1 !important;
    -webkit-transform: scale(1) translateY(0) !important;
    transform: scale(1) translateY(0) !important;
    filter: blur(0);
}

/* ========================================
   4. 大标题动画 - 优雅 3D 进场（更自然，更有质感）
   ======================================== */
.hero-title {
    opacity: 0 !important;
    -webkit-transform: translateY(50px) perspective(1000px) rotateX(-20deg) scale(0.95) !important;
    transform: translateY(50px) perspective(1000px) rotateX(-20deg) scale(0.95) !important;
    filter: blur(15px);
    -webkit-transition: all 1.5s cubic-bezier(0.19, 1, 0.22, 1) !important;
    transition: all 1.5s cubic-bezier(0.19, 1, 0.22, 1) !important;
    text-shadow: 0 0 0 rgba(59, 130, 246, 0);
}

.hero-title.animate-in {
    opacity: 1 !important;
    -webkit-transform: translateY(0) perspective(1000px) rotateX(0) scale(1) !important;
    transform: translateY(0) perspective(1000px) rotateX(0) scale(1) !important;
    filter: blur(0);
}

/* 移除导致闪烁的 titleGlow 动画，或将其改为不影响透明度的效果 */
@keyframes titleGlow {
    0% { text-shadow: 0 0 0 rgba(59, 130, 246, 0); }
    50% { text-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
    100% { text-shadow: 0 0 10px rgba(59, 130, 246, 0.2); }
}

/* ========================================
   5. 徽章与描述文字动画 - 柔和浮现（加粗）
   ======================================== */
.hero-slide .section-subtitle, .hero-subtitle, .lead {
    opacity: 0 !important;
    -webkit-transform: translateY(30px) !important;
    transform: translateY(30px) !important;
    filter: blur(10px);
    -webkit-transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
    font-weight: 600 !important; /* 加粗，确保清晰 */
    color: rgba(255, 255, 255, 0.9) !important;
}

.hero-slide .section-subtitle.animate-in, .hero-subtitle.animate-in, .lead.animate-in {
    opacity: 1 !important;
    -webkit-transform: translateY(0) !important;
    transform: translateY(0) !important;
    filter: blur(0);
}

/* ========================================
   6. 按钮动画 - 弹性上浮
   ======================================== */
.hero-btn {
    opacity: 0 !important;
    -webkit-transform: translateY(40px) scale(0.9) !important;
    transform: translateY(40px) scale(0.9) !important;
    filter: blur(5px);
    -webkit-transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

.hero-btn.animate-in {
    opacity: 1 !important;
    -webkit-transform: translateY(0) scale(1) !important;
    transform: translateY(0) scale(1) !important;
    filter: blur(0);
}

/* ========================================
   7. 背景平滑切换与Ken Burns效果（优化：全屏铺满）
   ======================================== */
.hero-slide {
    position: relative;
    overflow: hidden;
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    min-height: 450px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* 移除这里的 transition，避免与 Ken Burns 动画冲突导致残影 */
}

/* 移动端高度适配 */
@media (max-width: 767px) {
    .hero-slide {
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
        min-height: 400px;
    }
}

.carousel-fade .carousel-item {
    transition-duration: 1.2s; /* 变慢一点，更平滑 */
    transition-property: opacity;
}

.carousel-item.active .hero-slide {
    animation: kenBurnsDramatic 30s linear infinite alternate;
}

@keyframes kenBurnsDramatic {
    0% { transform: scale(1.02); } /* 稍微大一点点作为起点，防止边缘 sub-pixel 间隙 */
    100% { transform: scale(1.12); }
}

/* ========================================
   8. 按钮风格统一化 (Unified Button Styles)
   ======================================== */
.hero-btn .btn {
    padding: 12px 40px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: 54px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 立即购买 - 主按钮 */
.btn-more-products {
    background: var(--gaming-gradient) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

.btn-more-products:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5), 0 0 15px var(--gaming-glow) !important;
}

/* 了解更多 - 次按钮 */
.btn-learn-more {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.btn-learn-more:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: white !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* 动画时间轴辅助类 */
.anim-delay-200 { animation-delay: 0.2s !important; }
.anim-delay-400 { animation-delay: 0.4s !important; }
.anim-delay-600 { animation-delay: 0.6s !important; }
.anim-delay-800 { animation-delay: 0.8s !important; }

/* 进场动画由 JS 触发 .animate-in 类控制，此处不再定义重复动画 */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 强制隐藏非激活状态下的动画元素，防止残影叠加 */
.carousel-item:not(.active) .hero-badge,
.carousel-item:not(.active) .hero-title,
.carousel-item:not(.active) .hero-subtitle,
.carousel-item:not(.active) .section-subtitle,
.carousel-item:not(.active) .lead,
.carousel-item:not(.active) .hero-btn {
    opacity: 0 !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
}

/* ========================================
   8. 响应式字体与样式增强 (Typography)
   ======================================== */
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
    margin-bottom: 1.5rem !important;
    color: white !important;
}

.hero-subtitle, .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gaming-blue) !important;
    margin-bottom: 1rem !important;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle, .lead { font-size: 1.1rem; }
}

@media (max-width: 767px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle, .lead { font-size: 1rem; }
    .hero-btn { flex-direction: column; width: 100%; max-width: 300px; margin: 0 auto; }
    .hero-btn .btn { width: 100%; justify-content: center; }
}

/* ========================================
   9. 按钮交互效果 (Button Interactions)
   ======================================== */
.hero-btn .btn {
    position: relative;
    overflow: hidden;
}

.hero-btn .btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: 0.5s;
    opacity: 0;
}

.hero-btn .btn:hover::after {
    left: 100%;
    opacity: 1;
}

/* ========================================
   10. 轮播控制按钮 (Carousel Controls)
   ======================================== */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gaming-glass) !important;
    border: 1px solid var(--gaming-border) !important;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: all 0.4s ease;
    z-index: 20;
}

.carousel-control-prev { left: 30px; }
.carousel-control-next { right: 30px; }

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: var(--gaming-blue) !important;
    border-color: var(--gaming-blue) !important;
    transform: translateY(-50%) scale(1.1);
}

/* ========================================
   11. 响应式优化 - 使用rem单位
   ======================================== */
/* 平板端已移除 991px 限制，推迟到 767px */
@media (max-width: 767px) {
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
    
    .hero-title {
        font-size: 2.25rem; /* 36px */
    }
    
    .hero-subtitle {
        font-size: 1.125rem; /* 18px */
    }
    
    .hero-badge {
        font-size: 0.8rem;
    }
}

/* ========================================
   12. 遮罩和发光效果 (Overlay & Glow)
   ======================================== */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(2, 6, 23, 0.8) 0%, 
        rgba(2, 6, 23, 0.4) 50%, 
        rgba(2, 6, 23, 0.2) 100%
    );
    z-index: 1;
}

.hero-glow-home {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gaming-blue) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    pointer-events: none;
    z-index: 2;
}

/* 指示器样式优化 */
.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background-color: var(--gaming-blue);
    transform: scale(1.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 767px) {
    .hero-badge {
        font-size: 0.7rem; /* 11.2px */
        padding: 0.35rem 0.85rem !important;
        margin-bottom: 0.6rem;
    }
    
    /* 小屏手机按钮优化 */
    .hero-btn .btn {
        font-size: 0.85rem;
        padding: 0.65rem 1.5rem !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        display: flex !important;
    }
}

/* ========================================
   12. 性能优化 - 硬件加速
   ======================================== */
.carousel-item,
.hero-slide,
.hero-title,
.hero-subtitle,
.hero-btn,
.hero-badge {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    -moz-perspective: 1000px;
    -ms-perspective: 1000px;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* ========================================
   13. 防止闪屏的关键设置
   ======================================== */
/* 确保所有轮播项始终可见，只是位置不同 */
.carousel-item {
    visibility: visible !important;
    display: block !important;
}

/* 平滑渲染 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   14. IE11 兼容性
   ======================================== */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .hero-title {
        -ms-transform: translateX(50%);
        transform: translateX(50%);
    }
    
    .hero-title.animate-in {
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    
    .hero-subtitle {
        -ms-transform: translateX(-50%);
        transform: translateX(-50%);
    }
    
    .hero-subtitle.animate-in {
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    
    .hero-badge {
        -ms-transform: scale(0);
        transform: scale(0);
    }
    
    .hero-badge.animate-in {
        -ms-transform: scale(1);
        transform: scale(1);
    }
    
    .hero-btn {
        -ms-transform: translateY(30px);
        transform: translateY(30px);
    }
    
    .hero-btn.animate-in {
        -ms-transform: translateY(0);
        transform: translateY(0);
    }
}
