/**
 * Banner — 对齐 LibTV coverflow：左右推进 + 中间压住两侧 + 外缘贴齐内容栏
 * 参考 https://www.liblib.tv/ banner-coverflow-swiper 参数
 */

.banner-section {
    width: 100%;
    margin: 0 0 28px;
    padding: 0 0 4px;
    position: relative;
    box-sizing: border-box;
    /* 裁到主内容栏；侧卡外缘贴齐此处，不被二次裁切 */
    overflow: hidden;
}

.banner-stage {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 8px 0 0;
    box-sizing: border-box;
    overflow: visible;
}

.banner-swiper {
    position: relative;
    z-index: 1;
    overflow: visible;
    padding-bottom: 40px;
}

.banner-swiper .swiper-wrapper {
    align-items: stretch;
}

/* 宽度由 slidesPerView 决定；侧卡显隐由 JS 按 progress 控制，避免初始缺 next 类导致一侧空白 */
.banner-slide {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    box-sizing: border-box;
    height: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.banner-slide.banner-slide-show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.banner-slide.swiper-slide-active {
    z-index: 3;
}

.banner-slide.swiper-slide-prev,
.banner-slide.swiper-slide-next {
    z-index: 1;
}

.banner-slide.clickable {
    cursor: pointer;
}

.banner-slide.clickable:hover .banner-img,
.banner-slide.clickable:hover .banner-media {
    filter: brightness(1.04);
}

.banner-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    background: #0c0c0e;
    transition: filter 0.25s ease;
}

.banner-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    background: #0c0c0e;
    transition: filter 0.25s ease;
}

.banner-media .banner-img,
.banner-media .banner-inline-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    border: none;
    box-shadow: none;
    border-radius: 16px;
    background: transparent;
}

.banner-inline-video {
    z-index: 1;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.banner-slide-video.is-playing .banner-inline-video,
.banner-slide-video-media .banner-inline-video {
    opacity: 1;
}

.banner-slide-video.is-playing .banner-poster {
    opacity: 0;
}

.banner-media-poster-only .banner-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    opacity: 1;
}

.banner-slide-click-video .banner-play-badge {
    opacity: 1;
}

.banner-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.banner-play-badge::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 18px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

.banner-slide-video.is-playing .banner-play-badge {
    opacity: 0;
}

.banner-slide.swiper-slide-active .banner-img,
.banner-slide.swiper-slide-active .banner-media {
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(201, 255, 133, 0.12);
}

.banner-title {
    padding: 12px 8px 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.banner-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #252530 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* coverflow 自带阴影层，略压暗避免过曝 */
.banner-slide .swiper-slide-shadow-left,
.banner-slide .swiper-slide-shadow-right {
    border-radius: 16px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.35), transparent);
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50% !important;
    backdrop-filter: blur(6px);
    transition: background 0.2s, border-color 0.2s !important;
    z-index: 12;
    margin-top: 0;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(201, 255, 133, 0.16) !important;
    border-color: rgba(201, 255, 133, 0.35);
}

.banner-prev::after,
.banner-next::after {
    display: none !important;
}

.banner-prev img,
.banner-next img {
    width: 16px;
    height: 16px;
}

.banner-prev img {
    transform: rotate(180deg);
}

.banner-prev {
    left: 4px !important;
}

.banner-next {
    right: 4px !important;
}

.banner-dots {
    bottom: 2px !important;
    z-index: 10;
}

.banner-dots .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transition: all 0.3s;
    border-radius: 5px;
    cursor: pointer;
}

.banner-dots .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.5);
}

.banner-dots .swiper-pagination-bullet-active {
    background: #C9FF85;
    width: 28px;
    border-radius: 5px;
}

/* 视频弹窗 */
.banner-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.banner-video-wrap {
    position: relative;
    width: 90%;
    max-width: 960px;
}

.banner-video-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.banner-video-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.banner-video-close svg {
    width: 20px;
    height: 20px;
}

.banner-video-player {
    width: 100%;
    border-radius: 12px;
    outline: none;
    background: #000;
    max-height: 80vh;
}

@media (max-width: 768px) {
    .banner-section {
        margin-bottom: 12px;
    }
    .banner-swiper {
        padding-bottom: 28px;
    }
    .banner-img,
    .banner-media,
    .banner-placeholder {
        border-radius: 12px;
    }
    .banner-play-badge {
        width: 44px;
        height: 44px;
        margin: -22px 0 0 -22px;
    }
    .banner-play-badge::before {
        left: 17px;
        top: 14px;
        border-width: 8px 0 8px 12px;
    }
    .banner-prev,
    .banner-next {
        display: none !important;
    }
    .banner-title {
        font-size: 12px;
        padding: 10px 0 0;
    }
    .banner-dots .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    .banner-dots .swiper-pagination-bullet-active {
        width: 20px;
    }
}

[data-theme="light"] .banner-img,
[data-theme="light"] .banner-media {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .banner-slide.swiper-slide-active .banner-img,
[data-theme="light"] .banner-slide.swiper-slide-active .banner-media {
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .banner-title {
    color: #1a1a1a;
    text-shadow: none;
}

[data-theme="light"] .banner-placeholder {
    background: linear-gradient(135deg, #f4f4f5 0%, #e5e7eb 100%);
}

[data-theme="light"] .banner-prev,
[data-theme="light"] .banner-next {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: #e5e7eb;
}

[data-theme="light"] .banner-prev img,
[data-theme="light"] .banner-next img {
    filter: brightness(0);
}

[data-theme="light"] .banner-dots .swiper-pagination-bullet {
    background: rgba(0, 0, 0, 0.30);
}

[data-theme="light"] .banner-dots .swiper-pagination-bullet-active {
    background: rgba(0, 0, 0, 0.70);
}
