/**
 * 声网幻灯片样式 - 性能优化版本
 * 
 * @package ShengWang
 * @since 1.0.0
 */

/* ========================================
   基础样式
======================================== */

.sw_slideshow_wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* 主标题样式 */
.sw_slideshow_main_title {
    font-weight: 600;
    font-size: 48px;
    line-height: 56px;
    color: #181F27;
    text-align: center;
    margin: 0 0 24px 0;
}

/* 响应式主标题 */
@media (max-width: 1024px) {
    .sw_slideshow_main_title {
        font-size: 42px;
        line-height: 50px;
    }
}

@media (max-width: 767px) {
    .sw_slideshow_main_title {
        font-size: 32px;
        line-height: 38px;
        margin-bottom: 16px;
    }
}

/* ========================================
   导航按钮
======================================== */

.sw_slideshow_nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .sw_slideshow_nav {
        gap: 8px;
        margin-bottom: 24px; /* 保持原有间距 */
    }
}

.sw_slide_nav_button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(24, 31, 39, 0.50);
    border-radius: 50px;
    color: #181F27;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    min-width: 120px;
    /* 硬件加速 */
    transform: translateZ(0);
    will-change: background-color, color, border-color;
}

.sw_slide_nav_button:hover {
    background: #181F27;
    color: #FFFFFF;
    border-color: #181F27;
}

.sw_slide_nav_button.sw-active {
    background: #181F27;
    color: #FFFFFF;
    border-color: #181F27;
}

.sw_slide_nav_button_text {
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
}

/* 移除按钮响应式缩小，保持原有大小 */

/* ========================================
   幻灯片容器
======================================== */

.sw_slideshow {
    position: relative;
    width: 100%;
    height: 467px;
    overflow: hidden;
    border-radius: 32px;
    background: #1D2129;
    /* 硬件加速 */
    transform: translateZ(0);
    will-change: transform;
}

@media (max-width: 1024px) {
    .sw_slideshow {
        height: 400px;
    }
}

@media (max-width: 767px) {
    .sw_slideshow {
        height: 350px;
        /* 保持原有圆角大小，不缩小 */
    }
}

/* ========================================
   幻灯片内容
======================================== */

.sw_slideshow_container {
    position: relative;
    width: 100%;
    height: 100%;
}

.sw_slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    z-index: 1;
    /* 硬件加速 */
    transform: translateZ(0);
    will-change: opacity, visibility;
}

.sw_slide.sw-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.sw_slide_background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.sw_slide_background img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    /* 硬件加速 */
    transform: translateZ(0);
}

/* 移动端图片控制 */
.sw_slide_image_mobile {
    display: none;
}

@media (max-width: 480px) {
    .sw_slide_image_desktop {
        display: none;
    }
    
    .sw_slide_image_mobile {
        display: block;
    }
}

.sw_slide_content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 48px;
}

@media (max-width: 767px) {
    .sw_slide_content {
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .sw_slide_content {
        padding: 24px;
    }
}

.sw_slide_text {
    max-width: 100%;
    overflow: hidden;
    text-align: left;
}

.sw_slide_title {
    font-size: 36px;
    font-weight: 500;
    line-height: 44px;
    margin: 0 0 8px 0;
    color: #FFFFFF;
}

@media (max-width: 1024px) {
    .sw_slide_title {
        font-size: 32px;
        line-height: 40px;
    }
}

@media (max-width: 767px) {
    .sw_slide_title {
        font-size: 28px;
        line-height: 36px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .sw_slide_title {
        font-size: 24px;
        line-height: 32px;
    }
}

.sw_slide_description {
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1024px) {
    .sw_slide_description {
        font-size: 14px;
        line-height: 22px;
    }
}

@media (max-width: 767px) {
    .sw_slide_description {
        font-size: 13px;
        line-height: 20px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .sw_slide_description {
        font-size: 12px;
        line-height: 18px;
    }
}

/* ========================================
   简化的动画效果 - 性能优化
======================================== */

/* 移除复杂的keyframes动画，使用简单的opacity过渡 */

/* ========================================
   无障碍支持
======================================== */

.sw_slideshow:focus-within {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

.sw_slide_nav_button:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* ========================================
   加载状态 - 简化版本
======================================== */

.sw_slideshow.sw-loading {
    opacity: 0.7;
}

.sw_slideshow.sw-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 20;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}