/* ============================================================
 * 老故事 Wonder Vision - 公共样式 common.css
 * 所有页面共用：CSS变量 / 基础重置 / 容器 / Header / Footer /
 *              通用 Section 标题 / 分页
 * 页面专属样式请拆到 page-*.css，通过 base.html 的 $pageCss 注入
 * ============================================================ */

/* ========== CSS 变量 ========== */
:root {
    --color-primary: #dc2626;
    --color-primary-dark: #b91c1c;
    --color-primary-light: #ef4444;
    --color-gold: #fbbf24;
    --color-gold-dark: #d97706;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-border: #e5e7eb;
    --color-footer: #1a1a1a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --container-width: 1200px;
    --header-height: 56px;
    --transition: all 0.3s ease;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== 通用容器 ========== */
.wv-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Header 顶部导航 ========== */
.wv-header {
    background: #ffffff;
}

.wv-header-top {
    /* padding: 16px 0; */
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wv-header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wv-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wv-header-logo-img {
    width: 100px;
    height: 100px;
    display: block;
}

.wv-nav {
    display: flex;
    align-items: center;
}

.wv-nav-item {
    padding: 12px 24px;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    transition: var(--transition);
}

.wv-nav-item:hover {
    color: #d41418;
}

.wv-nav-active {
    color: #d41418 !important;
    font-weight: 700;

}

.wv-header-bottom {
    height: 4px;
    background: #d41418;
}

/* ========== 面包屑（仅手机端显示，位于 Banner 下方，告知当前所在页面） ========== */
.wv-breadcrumb {
    display: none;                 /* PC/Pad 隐藏，仅手机端媒体查询里显示 */
    background: #f7f7f7;
    border-bottom: 1px solid var(--color-border);
}

.wv-breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    font-size: 13px;
    color: var(--color-text-light);
}

.wv-breadcrumb-home {
    color: var(--color-text-light);
}

.wv-breadcrumb-home:hover {
    color: var(--color-primary);
}

.wv-breadcrumb-sep {
    color: #c0c0c0;
    font-size: 12px;
}

.wv-breadcrumb-current {
    color: var(--color-text);
    font-weight: 600;
}

@media (max-width: 768px) {
    .wv-breadcrumb {
        display: block;
    }
}

/* ========== 汉堡菜单按钮（默认隐藏，仅手机端显示） ========== */
.wv-menu-toggle {
    display: none;               /* PC/Pad 隐藏，手机端媒体查询里改为 flex */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.wv-menu-toggle-bar {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: #d41418;
    transition: var(--transition);
}

/* 展开态：三横线变叉号 */
.wv-menu-toggle.wv-menu-toggle-open .wv-menu-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.wv-menu-toggle.wv-menu-toggle-open .wv-menu-toggle-bar:nth-child(2) {
    opacity: 0;
}
.wv-menu-toggle.wv-menu-toggle-open .wv-menu-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ========== 手机端固定底栏 + 分享浮层（默认隐藏，仅手机端显示） ========== */
.wv-mobile-bar {
    display: none;               /* PC/Pad 隐藏，手机端媒体查询里改为 flex */
}

.wv-share-mask {
    display: none;               /* 默认隐藏，点击"分享本站"时由 JS 加 open 类显示 */
}

/* ========== 通用 Section ========== */
.wv-section {
    padding: 30px 0;
    /* border-bottom: 1px solid var(--color-border); */
}

.wv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    /* 背景图 index_fl_title.png 原尺寸 1200*40，此前用 100% 100% 拉伸导致变形。
       固定高度 40px 使其与图片原始宽高比一致；padding 只留左右，避免撑高 */
    height: 40px;
    padding: 0 16px;
    box-sizing: border-box;
    background: url('/static/img/index_fl_title.png') no-repeat center center;
    background-size: 100% 100%;
}

.wv-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #d41418;
    padding-left: 40px;
}

.wv-section-icon {
    font-size: 16px;
}

.wv-section-en {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-light);
    margin-left: 8px;
}

.wv-section-more {
    font-size: 13px;
    color: var(--color-text-light);
}

.wv-section-more:hover {
    color: var(--color-primary);
}

/* ========== 分页 ========== */
.wv-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 30px 0;
}

.wv-page-btn,
.wv-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--color-text-light);
    background: #f5f5f5;
    border-radius: 2px;
    transition: var(--transition);
}

