/*导航栏css样式*/
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    height: 70px;
    max-width: 1350px;
    padding: 0 12px;
}

.container1 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
}

.logo {
    margin-top: 5px;
    width: 140px;
    height: 41px;
    flex-shrink: 0;
}

.logo > div {
    width: 100%;
    height: 100%;
}

.logo > div > a {
    display: block;
    width: 100%;
    height: 100%;
    background: url(/img/logo.png) no-repeat center center;
    background-size: contain;
    text-indent: -9999px;
    overflow: hidden;
}

.nav {
    flex: 1;
    margin-left: 20px;
}

.nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav ul li {
    flex: 1;
    text-align: center;
}

.nav ul li a {
    padding: 0 12px;
    font-size: 15px;
    height: 32px;
    line-height: 32px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav ul li a:hover {
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.08);
}

.nav ul li a.active {
    color: #ff9800;
}

.nav ul li a.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 16px;
    height: 2px;
    background-color: #ff9800;
    border-radius: 1px;
    transition: transform 0.25s ease;
}

.nav ul li a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* 右侧操作区容器 */
.container2 {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ff9800;
    color: white;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.action-btn:hover {
    background-color: #e65100;
}

body {
    padding-top: 90px;
}

/* 页面主容器：统一内容区最大宽度，替代各页面内联 style */
.page-container {
    max-width: 1350px;
}

/* 影片列表区块 */
.vod-section {
    margin-bottom: 45px;
}

.vod-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.vod-section-bar {
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: #ff9800;
    border-radius: 2px;
    flex-shrink: 0;
}

.vod-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.vod-section-more {
    margin-left: auto;
    font-size: 14px;
    color: #999;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.vod-section-more:hover {
    color: #ff9800;
}

.vod-card {
    border-radius: 8px;
    overflow: hidden;
    touch-action: manipulation;   /* 消除移动端 300ms 点击延迟，点按更跟手 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 悬停反馈仅 PC 生效，保持原有「抬起 + 阴影」效果；
   移动端不触发，避免 sticky-hover 在 bfcache 后退后残留位移 */
@media (hover: hover) {
    .vod-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* 移动端点按反馈：整卡瞬时变暗，不改变封面位置；
   opacity 未放进 transition 列表 → 按下即变、松手即恢复，无过渡可被 bfcache 冻结 */
.vod-card:active {
    opacity: 0.68;
}

.vod-cover {
    position: relative;
    width: 100%;
    height: 0;
    /* 21:29 → 高度 = 宽度 × 29/21 ≈ 138.095%；用 padding 撑高，
       不依赖 aspect-ratio 与百分比高度解析，兼容所有移动端浏览器 */
    padding-bottom: 138.095%;
    overflow: hidden;
    background-color: #f0f0f0;
}

.vod-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vod-card-info {
    padding: 10px 8px 12px;
}

.vod-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vod-subtitle {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vod-badge {
    position: absolute;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 1;
}

.vod-badge-remarks {
    top: 6px;
    right: 6px;
    background-color: #ff9800;
    color: #fff;
}

.vod-badge-episodes {
    bottom: 6px;
    right: 6px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
}

/* ========== 导航栏最近观看 ========== */
.history-box {
    position: relative;
    flex-shrink: 0;
}

.history-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 320px;           /* 300 -> 320：给文字删除按钮腾出空间，避免挤压影片名 */
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
    overflow: hidden;
}

.history-box.open .history-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 小三角 */
.history-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 18px;
    width: 10px;
    height: 10px;
    background-color: #fff;
    transform: rotate(45deg);
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f3f3;
}

.history-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.history-clear {
    padding: 0;
    font-size: 12px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.history-clear:hover {
    color: #ff9800;
}

.history-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
}

.history-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;                /* 撑满剩余空间，把删除按钮推到最右侧 */
    min-width: 0;           /* 关键：flex 项默认 min-width:auto，长片名会把整行撑破 */
    color: inherit;
    text-decoration: none;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;      /* 14px 与 .history-panel-header 对齐，封面不再贴边 */
    transition: background-color 0.15s;
}

.history-item:hover {
    background-color: #fafafa;
}

.item-remove {
    flex-shrink: 0;         /* 按钮永不被压缩 */
    align-self: center;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
    color: #999;
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;    /* "删除"两字不许折行 */
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.item-remove:hover {
    color: #e53935;
    border-color: #e53935;
    background-color: #fff5f5;
}

.item-remove:active {
    background-color: #ffe9e9;
}

.history-thumb {
    position: relative;
    width: 44px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-thumb-fallback {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8, #d5d5d5);
}

.history-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.45);
}

.history-progress i {
    display: block;
    height: 100%;
    background-color: #ff9800;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-name {
    display: block;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item:hover .history-name {
    color: #ff9800;
}

.history-sub {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-empty {
    padding: 30px 14px;
    text-align: center;
    font-size: 13px;
    color: #bbb;
}

/* ========== 页脚 ========== */
.site-footer {
    margin-top: 0;
    background-color: #f8f9fa;
    border-top: 1px solid #ececec;
}

.footer-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 32px 12px 20px;
}

.footer-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 32px;
}

.footer-brand {
    flex: 2 1 300px;
    min-width: 240px;
}

.footer-logo {
    display: inline-block;
    font-size: 20px;
    font-weight: 700;
    color: #ff9800;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 13px;
    line-height: 1.9;
    color: #888;
    max-width: 380px;
}

.footer-col {
    flex: 1 1 150px;
    min-width: 140px;
}

.footer-col-wide {
    flex: 1.6 1 260px;
    min-width: 240px;
}

.footer-col-title {
    position: relative;
    padding-left: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
}

.footer-col-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background-color: #ff9800;
    border-radius: 2px;
}

