/* ============================================================
 * 老故事 Wonder Vision - 首页专属样式 page-index.css
 * 仅首页 index.html 使用，通过 $pageCss 注入
 * 依赖 common.css（变量/容器/section 标题等）
 * ============================================================ */

/* ========== Banner 区域 ========== */
.wv-banner {
    /* 原设计为文字+视频的左右布局(display:flex)，现改为纯图片轮播 */
    /* background: linear-gradient(180deg, #c21807 0%, #8b0000 50%, #5a0000 100%); */
    background: #000;
    position: relative;
    /* min-height: 500px; */
    height: 420px;              /* 固定高度，供绝对定位的 .wv-banner-slide 填充 */
    overflow: hidden;
    /* display: flex; */
}

.wv-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.wv-banner-stars {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
}

.wv-banner-star-center {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
    border-radius: 50%;
}

.wv-banner-content {
    position: relative;
    z-index: 2;
    padding: 40px 20px;
    flex: 1;
}

.wv-banner-top {
    margin-bottom: 20px;
}

.wv-banner-tag {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.wv-banner-main {
    text-align: center;
}

.wv-banner-title,
.wv-banner-subtitle {
    color: var(--color-gold);
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-family: "STKaiti", "KaiTi", serif;
}

.wv-banner-subtitle {
    font-size: 52px;
}

.wv-banner-footer {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.wv-banner-footer-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
}

.wv-banner-links {
    display: flex;
    gap: 20px;
}

.wv-banner-links span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.wv-banner-links span:last-child {
    border-right: none;
}

.wv-banner-right {
    width: 220px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.wv-banner-video {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 20px 10px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.wv-video-play {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    padding-left: 5px;
}

.wv-banner-news {
    background: var(--color-primary);
    color: #ffffff;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 20px 20px;
    border-radius: 4px;
}

/* 首页 Banner 轮播（修复：原本缺少 slider/slide 样式导致图片竖向平铺） */
/* 轮播容器：铺满 .wv-banner 区域，作为绝对定位 slide 的定位父级 */
.wv-banner-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 每张幻灯片绝对堆叠，仅激活项显示，实现淡入淡出切换 */
.wv-banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.wv-banner-active {
    opacity: 1;
}

/* .wv-banner-active 已在上方定义 opacity:1，这里补充可点击 */
.wv-banner-slide.wv-banner-active {
    opacity: 1;
    pointer-events: auto;
}

.wv-banner-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.wv-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 首页 Banner 圆点指示器 */
.wv-banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.wv-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.wv-banner-dot.wv-dot-active {
    width: 24px;
    border-radius: 4px;
    background: #ffffff;
}

/* ========== 特色推荐 Featured (左:轮播图 右:视频) ========== */
.wv-featured {
    padding: 30px 0;
    background: var(--color-bg);
}

.wv-featured-container {
    display: flex;
    gap: 24px;
    align-items: stretch;
    height: 360px;
}

/* 左侧轮播图 */
.wv-featured-slider {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 360px;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.wv-featured-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.wv-featured-slide.wv-featured-active {
    opacity: 1;
    pointer-events: auto;
}

.wv-featured-slide a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.wv-featured-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wv-featured-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px 50px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
    color: #fff;
}

.wv-featured-caption h3 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.wv-featured-footer {
    font-size: 14px;
    opacity: 0.8;
    letter-spacing: 2px;
}

/* 左右导航箭头 */
.wv-featured-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    border-radius: 50%;
    transition: background 0.3s;
    user-select: none;
}

.wv-featured-nav:hover {
    background: rgba(220, 38, 38, 0.8);
}

.wv-featured-prev { left: 16px; }
.wv-featured-next { right: 16px; }

/* 底部圆点指示器 */
.wv-featured-dots {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.wv-featured-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.wv-featured-dot.wv-featured-dot-active {
    background: #fff;
    width: 30px;
    border-radius: 6px;
}

/* 右侧视频 */
.wv-featured-video {
    width: 350px;
    height: 360px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wv-featured-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* ========== 首页频道栏目 ========== */
.wv-channel-header {
    align-items: center;
    gap: 24px;
    /* 覆盖基础 .wv-section-header 的 space-between，改用 margin 精确控制三块位置 */
    justify-content: flex-start;
}

.wv-channel-header .wv-section-title {
    flex-shrink: 0;
}

.wv-channel-tabs {
    display: flex;
    gap: 0;
    /* margin-left:auto 把 tabs 从左侧标题旁推到右侧区域 */
    margin-left: auto;
}

.wv-channel-tab {
    padding: 6px 18px;
    font-size: 14px;
    color: var(--color-text-light);
    white-space: nowrap;
    border-radius: 2px 2px 0 0;
}

.wv-tab-active {
    background: var(--color-primary);
    color: #ffffff;
}

.wv-channel-header .wv-section-more {
    /* 与 tabs 之间留出间距，使 tabs 落在中右区域、“更多”在其右侧 */
    /* margin-left: 10px; */
    flex-shrink: 0;
}

.wv-channel-content {
    display: flex;
    gap: 24px;
    flex-direction: column;
}

/* 基础panel样式 - 默认隐藏 */
.wv-channel-panel {
    display: none;
}

.wv-channel-image {
    width: 400px;
    height: 300px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wv-channel-image-text {
    text-align: center;
    color: #ffffff;
}

.wv-channel-image-text span {
    display: block;
    margin-bottom: 8px;
}

.wv-channel-image-text span:first-child {
    font-size: 20px;
    font-weight: 700;
}

.wv-channel-image-text span:nth-child(2) {
    font-size: 32px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.wv-channel-image-text span:last-child {
    font-size: 14px;
    opacity: 0.9;
}

.wv-channel-info {
    flex: 1;
}

.wv-channel-desc {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.8;
    text-indent: 2em;
    margin-bottom: 20px;
    /* 限制简介行数，超出部分隐藏并显示省略号（对齐参考图2，约与左侧图片等高） */
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    height: 75px;
}

.wv-channel-gallery {
    display: flex;
    gap: 16px;
}

.wv-gallery-item {
    /* flex: 1; */
    height: 140px;
    width: 200px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
}

.wv-gallery-item > img{
    width: 200px;
    height: 140px;
}

/* 首页频道栏目内容布局 */
.wv-home-channel-content {
    display: block !important;
}

.wv-home-channel-content .wv-channel-panel.wv-channel-panel-active,
.wv-home-channel-content .wv-panel-1 {
    display: flex !important;
    gap: 24px;
    width: 100%;
}

.wv-home-channel-content > * {
    width: auto !important;
}

/* 首页“栏目简介”标题 */
.wv-channel-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    /* margin-bottom: 20px; */
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-border);
    width: 100%;
    display: block;
    writing-mode: horizontal-tb;
}

/* ========== 频道公告（首页） ========== */
.wv-announcement {
    display: flex;
    gap: 60px;
}

.wv-announcement-left,
.wv-announcement-right {
    flex: 1;
}

.wv-announcement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    font-size: 14px;
    color: var(--color-text);
    border-bottom: 1px dashed var(--color-border);
}

.wv-announcement-item:last-child {
    border-bottom: none;
}

.wv-announcement-item:hover {
    color: var(--color-primary);
}

.wv-announcement-dot {
    color: var(--color-primary);
    font-size: 10px;
    flex-shrink: 0;
}

/* ========== 频道合作（首页） ========== */
.wv-cooperation {
    display: flex;
    gap: 12px;
}

.wv-cooperation-item {
    flex: 1;
    height: 160px;
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.wv-cooperation-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.wv-cooperation-title {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

/* ========== 精彩专题（首页，模板中当前注释隐藏，样式保留便于恢复） ========== */
.wv-special {
    display: flex;
    /* gap: 24px; */
}

.wv-special-item-link {
    flex: 1;
    display: block;
    text-decoration: none;
    color: inherit;
}

.wv-special-item-link:hover .wv-special-title {
    color: var(--color-primary);
}

.wv-special-item {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.wv-special-image {
    width: 250px;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

.wv-special-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wv-special-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.95);
}

.wv-special-logo > span:first-child {
    font-size: 22px;
}

.wv-special-logo div p {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.wv-special-logo div p:last-child {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

.wv-special-info {
    /* flex: 1; */
    display: flex;
    flex-direction: column;
}

.wv-special-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.wv-special-subtitle {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 12px;
}

.wv-special-tags {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.wv-special-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-light);
    padding: 2px 0;
}

.wv-tag-hot {
    font-size: 10px;
    padding: 1px 5px;
    background: var(--color-primary);
    color: #ffffff;
    border-radius: 2px;
    font-weight: 600;
    flex-shrink: 0;
}

.wv-special-tag:hover {
    color: var(--color-primary);
}

/* ========== 影像中国（首页块，模板中当前 {if false} 隐藏，样式保留便于恢复） ========== */
.wv-image-content {
    display: flex;
    gap: 20px;
}

.wv-image-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.wv-image-item:hover {
    transform: translateY(-4px);
}

.wv-image-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 8px 24px;
    background: #dc2626;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 4px 4px 0 0;
    margin-bottom: 12px;
}

.wv-image-photo {
    width: 100%;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wv-image-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== 友情链接 ========== */
.wv-friend-link-section {
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.wv-friend-link-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.wv-friend-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.wv-friend-link-img {
    width: 180px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    /* border: 1px solid var(--color-border); */
    border-radius: 4px;
    overflow: hidden;
}

.wv-friend-link-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wv-friend-link-img span {
    font-size: 14px;
    color: var(--color-text);
}

.wv-friend-link-item p {
    font-size: 13px;
    color: var(--color-text);
    margin: 0;
}

/* ========== 首页响应式 ========== */

/* --- 平板 Pad (769~1024px)：整体收窄、大网格降列，保持左右结构 --- */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Banner：高度随图片比例自适应，完整显示不裁切、不变形 */
    .wv-banner {
        height: auto;
    }
    .wv-banner-slider {
        position: relative;
        height: auto;
    }
    .wv-banner-slide {
        position: absolute;
    }
    .wv-banner-slide.wv-banner-active {
        position: relative;
    }
    .wv-banner-slide img {
        height: auto;
        object-fit: contain;
    }
    /* 特色推荐：Pad 不显示左侧轮播，仅保留右侧视频并占满整行 */
    .wv-featured-slider {
        display: none;
    }
    .wv-featured-container {
        height: auto;
    }
    .wv-featured-video {
        width: 100%;
        height: 360px;
    }
    /* 频道栏目图文：左图缩小，右侧画廊图等比缩 */
    .wv-channel-image {
        width: 320px;
        height: 240px;
    }
    .wv-gallery-item,
    .wv-gallery-item > img {
        width: 100%;
        height: auto;
    }
    .wv-channel-gallery {
        gap: 12px;
    }
    /* 公告两列间距收窄 */
    .wv-announcement {
        gap: 30px;
    }
    /* 精彩专题：每条内部图文改上下，避免 250px 固定图在窄屏挤压文字 */
    .wv-special-item {
        flex-direction: column;
        gap: 12px;
    }
    .wv-special-image {
        width: 100%;
        height: 200px;
        min-height: 0;
    }
    /* 影像中国：3 列改 2 列换行 */
    .wv-image-content {
        flex-wrap: wrap;
    }
    .wv-image-item {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
}

/* --- 手机 (≤768px)：全部单列/换行，去除固定宽高防溢出 --- */
@media (max-width: 768px) {
    /* Banner：高度随图片比例自适应，横幅图完整显示不裁切、不变形 */
    .wv-banner {
        height: auto;
    }
    .wv-banner-slider {
        position: relative;
        height: auto;
    }
    .wv-banner-slide {
        position: absolute;
    }
    .wv-banner-slide.wv-banner-active {
        position: relative;
    }
    .wv-banner-slide img {
        height: auto;
        object-fit: contain;
    }

    .wv-banner-title,
    .wv-banner-subtitle {
        font-size: 28px;
    }

    /* 特色推荐：手机不显示左侧轮播，仅保留右侧视频 */
    .wv-featured-container {
        flex-direction: column;
        height: auto;
        gap: 16px;
    }
    .wv-featured-slider {
        display: none;
    }
    .wv-featured-video {
        width: 100%;
        height: 210px;
    }

    /* 频道栏目：标题栏换行，tabs 改为每行 3 个的网格 */
    .wv-channel-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .wv-channel-tabs {
        margin-left: 0;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .wv-channel-tab {
        text-align: center;
        border-radius: 4px;
        background: #f0f0f0;
        padding: 10px 6px;
    }
    .wv-channel-tab.wv-tab-active {
        background: var(--color-primary);
        color: #ffffff;
    }
    .wv-channel-header .wv-section-more {
        margin-left: auto;
    }
    /* 图文区改上下：图片满宽，画廊自适应 3 等分 */
    .wv-home-channel-content .wv-channel-panel.wv-channel-panel-active,
    .wv-home-channel-content .wv-panel-1 {
        flex-direction: column;
        gap: 16px;
    }
    .wv-channel-image {
        width: 100%;
        height: 200px;
    }
    .wv-channel-desc {
        height: auto;
    }
    .wv-channel-gallery {
        gap: 8px;
    }
    .wv-gallery-item {
        flex: 1;
        width: auto;
        height: auto;
    }
    .wv-gallery-item > img {
        width: 100%;
        height: auto;
    }

    /* 公告：单列 */
    .wv-announcement {
        flex-direction: column;
        gap: 0;
    }

    /* 合作：两列换行 */
    .wv-cooperation {
        flex-wrap: wrap;
    }
    .wv-cooperation-item {
        flex: 1 1 calc(50% - 6px);
        min-width: calc(50% - 6px);
        height: 120px;
    }

    /* 精彩专题：整体竖排；每条内部图文改上下，图片满宽 */
    .wv-special {
        flex-direction: column;
        gap: 20px;
    }
    .wv-special-item {
        flex-direction: column;
        gap: 12px;
    }
    .wv-special-image {
        width: 100%;
        height: 180px;
        min-height: 0;
    }

    /* 影像中国：单列，图片降高 */
    .wv-image-content {
        flex-direction: column;
        gap: 16px;
    }
    .wv-image-photo {
        height: 180px;
    }

    /* 友情链接：图片自适应，一行 2~3 个 */
    .wv-friend-link-img {
        width: 140px;
        height: 64px;
    }
}

/* --- 小屏手机 (≤480px)：合作/友链再降密度 --- */
@media (max-width: 480px) {
    .wv-banner-title,
    .wv-banner-subtitle {
        font-size: 22px;
    }
    .wv-featured-slider {
        height: 180px;
    }
    .wv-featured-video {
        height: 190px;
    }
    .wv-friend-link-img {
        width: 110px;
        height: 54px;
    }
}
