/* ========== 影片详情页 ========== */
.detail-page-main {
    background-color: #fff;
}

.detail-container {
    margin-top: -20px;
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* 顶部信息卡片 */
.detail-header-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background-color: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.detail-poster-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 2 / 3;              /* 比例放在容器上，无替换元素歧义 */
    overflow: hidden;                 /* 硬裁剪：任何超尺寸原图都不会突破 */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.detail-poster-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;                /* 按 2:3 裁剪填充，比例失衡的图也不再撑高 */
}

.poster-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background-color: #ff9800;
    border-radius: 4px;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.4);
}

.detail-info-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-pill {
    padding: 4px 14px;
    font-size: 13px;
    color: #555;
    background-color: #f5f5f7;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tag-pill:hover {
    background-color: #ffe0b2;
    color: #e65100;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 0;
    margin-bottom: 24px;
}

.meta-item {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-label {
    color: #999;
}

.meta-value {
    display: inline;
}

.detail-action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.btn-play-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-play-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
    color: #fff;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    color: #666;
    background-color: #f5f5f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-action:hover {
    color: #ff9800;
    border-color: #ff9800;
    background-color: #fff8f0;
}

.btn-icon-action.faved {
    color: #e53935;
    border-color: #e53935;
    background-color: #fff0f0;
}

.btn-icon-action.liked {
    color: #ff9800;
    border-color: #ff9800;
    background-color: #fff3e0;
}

/* 详情页二维码 */
.detail-qr-code {
    flex-shrink: 0;
    text-align: center;
    padding-top: 80px;
    padding-right: 70px;
}

.detail-qr-code img {
    width: 130px;
    height: 130px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    display: block;
}

.qr-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #bbb;
    white-space: nowrap;
}

/* 通用白色卡片 */
.detail-card {
    background-color: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

/* 统计栏 */
.detail-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.stat-box {
    text-align: center;
    flex: 1;
    padding: 0 12px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #ff9800;
    margin-bottom: 6px;
}

.stat-text {
    font-size: 13px;
    color: #999;
}

/* 剧情简介 */
.synopsis-content {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    margin-top: 16px;
    text-indent: 2em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.synopsis-content.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.synopsis-expand-btn {
    margin-left: auto;
    padding: 4px 18px;
    font-size: 12px;
    color: #999;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.synopsis-expand-btn:hover {
    color: #ff9800;
    border-color: #ff9800;
}

/* 继续观看提示 */
.resume-hint {
    padding-left: 8px;
    margin-left: 2px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* ========== 播放线路 tab + 选集网格（详情页自包含基础样式） ==========
   .source-tabs / .source-tab / .episode-grid / .episode-btn 是 detail.html 与 vodplay.html
   共用的公共类：播放页那份在 play.css 里用 .play-side 限定作用域，而详情页不加载 play.css，
   必须在此保留一份基础定义（取值与 play.css 基础版一致）。
   ⚠ 这些类正被 detail.html 使用，不是死代码，勿再删。 */
.source-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    -webkit-overflow-scrolling: touch;
}

.source-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 15px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

@media (hover: hover) {
    .source-tab:hover {
        color: #333;
    }
}

.source-tab.active {
    color: #ff9800;
    font-weight: 700;
}

.source-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: #ff9800;
    border-radius: 2px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.episode-btn {
    display: block;
    text-align: center;
    padding: 12px 4px;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f7;
    border-radius: 6px;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

@media (hover: hover) {
    .episode-btn:hover {
        color: #fff;
        background-color: #ff9800;
        transform: translateY(-2px);
    }
}

/* 触屏点按反馈：轻压变深灰，松手即恢复，不会像 :hover 那样粘住 */
.episode-btn:active {
    background-color: #e6e6ea;
}

.episode-active {
    color: #fff !important;
    background-color: #ff9800 !important;
    font-weight: 600;
}

.episode-hidden {
    display: none !important;
}

/* 选集网格 / 线路 tab 响应式，断点与本文件其余部分保持 768 / 480 一致 */
@media (max-width: 768px) {
    .source-tabs {
        gap: 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        margin: 12px 0;
    }

    .source-tab {
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .episode-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .episode-btn {
        font-size: 13px;
        padding: 10px 2px;
    }
}

@media (max-width: 480px) {
    .episode-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .episode-btn {
        font-size: 12px;
        padding: 9px 2px;
    }
}

/* 集数网格中标记"上次看到这里" */
.episode-btn.episode-resume {
    position: relative;
    color: #ff9800;
    border-color: #ff9800;
    background-color: #fff8f0;
}

.episode-btn.episode-resume::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #ff9800;
}

@media (max-width: 768px) {
    .detail-container {
        margin-top: -10px;
        padding-bottom: 40px;
    }

    .detail-header-card {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .detail-poster-wrapper {
        width: 140px;
        margin: 0 auto;
    }

    .detail-poster-wrapper img {
        min-height: 0;
    }

    .detail-title {
        font-size: 20px;
        margin-bottom: 12px;
        text-align: center;
    }

    .detail-tags {
        gap: 6px;
        margin-bottom: 16px;
    }

    .tag-pill {
        padding: 3px 10px;
        font-size: 12px;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    .meta-item {
        font-size: 13px;
    }

    .detail-info-content {
        width: 100%;
    }

    .detail-action-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
    }

    .btn-play-large {
        display: flex;
        width: 0;
        flex-grow: 2.5;
        justify-content: center;
        padding: 10px 0;
        font-size: 14px;
        min-width: 0;
        box-sizing: border-box;
    }

    .btn-icon-action {
        display: flex;
        width: 0;
        flex-grow: 1;
        justify-content: center;
        padding: 10px 0;
        font-size: 12px;
        min-width: 0;
        box-sizing: border-box;
    }

    .btn-icon-action span {
        display: none;
    }

    .detail-stats-bar {
        padding: 16px;
        gap: 8px;
    }

    .stat-box {
        padding: 0 8px;
    }

    .stat-number {
        font-size: 17px;
    }

    .stat-text {
        font-size: 12px;
    }

    .detail-card {
        padding: 16px;
    }

    .detail-qr-code {
        display: none;
    }

    .resume-hint {
        display: none !important;   /* 按钮为 nowrap，移动端隐藏提示避免溢出 */
    }
}

@media (max-width: 480px) {
    .detail-poster-wrapper {
        width: 120px;
    }
}