.wv-page-btn:hover,
.wv-page-num:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.wv-page-active {
    background: var(--color-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* ========== Footer 底部 ========== */
.wv-footer {
    background: #1a1a1a;
}

.wv-footer-content {
    padding: 24px 0;
}

.wv-footer-content .wv-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wv-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wv-footer-nav a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    padding: 0 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.wv-footer-nav a:first-child {
    padding-left: 0;
}

.wv-footer-nav a:last-child {
    border-right: none;
}

.wv-footer-nav a:hover {
    color: #fff;
}

.wv-footer-info-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.wv-footer-left {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 2;
}

.wv-footer-center {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 2;
    text-align: center;
}

.wv-footer-right {
    display: flex;
    gap: 30px;
    justify-content: flex-end;
}

.wv-footer-base {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.wv-qrcode-item {
    text-align: center;
}

.wv-qrcode-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 6px;
}

.wv-qrcode-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;
    margin-bottom: 6px;
}

.wv-qrcode-item span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.wv-footer-copyright {
    text-align: center;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
 * 频道页通用骨架（channel/about/article 各栏目页共用）
 * banner + 左侧 sidebar + 右侧内容区 + 面板切换 + 栏目标题
 * ============================================================ */

/* ========== 频道栏目页 - Banner ========== */
.wv-channel-banner {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #1f2937;
}

.wv-channel-banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.wv-channel-banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.wv-channel-banner-slide.wv-banner-active {
    opacity: 1;
}

.wv-channel-banner-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.wv-channel-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wv-channel-banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

/* 频道 banner 圆点（复用首页 .wv-banner-dot 视觉，此处补充定义避免依赖 page-index.css） */
.wv-channel-banner .wv-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.wv-channel-banner .wv-banner-dot.wv-dot-active {
    width: 24px;
    border-radius: 4px;
    background: #ffffff;
}

/* ========== 频道栏目页 - 主内容 ========== */
.wv-channel-main {
    padding: 30px 0 50px;
}

.wv-channel-inner {
    display: flex;
    gap: 30px;
}

.wv-channel-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.wv-sidebar-title {
    background: linear-gradient(90deg, var(--color-primary) 0%, #ef4444 100%);
    color: #ffffff;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 700;
    position: relative;
}

.wv-sidebar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
}

.wv-sidebar-menu {
    list-style: none;
}

.wv-sidebar-item {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.wv-sidebar-item:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--color-primary);
    padding-left: 24px;
}

.wv-sidebar-active {
    background: #ffffff;
    color: var(--color-primary) !important;
    font-weight: 600;
    border-left: 3px solid var(--color-primary);
}

/* 右侧内容区（栏目页/合作页/公告页/专题页/影像中国/关于/文章 通用） */
.wv-channel-content {
    flex: 1;
    min-width: 0;
    display: block;
}

/* 面板切换：默认隐藏，激活项显示 */
.wv-programs-channel-content .wv-channel-panel,
.wv-cooperation-channel-content .wv-channel-panel,
.wv-announcement-channel-content .wv-channel-panel,
.wv-special-channel-content .wv-channel-panel,
.wv-image-channel-content .wv-channel-panel {
    display: none !important;
}

.wv-programs-channel-content .wv-channel-panel.wv-channel-panel-active,
.wv-cooperation-channel-content .wv-channel-panel.wv-channel-panel-active,
.wv-announcement-channel-content .wv-channel-panel.wv-channel-panel-active,
.wv-special-channel-content .wv-channel-panel.wv-channel-panel-active,
.wv-image-channel-content .wv-channel-panel.wv-channel-panel-active {
    display: block !important;
}

/* 栏目标题（频道页版；首页版在 page-index.css 中覆盖为 24px 带下划线布局） */
.wv-channel-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-border);
    width: 100%;
    display: block;
    writing-mode: horizontal-tb;
    margin-bottom: 20px;
}

/* ========== 频道页骨架响应式 ========== */
/* --- 平板 Pad (769~1024px)：Banner 铺满不留白，高度略降 --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .wv-channel-banner {
        height: 180px;
    }
}

@media (max-width: 768px) {
    /* Banner：铺满不留白，高度进一步降低以适配窄屏 */
    .wv-channel-banner {
        height: 140px;
    }

    .wv-channel-inner {
        flex-direction: column;
        gap: 20px;
    }
    .wv-channel-sidebar {
        width: 100%;
    }
    .wv-sidebar-menu {
        display: flex;
        flex-wrap: wrap;
    }
    .wv-sidebar-item {
        flex: 1 1 auto;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    .wv-sidebar-item:hover {
        padding-left: 20px;
    }
    /* 频道标题：手机端字号收窄 */
    .wv-channel-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
}

/* ========== 公共响应式 - 平板 Pad (769~1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 通用 Section 标题：去掉 index_fl_title.png 背景图，改简洁样式 */
    .wv-section-header {
        height: auto;
        padding: 0 0 10px 0;
        background: none;
        border-bottom: 2px solid var(--color-primary);
    }
    .wv-section-title {
        padding-left: 12px;
        position: relative;
    }
    .wv-section-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 16px;
        background: var(--color-primary);
    }
    /* 导航项略微收窄，避免在窄屏下换行/溢出；PC(>1024)不受影响 */
    .wv-nav-item {
        padding: 12px 16px;
        font-size: 16px;
    }
    .wv-footer-right {
        flex-direction: column;
    }
}

