/**
 * Owl Carousel 到 Swiper 兼容性样式
 * 
 * 这个CSS文件确保 Swiper 能够完美匹配原有的 Owl Carousel 视觉效果
 * 包含所有必要的样式映射和兼容性调整
 * 
 * 版本: 1.0.0
 * 创建时间: 2025年6月3日
 */

/* ==========================================================================
   基础 Swiper 样式重置和兼容性调整
   ========================================================================== */

/* 重置 Swiper 容器样式，使其与 Owl Carousel 行为一致 */
.swiper {
    width: 100%;
    height: auto;
    margin: 0;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}

.swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}

/* ==========================================================================
   Owl Carousel 兼容性样式
   ========================================================================== */

/* 模拟 Owl Carousel 的 .owl-carousel 样式 */
.swiper.owl-carousel,
.swiper.home__carousel,
.swiper.section__carousel,
.swiper.section__interview,
.swiper.section__live,
.swiper.section__series {
    display: block;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

/* 模拟 .owl-item 样式 */
.swiper-slide {
    min-height: 1px;
    -webkit-backface-visibility: hidden;
    -webkit-touch-callout: none;
    position: relative;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   导航按钮样式 - 兼容 Owl Carousel 的导航样式
   ========================================================================== */

/* 重置 Swiper 默认导航样式 */
.swiper-button-next,
.swiper-button-prev {
    position: absolute;
    top: 50%;
    width: auto;
    height: auto;
    margin-top: 0;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    user-select: none;
    transform: translateY(-50%);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    display: none; /* 隐藏默认箭头 */
}

/* 兼容自定义导航文本 */
.swiper-button-next,
.swiper-button-prev {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.swiper-button-next {
    right: 10px;
}

.swiper-button-prev {
    left: 10px;
}

/* 悬停效果 */
.swiper-button-next:hover,
.swiper-button-prev:hover {
    opacity: 0.7;
}

/* 禁用状态 */
.swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
}

/* ==========================================================================
   分页器样式 - 兼容 Owl Carousel 的点样式
   ========================================================================== */

/* 重置 Swiper 默认分页器样式 */
.swiper-pagination {
    position: static;
    transform: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin-top: 30px;
    line-height: 1;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 4px;
    border-radius: 3px;
    background-color: rgba(47, 128, 237, 0.5);
    opacity: 1;
    margin: 0 10px 0 0;
    transition: all 0.5s ease;
    cursor: pointer;
}

.swiper-pagination-bullet:last-child {
    margin-right: 0;
}

.swiper-pagination-bullet-active {
    width: 20px;
    background-color: #2f80ed;
}

/* ==========================================================================
   特定组件的样式适配
   ========================================================================== */

/* 首页轮播样式 */
.swiper.home__carousel .swiper-pagination {
    margin-top: 30px;
}

.swiper.home__carousel .swiper-slide {
    width: 290px; /* 兼容原有固定宽度 */
}

/* Section 轮播样式 */
.swiper.section__series .swiper-pagination {
    margin-top: 20px;
}

/* 全宽轮播样式 */
.swiper.full-width .swiper-button-next,
.swiper.full-width .swiper-button-prev {
    position: absolute;
    top: 30%;
    background: transparent;
    color: #ffffff;
}

.swiper.full-width .swiper-button-next i:before,
.swiper.full-width .swiper-button-prev i:before {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 100%;
    font-size: 1.875rem;
    font-weight: bold;
    line-height: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper.full-width .swiper-button-prev {
    left: 10px;
}

.swiper.full-width .swiper-button-next {
    right: 10px;
}

.swiper.full-width .swiper-pagination {
    margin-top: 1rem;
}

/* Portfolio 轮播样式 */
.swiper.portfolio-carousel.full-width .swiper-button-next,
.swiper.portfolio-carousel.full-width .swiper-button-prev {
    top: auto;
    bottom: 100%;
    color: #a7afb7;
    margin: 0;
    padding: 0 2px 14px 2px;
    transform: none;
}

.swiper.portfolio-carousel.full-width .swiper-button-next i,
.swiper.portfolio-carousel.full-width .swiper-button-prev i {
    text-align: center;
}

.swiper.portfolio-carousel.full-width .swiper-button-next i:before,
.swiper.portfolio-carousel.full-width .swiper-button-prev i:before {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    font-weight: normal;
    line-height: 32px;
}

/* ==========================================================================
   响应式兼容性
   ========================================================================== */

@media (max-width: 768px) {
    .swiper.home__carousel .swiper-slide {
        width: auto; /* 移动端自适应宽度 */
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        font-size: 20px;
    }
    
    .swiper.full-width .swiper-button-next i:before,
    .swiper.full-width .swiper-button-prev i:before {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        line-height: 40px;
    }
}

@media (min-width: 768px) and (max-width: 1200px) {
    .swiper.portfolio-carousel.full-width .swiper-button-next,
    .swiper.portfolio-carousel.full-width .swiper-button-prev {
        padding: 0 2px 19px 0;
    }
    
    .swiper.portfolio-carousel.full-width .swiper-button-next i:before,
    .swiper.portfolio-carousel.full-width .swiper-button-prev i:before {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        line-height: 20px;
    }
}

/* ==========================================================================
   回退样式 - 当 Swiper 初始化失败时的基本显示
   ========================================================================== */

.swiper-fallback {
    display: block !important;
    overflow-x: auto;
    white-space: nowrap;
}

.swiper-fallback > * {
    display: inline-block;
    white-space: normal;
    vertical-align: top;
    margin-right: 15px;
}

.swiper-fallback > *:last-child {
    margin-right: 0;
}

/* ==========================================================================
   过渡和动画兼容性
   ========================================================================== */

/* 平滑的过渡效果 */
.swiper-slide {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 淡入淡出效果兼容 */
.swiper.fade-effect .swiper-slide {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.swiper.fade-effect .swiper-slide-active {
    opacity: 1;
}

/* ==========================================================================
   RTL (Right-to-Left) 支持
   ========================================================================== */

.swiper[dir="rtl"] .swiper-button-next {
    left: 10px;
    right: auto;
}

.swiper[dir="rtl"] .swiper-button-prev {
    right: 10px;
    left: auto;
}

/* ==========================================================================
   可访问性增强
   ========================================================================== */

.swiper-button-next,
.swiper-button-prev {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.swiper-button-next:focus,
.swiper-button-prev:focus {
    outline: 2px solid rgba(47, 128, 237, 0.5);
    outline-offset: 2px;
}

.swiper-pagination-bullet:focus {
    outline: 2px solid rgba(47, 128, 237, 0.5);
    outline-offset: 2px;
}

/* ==========================================================================
   性能优化
   ========================================================================== */

.swiper,
.swiper-wrapper,
.swiper-slide {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU 加速 */
.swiper-wrapper {
    transform: translate3d(0px, 0px, 0px);
} 