.footer-note {
    font-size: 12px;
    line-height: 1.9;
    color: #999;
}

.footer-col-links {
    flex: 1 1 180px;
    min-width: 160px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.footer-link {
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #ff9800;
}

.footer-bottom {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #ececec;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #aaa;
}

/* ========== 移动端：统一"内容区 ↔ 页脚"间距（全站收口） ==========
   之前每页各写各的 padding-bottom(40~60px)，再叠加最后一块 .vod-section/卡片的
   margin-bottom(24~45px) 和页脚 margin-top(28px)，移动端就出现大片空白。
   这里用 main > .container 统一命中所有内容页（排除播放页 .play-container），
   优先级高于各页自身的 .xxx-container 规则，可绕过 CSS 加载顺序生效。 */
@media (max-width: 768px) {
    /* 1) 容器底部统一留白 20px */
    main > .container:not(.play-container) {
        padding-bottom: 20px;
    }

    /* 2) 收掉内容区最后一块的下边距，避免与容器 padding-bottom 叠加 */
    main > .container:not(.play-container) > *:last-child,
    main > .container:not(.play-container) > *:last-child .vod-section {
        margin-bottom: 0;
    }

    body {
        padding-top: 102px;
    }

    .header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        height: auto;
        padding: 8px 10px;
    }

    .container1 {
        display: contents;
    }

    .container2 {
        display: flex;
        align-items: center;
        flex: none;
        order: 2;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .logo {
        width: 100px;
        height: 40px;
        margin-top: 0;
        flex-shrink: 0;
        order: 1;
    }

    .action-btn {
        width: 26px;
        height: 26px;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: 6px;
        margin-left: 0;
        flex: none;
    }

    .nav ul {
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nav ul li {
        flex: 1;
        text-align: center;
    }

    .nav ul li a {
        padding: 0 4px;
        font-size: 14px;
        height: 32px;
        line-height: 32px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .history-panel {
        position: fixed;
        top: 96px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .history-panel::before {
        display: none;
    }

    .history-list {
        max-height: 55vh;
    }

    .site-footer {
        margin-top: 0;
    }

    .footer-inner {
        padding: 24px 12px 16px;
    }

    .footer-main {
        gap: 24px;
    }

    .footer-brand,
    .footer-col,
    .footer-col-wide {
        flex: 1 1 100%;
        min-width: 0;
    }

    .footer-desc {
        max-width: none;
    }
}

