/* Shared page shell + poster card grid (non-home pages) */

.page-shell {
    width: 1700px;
    max-width: 100%;
    position: relative;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    display: flex;
    margin: 0 auto;
    box-sizing: border-box;
}

.text-white-xs {
    color: white;
    font-size: calc(12px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 18px;
    word-wrap: break-word;
}

.flex-spacer {
    flex: 1 1 0;
    height: 13.33px;
    position: relative;
    min-width: 0;
}

.card-grid {
    width: 1700px;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 20px;
    box-sizing: border-box;
}

.card-row {
    display: contents;
}

.poster-card {
    width: 266px;
    overflow: hidden;
    border-radius: 20px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    display: inline-flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: #110F1F;
    box-sizing: border-box;
}

.poster-cover {
    width: 266px;
    height: 355px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.poster-cover-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.episode-badge,
.episode-badge-shifted {
    padding: 8px 12px;
    left: auto;
    right: 12px;
    top: auto;
    bottom: 12px;
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
}

.episode-badge .text-white-xs,
.episode-badge-shifted .text-white-xs {
    text-align: right;
    color: white;
    font-size: calc(12px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 18px;
    word-wrap: break-word;
}

.poster-card-body {
    width: 266px;
    padding: 12px 10px;
    background: #110F1F;
    overflow: hidden;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 6px;
    display: flex;
    box-sizing: border-box;
}

.poster-card-title {
    align-self: stretch;
    color: white;
    font-size: calc(16px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 22px;
    word-wrap: break-word;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.poster-card-subtitle {
    align-self: stretch;
    opacity: 0.6;
    color: white;
    font-size: calc(14px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 20px;
    word-wrap: break-word;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.poster-card-meta {
    align-self: stretch;
    overflow: hidden;
    justify-content: space-between;
    align-items: center;
    display: inline-flex;
    gap: 8px;
    width: 100%;
}

.poster-card-tag {
    opacity: 0.6;
    color: white;
    font-size: calc(12px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 18px;
    word-wrap: break-word;
    flex-shrink: 0;
    max-width: 50%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.poster-card-heat {
    opacity: 0.6;
    color: white;
    font-size: calc(12px + var(--pc-font-boost, 0px));
    font-family: PingFang SC, sans-serif;
    font-weight: 400;
    line-height: 18px;
    word-wrap: break-word;
    flex-shrink: 0;
}

.free-badge-large {
    padding: 4px 8px;
    background: #26C281;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    display: flex;
    box-sizing: border-box;
}

.hot-badge-large {
    padding: 4px 8px;
    background: linear-gradient(90deg, #FF2D26 0%, #FFC41C 100%);
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    box-sizing: border-box;
}

.hot-badge-large .text-white-xs {
    color: white;
}

.community-badge {
    padding: 4px 8px;
    background: #5865F2;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    box-sizing: border-box;
}

.community-badge .text-white-xs {
    color: white;
}

.poster-corner-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.poster-corner-badges .free-badge-large,
.poster-corner-badges .hot-badge-large,
.poster-corner-badges .community-badge,
.poster-corner-badges .ranking-hot-badge,
.poster-corner-badges .ranking-free-badge {
    position: static;
    left: auto;
    top: auto;
}

.section-empty {
    grid-column: 1 / -1;
    width: 100%;
    flex: 1 1 100%;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.45);
    font-size: calc(14px + var(--pc-font-boost, 0px));
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Mid-width PC: keep shell centered with side padding */
@media (min-width: 768px) and (max-width: 1759px) {
    .page-shell {
        width: 100%;
        max-width: 1700px;
        padding-left: 40px;
        padding-right: 40px;
    }

    .card-grid {
        width: 100%;
    }
}

/* —— H5 —— */
@media (max-width: 767px) {
    .page-shell {
        width: 100%;
        max-width: 100%;
        padding: 12px 16px;
        box-sizing: border-box;
        gap: 18px;
        align-items: stretch;
    }

    .flex-spacer {
        height: 9px;
    }

    .card-grid {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 7px;
    }

    .poster-card {
        width: 100%;
        max-width: none;
        border-radius: 6px;
        background: #110F1F;
    }

    .poster-cover {
        width: 100%;
        height: 0;
        padding-bottom: 133.333%; /* 224 / 168 */
    }

    .poster-cover-img {
        position: absolute;
        inset: 0;
    }

    .episode-badge,
    .episode-badge-shifted {
        left: auto;
        right: 8px;
        top: auto;
        bottom: 8px;
        height: 28px;
        padding: 4px 8px;
        background: rgba(8, 6, 13, 0.88);
        border-radius: 8px;
    }

    .episode-badge .text-white-xs,
    .episode-badge-shifted .text-white-xs {
        text-align: left;
    }

    .poster-card-body {
        width: 100%;
        align-self: stretch;
        padding: 8px 10px;
        gap: 4px;
        background: transparent;
    }

    .poster-card-title {
        color: #F5F0FA;
        font-size: calc(14px + var(--pc-font-boost, 0px));
        font-family: "Noto Sans SC", "PingFang SC", sans-serif;
        font-weight: 700;
        line-height: 20px;
    }

    .poster-card-subtitle {
        opacity: 1;
        color: #8C859C;
        font-size: calc(12px + var(--pc-font-boost, 0px));
        line-height: 18px;
    }

    .poster-card-tag {
        opacity: 1;
        color: #A89EB5;
    }

    .poster-card-heat {
        opacity: 1;
        color: #ABA1B8;
    }

    .free-badge-large,
    .hot-badge-large,
    .community-badge {
        left: auto;
        right: 8px;
        top: 8px;
    }

    .poster-corner-badges {
        top: 8px;
        right: 8px;
    }
}
