/* 视频详情页 — Figma PC 2525:7078 / H5 2663:14620
 * 内容区宽度与栅格复用 video-cards.css（body.hg-theater-page） */

body.hg-theater-detail-page .archive-nav-breadcrumb-wrap {
    margin: 1.25rem 0 1.25rem;
}

body.hg-theater-detail-page .nav-breadcrumb-wrap .action-butn {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.hg-theater-detail-page .nav-breadcrumb-wrap .name {
    color: var(--hg-accent, #fe2e62) !important;
    width: auto;
    font-weight: 600;
}

.hg-theater-detail {
    display: flex;
    flex-direction: column;
    gap: 2.5rem; /* 40px 区块间距 */
    padding-bottom: 2.5rem;
}

/* —— Hero —— */
.hg-td-hero {
    display: grid;
    grid-template-columns: 18.75rem minmax(0, 1fr); /* 300px + rest */
    gap: 1.875rem; /* 30px → 内容左缘约 330 */
    align-items: stretch;
    min-height: 25rem; /* 400 */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem; /* 20 */
    overflow: hidden;
    box-sizing: border-box;
}

.hg-td-hero__cover {
    position: relative;
    width: 18.75rem;
    height: 25rem;
    flex-shrink: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    background: #1a1a1a;
}

.hg-td-hero__img,
.hg-td-hero__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hg-td-hero__body {
    display: flex;
    flex-direction: column;
    gap: 0.9375rem; /* 15 */
    padding: 1.875rem 1.875rem 1.875rem 0; /* top 30 */
    min-width: 0;
    box-sizing: border-box;
}

.hg-td-hero__title {
    margin: 0;
    font-size: 2rem; /* 32 */
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
}

.hg-td-hero__status {
    margin: 0;
    font-size: 0.9375rem; /* 15 */
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
}

.hg-td-hero__summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hg-td-hero__summary-label {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: #eee;
}

.hg-td-hero__summary-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hg-td-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hg-td-hero__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(254, 46, 98, 0.1);
    color: var(--hg-accent, #fe2e62);
    font-size: 0.8125rem; /* 13 */
    line-height: 1.5;
    white-space: nowrap;
}

.hg-td-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem; /* 20 */
    margin-top: auto;
}

.hg-td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 3.125rem; /* 50 */
    padding: 0.625rem 1.25rem;
    border: 0;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hg-td-btn:hover {
    opacity: 0.92;
}

.hg-td-btn--watch {
    background: var(--hg-accent, #fe2e62);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.hg-td-btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 1.875rem;
    padding-right: 1.875rem;
    font-size: 0.875rem;
}

.hg-td-btn__icon {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    flex-shrink: 0;
}

.hg-td-btn--watch .hg-td-btn__icon--pc {
    width: 1.875rem;
    height: 1.875rem;
}

.hg-td-btn--watch .hg-td-btn__icon--h5 {
    display: none;
}

.hg-td-btn--fav .hg-td-btn__icon--on {
    display: none;
}

.hg-td-btn--fav.is-active {
    color: var(--hg-accent, #fe2e62);
}

.hg-td-btn--fav.is-active .hg-td-btn__icon--off {
    display: none;
}

.hg-td-btn--fav.is-active .hg-td-btn__icon--on {
    display: block;
}

/* —— Episodes —— */
.hg-td-episodes {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hg-td-episodes__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.25rem;
}

.hg-td-episodes__title-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.hg-td-episodes__title {
    margin: 0;
    font-size: 1.375rem; /* 22 */
    font-weight: 600;
    line-height: 1.875rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.hg-td-episodes__title--h5 {
    display: none;
}

.hg-td-episodes__meta--h5 {
    display: none;
}

.hg-td-episodes__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5625rem; /* 105 */
    height: 2.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    box-sizing: border-box;
}

.hg-td-ranges {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none; /* Firefox */
    touch-action: pan-x;
}

.hg-td-ranges::-webkit-scrollbar {
    display: none; /* Chrome / Safari */
}

.hg-td-range {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto; /* 禁止被压扁，超出靠横滑 */
    width: 6.5625rem;
    height: 2.25rem;
    padding: 0.25rem 0.75rem;
    border: 0;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.hg-td-range__h5 {
    display: none;
}

.hg-td-range.is-active {
    background: rgba(254, 46, 98, 0.1);
    border: 1px solid rgba(254, 46, 98, 0.3);
    color: var(--hg-accent, #fe2e62);
}

.hg-td-ep-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem 1rem; /* 10 / 16 */
}

.hg-td-ep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6.5625rem; /* 105 */
    height: 2.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hg-td-ep__h5 {
    display: none;
}

.hg-td-ep.is-active,
a.hg-td-ep:hover {
    background: var(--hg-accent, #fe2e62);
    border: 1px solid rgba(254, 46, 98, 0.3);
    color: #fff;
}

.hg-td-ep.is-locked {
    opacity: 0.38;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.45);
}

.hg-td-ep.is-hidden {
    display: none !important;
}

.hg-td-toast {
    position: fixed;
    left: 50%;
    bottom: 4.5rem;
    z-index: 9999;
    transform: translateX(-50%) translateY(8px);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hg-td-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* H5-only summary (hidden on PC) */
.hg-td-summary-h5 {
    display: none;
}

/* 相关推荐：复用 .hg-theater-section / .hg-theater-grid；详情页 H5 也展示 */
body.hg-theater-detail-page .hg-td-related {
    display: flex;
    flex-direction: column;
}

body.hg-theater-detail-page .hg-td-related .hg-theater-section__head {
    margin-bottom: 1.25rem;
}

/* PC：相关推荐一行 5 个（与列表页一致） */
body.hg-theater-detail-page .hg-td-related .hg-theater-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* —— H5 —— */
@media (max-width: 767.98px) {
    body.hg-theater-detail-page #body > .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .hg-theater-detail {
        gap: 0;
        padding-bottom: 2rem;
    }

    body.hg-theater-detail-page .archive-nav-breadcrumb-wrap {
        margin: 0.75rem 0;
    }

    .hg-td-hero {
        grid-template-columns: 9.375rem minmax(0, 1fr); /* ~150 @375 ≈ 300@750 */
        gap: 0.9375rem;
        min-height: 0;
        border-radius: 0.625rem;
        background: rgba(255, 255, 255, 0.05);
        padding: 0;
        overflow: hidden;
    }

    .hg-td-hero__cover {
        width: 100%;
        height: auto;
        aspect-ratio: 300 / 400;
        border-radius: 0.625rem;
    }

    .hg-td-hero__body {
        padding: 0.75rem 0.75rem 0.75rem 0;
        gap: 0.625rem;
        justify-content: flex-start;
    }

    .hg-td-hero__title {
        font-size: 1rem; /* 32@750 → 16@375 */
        font-weight: 500;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hg-td-hero__status,
    .hg-td-hero__summary--pc {
        display: none;
    }

    .hg-td-hero__tags {
        gap: 0.3125rem;
    }

    .hg-td-hero__tag {
        height: 1.25rem;
        padding: 0 0.375rem;
        border-radius: 0.3125rem;
        border: 1px solid rgba(254, 46, 98, 0.3);
        background: rgba(254, 46, 98, 0.1);
        font-size: 0.6875rem; /* 22@750 */
        line-height: 1.2;
    }

    .hg-td-hero__actions {
        margin-top: auto;
        gap: 0;
    }

    .hg-td-btn--ghost {
        display: none; /* H5 稿面无收藏/分享 */
    }

    .hg-td-btn--watch {
        width: 100%;
        max-width: 8rem;
        height: 2.625rem; /* 84@750 */
        border-radius: 0.625rem;
        background: linear-gradient(90deg, #fe2e62 0%, #ff5781 100%);
        box-shadow: 0 0 0.55rem rgba(254, 46, 98, 0.48);
        font-size: 0.9375rem; /* 30@750 ≈ 15 */
        padding: 0.5rem 0.75rem;
    }

    .hg-td-btn--watch .hg-td-btn__icon--pc {
        display: none;
    }

    .hg-td-btn--watch .hg-td-btn__icon--h5 {
        display: block;
        width: 1.5rem;
        height: 1.5rem;
    }

    .hg-td-episodes {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        gap: 0.875rem;
    }

    .hg-td-episodes__accent,
    .hg-td-episodes__badge,
    .hg-td-episodes__title--pc {
        display: none;
    }

    .hg-td-episodes__title--h5 {
        display: inline;
    }

    .hg-td-episodes__title {
        font-size: 1rem;
        line-height: 1.4;
    }

    .hg-td-episodes__title-block {
        gap: 0.5rem;
        align-items: baseline;
        flex-wrap: wrap;
    }

    .hg-td-episodes__meta--h5 {
        display: inline;
        margin: 0;
        font-size: 0.75rem;
        color: #8e8e93;
        line-height: 1.4;
    }

    .hg-td-ranges {
        gap: 0.9375rem;
        border: 0;
        background: transparent;
        /* 继承横滑；左右略留手势空间 */
        margin: 0 -0.125rem;
        padding: 0 0.125rem;
    }

    .hg-td-range {
        width: auto;
        min-width: max-content;
        height: auto;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        color: rgba(255, 255, 255, 0.65);
        font-size: 1rem;
        font-weight: 600;
    }

    .hg-td-range__pc {
        display: none;
    }

    .hg-td-range__h5 {
        display: inline;
    }

    .hg-td-range.is-active {
        background: transparent;
        border: 0;
        color: var(--hg-accent, #fe2e62);
    }

    .hg-td-ep-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.625rem; /* 20@750 */
    }

    .hg-td-ep {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 0.5rem; /* 16@750 */
        background: #2c2c2e;
        color: #fff;
        font-size: 1rem;
        font-weight: 700;
        padding: 0;
        border: 0;
    }

    .hg-td-ep__pc {
        display: none;
    }

    .hg-td-ep__h5 {
        display: inline;
    }

    .hg-td-ep.is-active,
    a.hg-td-ep:hover {
        background: #2c2c2e;
        border: 3px solid var(--hg-accent, #fe2e62);
        color: var(--hg-accent, #fe2e62);
    }

    .hg-td-ep.is-locked {
        opacity: 0.35;
        color: rgba(255, 255, 255, 0.4);
    }

    .hg-td-summary-h5 {
        display: block;
        margin-top: 1.25rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hg-td-summary-h5__title {
        margin: 0 0 0.75rem;
        font-size: 1rem;
        font-weight: 600;
        color: #fff;
        line-height: 1.4;
    }

    .hg-td-summary-h5__body {
        position: relative;
    }

    .hg-td-summary-h5__text {
        margin: 0;
        font-size: 0.75rem; /* 24@750 */
        line-height: 1.55;
        color: #8e8e93;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* 默认 4 行省略（稿面） */
    .hg-td-summary-h5__text.is-clamped {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        overflow: hidden;
        /* 给右下角「展开...」留一点叠层空间 */
        max-height: calc(0.75rem * 1.55 * 4);
    }

    .hg-td-summary-h5.is-expanded .hg-td-summary-h5__text,
    .hg-td-summary-h5__text:not(.is-clamped) {
        display: block;
        -webkit-line-clamp: none;
        line-clamp: none;
        -webkit-box-orient: initial;
        overflow: visible;
        max-height: none;
    }

    .hg-td-summary-h5__toggle {
        position: absolute;
        right: 0;
        bottom: 0;
        z-index: 1;
        margin: 0;
        padding: 0 0 0 1.75rem;
        border: 0;
        background: linear-gradient(90deg, rgba(13, 13, 13, 0) 0%, #0d0d0d 28%, #0d0d0d 100%);
        color: var(--hg-accent, #fe2e62);
        font-size: 0.75rem;
        line-height: 1.55;
        cursor: pointer;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .hg-td-summary-h5__toggle[hidden] {
        display: none !important;
    }

    /* 展开后：收起落在文末右下 */
    .hg-td-summary-h5.is-expanded .hg-td-summary-h5__toggle {
        position: static;
        display: block;
        width: 100%;
        margin-top: 0.375rem;
        padding: 0;
        background: transparent;
        text-align: right;
    }

    .hg-td-related {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    body.hg-theater-detail-page .hg-td-related .hg-theater-section__accent {
        display: none;
    }

    body.hg-theater-detail-page .hg-td-related .hg-theater-section__title {
        font-size: 1rem;
    }

    /* H5：相关推荐一行 2 个 */
    body.hg-theater-detail-page .hg-td-related .hg-theater-grid,
    body.hg-theater-detail-page .hg-theater-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .hg-td-hero {
        grid-template-columns: 14rem minmax(0, 1fr);
    }

    .hg-td-hero__cover {
        width: 14rem;
        height: 18.67rem;
    }
}