/* ========== 公共响应式 - 手机 (≤768px) ========== */
@media (max-width: 768px) {
    /* --- 通用 Section 标题：去掉 index_fl_title.png 背景图，改简洁样式 --- */
    .wv-section-header {
        height: auto;
        padding: 0 0 10px 0;
        background: none;
        border-bottom: 2px solid var(--color-primary);
    }
    .wv-section-title {
        padding-left: 12px;
        position: relative;
    }
    .wv-section-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 16px;
        background: var(--color-primary);
    }

    /* --- Header：logo 缩小、显示汉堡按钮 --- */
    .wv-header-top {
        height: 60px;
        position: relative;
    }
    .wv-header-left {
        gap: 12px;
    }
    .wv-header-logo-img {
        width: 60px;
        height: 60px;
    }
    .wv-menu-toggle {
        display: flex;           /* 手机端显示汉堡按钮 */
    }

    /* --- 导航：默认收起，点击汉堡后从 header 下方竖向展开 --- */
    .wv-nav {
        display: none;
        position: absolute;
        top: 60px;               /* 紧贴缩小后的 header 底部 */
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #ffffff;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
        border-top: 1px solid var(--color-border);
        z-index: 999;
    }
    .wv-nav.wv-nav-open {
        display: flex;           /* 汉堡展开态 */
    }
    .wv-nav-item {
        padding: 14px 20px;
        font-size: 16px;
        border-bottom: 1px solid var(--color-border);
    }

    /* --- Footer：手机端显示 PC 版页脚(信息/二维码)，布局改为纵向堆叠；
       同时保留底部固定操作底栏，footer 底部预留其高度避免遮挡 --- */
    .wv-footer {
        display: block;
    }
    .wv-footer-content {
        padding: 22px 0 16px;
    }
    .wv-footer-content .wv-container {
        gap: 16px;
    }
    /* 底部导航：居中换行；用 gap 控制行/列间距，去掉分隔竖线以兼容栏目过多时的多行换行 */
    .wv-footer-nav {
        justify-content: center;
        padding-bottom: 14px;
        column-gap: 4px;
        row-gap: 6px;
    }
    .wv-footer-nav a {
        font-size: 12px;
        padding: 3px 10px;
        border-right: none;      /* 换行时竖线会错位，手机端一律去掉 */
    }
    .wv-footer-nav a:first-child {
        padding-left: 10px;      /* 覆盖 PC 的去左内边距，保持居中对齐 */
    }
    /* 信息行：横向三栏改为纵向堆叠、居中 */
    .wv-footer-info-row {
        flex-direction: column;
        gap: 18px;
    }
    .wv-footer-left,
    .wv-footer-center {
        flex: none;
        text-align: center;
        line-height: 1.9;
    }
    .wv-footer-base {
        font-size: 13px;
    }
    /* 二维码：并排居中 */
    .wv-footer-right {
        flex-direction: row;
        justify-content: center;
        gap: 36px;
    }
    .wv-qrcode-img {
        width: 88px;
        height: 88px;
    }
    /* 版权：为固定底栏(60px)预留空间，兼容 iOS 安全区 */
    .wv-footer-copyright {
        font-size: 11px;
        line-height: 1.7;
        padding: 16px 12px calc(60px + 16px + env(safe-area-inset-bottom, 0px));
        margin-top: 0;
    }

    /* --- 手机端固定底栏：红底 4 图标，横向四等分 --- */
    .wv-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #d41418;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    }
    .wv-mobile-bar-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #ffffff;
        font-size: 12px;
        border-right: 1px solid rgba(255, 255, 255, 0.15);
    }
    .wv-mobile-bar-item:last-child {
        border-right: none;
    }
    .wv-mobile-bar-item:active {
        background: rgba(0, 0, 0, 0.12);
    }
    .wv-mobile-bar-icon {
        width: 22px;
        height: 22px;
        object-fit: contain;
    }
    .wv-mobile-bar-item span {
        line-height: 1;
        color: #ffffff;
    }

    /* --- 分享引导浮层 --- */
    .wv-share-mask.wv-share-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 2000;
    }
    .wv-share-tip {
        position: absolute;
        top: 16px;
        right: 16px;
        max-width: 70%;
        text-align: right;
        color: #ffffff;
    }
    .wv-share-arrow {
        width: 40px;
        height: 40px;
        margin: 0 12px 8px auto;
        border-right: 3px solid #ffffff;
        border-top: 3px solid #ffffff;
        transform: rotate(45deg);
        border-radius: 4px;
    }
    .wv-share-tip p {
        font-size: 16px;
        line-height: 1.6;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wv-footer-right {
        flex-direction: column;
    }
}
