/* OK.DONGHUA V4 visual system: one cinematic, editorial language across public pages. */

body.donghua-portal-body {
    --v4-accent: var(--site-accent);
    --v4-accent-glow: color-mix(in srgb, var(--site-accent) 24%, transparent);
    --v4-panel: color-mix(in srgb, var(--bg-surface) 90%, #122638);
    --v4-panel-raised: color-mix(in srgb, var(--bg-surface-alt) 84%, #142d3b);
    --v4-line: color-mix(in srgb, var(--border-color) 78%, #45616e);
    --v4-radius: 16px;
    --v4-shadow: 0 18px 46px rgba(0, 0, 0, .22);
    color: var(--text-primary);
}

body.donghua-portal-body :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--site-accent-text);
    outline-offset: 3px;
}

/* Header and navigation */
body.donghua-portal-body .site-header {
    border-bottom: 1px solid color-mix(in srgb, var(--v4-line) 72%, transparent);
    background: color-mix(in srgb, var(--bg-page) 86%, transparent);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .16);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}
body.donghua-portal-body .primary-menu li a {
    min-height: 44px;
    border-radius: 10px;
    transition: color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
body.donghua-portal-body .primary-menu li a:hover { background: color-mix(in srgb, var(--v4-accent) 12%, transparent); transform: translateY(-1px); }
body.donghua-portal-body .primary-menu li.current-menu-item a,
body.donghua-portal-body .primary-menu .current-menu-item > a {
    border-color: color-mix(in srgb, var(--v4-accent) 46%, var(--v4-line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--v4-accent) 21%, var(--bg-surface)), color-mix(in srgb, var(--v4-accent) 9%, var(--bg-page)));
    box-shadow: inset 0 -2px var(--v4-accent), 0 6px 18px var(--v4-accent-glow);
}
body.donghua-portal-body .header-search-input,
body.donghua-portal-body :is(input, select, textarea) {
    border-color: var(--v4-line);
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--bg-page) 76%, var(--bg-surface));
}
body.donghua-portal-body :is(input, select, textarea):focus {
    border-color: var(--v4-accent);
    box-shadow: 0 0 0 3px var(--v4-accent-glow);
}

/* Consistent surfaces, headings, controls and card movement. */
body.donghua-portal-body :is(.portal-section, .search-results-section, .archive-filter-bar, .schedule-day-panel, .comments-area, .dh-account-content, .dh-account-profile-hero, .dh-404-hero) {
    min-width: 0;
}
body.donghua-portal-body :is(.portal-section-header, .search-section-header, .dh-account-section-heading, .schedule-day-panel-heading, .dh-404-sec-header) {
    gap: 14px;
    border-color: var(--v4-line);
}
body.donghua-portal-body :is(.portal-section-title, .archive-title, .search-title, .enc-main-title, .dh-account-view-heading h2, .dh-404-title) {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.3;
    text-wrap: pretty;
}
body.donghua-portal-body :is(.section-view-all, .btn-more-link, .dh-account-inline-link, .dh-404-link-btn, .schedule-filter-tab) {
    min-height: 44px;
    border-radius: 10px;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
body.donghua-portal-body :is(.section-view-all, .btn-more-link):hover { transform: translateY(-1px); box-shadow: 0 8px 20px var(--v4-accent-glow); }
body.donghua-portal-body :is(.dh-card-v3, .glossary-card, .schedule-item-row, .dh-account-session-card, .dh-account-watch-item, .dh-library-item, .dh-account-history-item, .news-portal-item, .episode-dense-row, .enc-content-section, .enc-summary-box) {
    border-color: var(--v4-line);
    border-radius: var(--v4-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .11);
    transition: border-color var(--transition-medium), background-color var(--transition-medium), box-shadow var(--transition-medium), transform var(--transition-medium);
}
body.donghua-portal-body :is(.dh-card-v3, .glossary-card, .schedule-item-row, .dh-account-session-card, .dh-account-watch-item, .dh-library-item, .dh-account-history-item, .news-portal-item, .episode-dense-row):hover {
    border-color: color-mix(in srgb, var(--v4-accent) 54%, var(--v4-line));
    box-shadow: var(--v4-shadow);
    transform: translateY(-3px);
}
body.donghua-portal-body .dh-card-v3 .card-poster-frame { border-radius: 13px 13px 0 0; }
body.donghua-portal-body .dh-card-v3 .card-poster-frame { background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--v4-accent) 20%, transparent), transparent 58%), linear-gradient(145deg, var(--v4-panel-raised), var(--bg-page)); }
body.donghua-portal-body .dh-card-v3 .card-poster-image { transition: transform 420ms cubic-bezier(.2, .7, .2, 1), filter 420ms ease; }
body.donghua-portal-body .dh-card-v3 .card-poster-image { background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--v4-accent) 18%, transparent), transparent 58%), linear-gradient(145deg, var(--v4-panel-raised), var(--bg-page)); }
body.donghua-portal-body .dh-card-v3:hover .card-poster-image { transform: scale(1.045); filter: saturate(1.08); }
body.donghua-portal-body .dh-card-v3 .card-empty-poster {
    background: radial-gradient(ellipse at 52% 38%, color-mix(in srgb, var(--v4-accent) 28%, transparent), transparent 58%), linear-gradient(150deg, var(--v4-panel-raised), var(--bg-page));
}
body.donghua-portal-body .dh-card-v3 .card-empty-poster .empty-icon {
    width: 58px;
    height: 58px;
    border: 1px solid color-mix(in srgb, var(--v4-accent) 56%, var(--v4-line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--v4-accent) 13%, var(--bg-page));
    color: var(--site-accent-text);
    opacity: 1;
}

/* Homepage: larger cinematic lead, clearer jump links and deliberate section rhythm. */
body.home .dh-home-v3 { max-width: 1520px; }
body.home .dh-home-v3 .hero-slider-section {
    height: clamp(410px, 34vw, 510px);
    min-height: 410px;
    max-height: 510px;
    margin-block: 14px 30px;
    border: 1px solid color-mix(in srgb, var(--v4-accent) 24%, var(--v4-line));
    border-radius: 24px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .32), 0 0 44px color-mix(in srgb, var(--v4-accent) 10%, transparent);
}
body.home .dh-home-v3 .hero-slide {
    padding-inline: clamp(28px, 7vw, 104px);
    background-position: center 35%;
}
body.home .dh-home-v3 .hero-slide-overlay {
    background: linear-gradient(90deg, rgba(5, 12, 18, .12) 0%, rgba(5, 12, 18, .42) 39%, rgba(5, 12, 18, .94) 100%), linear-gradient(0deg, rgba(5, 12, 18, .82) 0%, transparent 62%);
}
body.home .dh-home-v3 .hero-slide-content { max-width: 620px; gap: 12px; }
body.home .dh-home-v3 .hero-work-title { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.15; }
body.home .dh-home-v3 .hero-work-synopsis { max-width: 560px; font-size: 16px; line-height: 1.8; }
body.home .dh-home-v3 .hero-action-buttons { gap: 11px; margin-top: 8px; }
body.home .dh-home-v3 .btn-hero-primary { background: linear-gradient(135deg, var(--v4-accent), color-mix(in srgb, var(--v4-accent) 74%, #081923)); box-shadow: 0 10px 26px var(--v4-accent-glow); }
body.home .dh-home-v3 .btn-hero-primary:hover { box-shadow: 0 14px 34px color-mix(in srgb, var(--v4-accent) 36%, transparent); transform: translateY(-2px); }
body.home .dh-home-v3 .btn-hero-secondary { border-color: rgba(231, 242, 247, .26); background: rgba(9, 19, 29, .66); backdrop-filter: blur(8px); }
body.home .dh-home-v3 .home-quick-nav {
    position: relative;
    gap: 7px;
    margin-block: 0 38px;
    padding: 7px;
    border-color: var(--v4-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .13);
    backdrop-filter: blur(14px);
}
body.home .dh-home-v3 .home-quick-nav a { min-height: 46px; padding-inline: 17px; border-radius: 10px; font-weight: 700; }
body.home .dh-home-v3 .portal-section { margin-block-end: clamp(34px, 4vw, 56px); }
body.home .dh-home-v3 .portal-section-header { margin-bottom: 18px; padding-bottom: 13px; }
body.home .dh-home-v3 .header-accent-dot { width: 4px; height: 25px; border-radius: 4px; box-shadow: 0 0 16px var(--v4-accent-glow); }
body.home .dh-home-v3 .portal-section-title { font-size: clamp(21px, 2vw, 26px); }
body.home .dh-home-v3 .donghua-grid { gap: clamp(14px, 1.7vw, 22px); }
body.home .dh-home-v3 .episodes-dense-grid { gap: 12px; }
body.home .dh-home-v3 .episode-dense-row { min-height: 92px; padding: 12px 14px; }
body.home .dh-home-v3 .section-popular .donghua-grid { counter-reset: home-popular-rank; }
body.home .dh-home-v3 .section-popular .dh-card-v3 { counter-increment: home-popular-rank; }
body.home .dh-home-v3 .section-popular .card-poster-frame { position: relative; }
body.home .dh-home-v3 .section-popular .card-poster-frame::after {
    position: absolute;
    inset-inline-start: 10px;
    bottom: 5px;
    content: counter(home-popular-rank, decimal-leading-zero);
    color: rgba(237, 249, 250, .9);
    font: 900 clamp(34px, 4vw, 54px)/1 var(--font-heading);
    letter-spacing: -.06em;
    text-shadow: 0 3px 14px rgba(0, 0, 0, .8);
    pointer-events: none;
}
body.home .dh-home-v3 .dh-membership-support { border-radius: 18px; box-shadow: var(--v4-shadow); }
body.home .dh-home-v3 .home-feature-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); gap: clamp(16px, 2vw, 24px); align-items: start; direction: rtl; }
body.home .dh-home-v3 .home-feature-main,
body.home .dh-home-v3 .home-feature-sidebar { min-width: 0; width: auto; }
body.home .dh-home-v3 .home-feature-sidebar { display: block; }
body.home .dh-home-v3 .home-feature-layout .portal-section { margin-block-end: 0; }
body.home .dh-home-v3 .home-top-rated-panel { padding: clamp(14px, 1.5vw, 20px); border: 1px solid var(--v4-line); border-radius: 16px; background: var(--v4-panel); box-shadow: var(--v4-shadow); }
body.home .dh-home-v3 .home-sidebar-heading { display: flex; align-items: center; gap: 10px; padding-block-end: 12px; margin-block-end: 6px; border-bottom: 1px solid var(--v4-line); }
body.home .dh-home-v3 .home-sidebar-heading h2 { margin: 0; color: var(--text-primary); font-size: 16px; font-weight: 800; }
body.home .dh-home-v3 .home-sidebar-rank-list { display: grid; }
body.home .dh-home-v3 .home-sidebar-rank-link { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 82px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--v4-line) 72%, transparent); color: var(--text-primary); text-decoration: none; }
body.home .dh-home-v3 .home-sidebar-rank-link:last-child { border-bottom: 0; }
body.home .dh-home-v3 .home-sidebar-rank-link img { width: 48px; height: 64px; flex: 0 0 48px; border-radius: 8px; object-fit: cover; background: var(--bg-page); }
body.home .dh-home-v3 .home-sidebar-rank-number { display: grid; width: 22px; flex: 0 0 22px; place-items: center; color: var(--site-accent-text); font-size: 14px; font-weight: 850; }
body.home .dh-home-v3 .home-sidebar-rank-copy { display: grid; flex: 1; min-width: 0; gap: 4px; }
body.home .dh-home-v3 .home-sidebar-rank-copy strong { overflow: hidden; font-size: 12px; line-height: 1.55; text-overflow: ellipsis; }
body.home .dh-home-v3 .home-sidebar-rank-copy small { color: var(--text-secondary); font-size: 10px; }
body.home .dh-home-v3 .home-sidebar-rank-score { flex: 0 0 auto; color: #edc46c; font-size: 11px; font-weight: 800; white-space: nowrap; }
body.home .dh-home-v3 .home-sidebar-rank-link:hover .home-sidebar-rank-copy strong { color: var(--site-accent-text); }
body.home .dh-home-v3 .home-sidebar-view-all { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin-block-start: 8px; padding: 8px 10px; border: 1px solid var(--v4-line); border-radius: 10px; color: var(--text-secondary); font-size: 11px; font-weight: 700; text-decoration: none; transition: color .18s, border-color .18s, background-color .18s; }
body.home .dh-home-v3 .home-sidebar-view-all:hover { border-color: var(--site-accent-text); background: var(--v4-panel-raised); color: var(--site-accent-text); }

/* Ratings stay compact in the header; the picker opens without moving the player. */
:is(body.single-donghua, body.single-episode) .okd-rating-widget { position: relative; gap: 8px; margin-block: 10px; isolation: isolate; z-index: 15; }
:is(body.single-donghua, body.single-episode) .okd-rating-widget { display: grid; width: fit-content; max-width: 100%; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'site site' 'audience picker'; align-items: center; gap: 7px 10px; }
:is(body.single-donghua, body.single-episode) .okd-rating-site-summary { grid-area: site; display: flex; min-height: 36px; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--v4-line); border-radius: 10px; background: rgba(8, 20, 29, .62); }
:is(body.single-donghua, body.single-episode) .okd-rating-site-summary .okd-rating-summary-label { color: var(--text-secondary); font-size: 11px; font-weight: 750; }
:is(body.single-donghua, body.single-episode) .okd-rating-site-average { color: #fff0c5; font-size: 15px; font-weight: 900; unicode-bidi: isolate; }
:is(body.single-donghua, body.single-episode) .okd-rating-summary { grid-area: audience; }
:is(body.single-donghua, body.single-episode) .okd-rating-picker { grid-area: picker; }
:is(body.single-donghua, body.single-episode) .okd-rating-summary { min-height: 44px; gap: 7px; padding: 8px 12px; border: 1px solid var(--v4-line); border-radius: 12px; background: rgba(8, 20, 29, .78); }
:is(body.single-donghua, body.single-episode) .okd-rating-picker { position: static; flex: 0 0 auto; min-width: 0; }
:is(body.single-donghua, body.single-episode) .okd-rating-trigger { gap: 7px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border-color: var(--v4-line); background: var(--v4-panel-raised); color: var(--text-primary); }
:is(body.single-donghua, body.single-episode) .okd-rating-picker[open] .okd-rating-trigger { border-color: var(--site-accent-text); color: var(--site-accent-text); }
:is(body.single-donghua, body.single-episode) .okd-rating-panel { position: absolute; top: calc(100% + 10px); inset-inline-start: 0; width: 320px; max-width: calc(100vw - 40px); box-sizing: border-box; margin: 0; padding: 16px; gap: 12px; border-color: var(--v4-line); border-radius: 16px; background: #101f29; box-shadow: 0 18px 56px rgba(0, 0, 0, .5); text-align: start; }
:is(body.single-donghua, body.single-episode) .okd-rating-picker:not([open]) > .okd-rating-panel { display: none; }
:is(body.single-donghua, body.single-episode) .okd-rating-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
:is(body.single-donghua, body.single-episode) .okd-rating-panel-heading strong { font-size: 16px; color: #eef6f8; }
:is(body.single-donghua, body.single-episode) .okd-rating-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--v4-line); border-radius: 10px; background: transparent; color: #b6c7ce; font-size: 24px; cursor: pointer; }
:is(body.single-donghua, body.single-episode) .okd-rating-hint { margin: 0; color: #a8bbc5; font-size: 12px; line-height: 1.7; }
:is(body.single-donghua, body.single-episode) .okd-rating-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
:is(body.single-donghua, body.single-episode) .okd-rating-choice { position: relative; min-width: 0; min-height: 46px; padding: 8px 4px; border-radius: 10px; transition: border-color .18s, background-color .18s, transform .18s; }
:is(body.single-donghua, body.single-episode) .okd-rating-choice:hover { transform: translateY(-2px); }
:is(body.single-donghua, body.single-episode) .okd-rating-choice.is-selected { border-color: var(--site-accent-text); background: var(--site-accent); box-shadow: 0 0 0 2px var(--v4-accent-glow); }
:is(body.single-donghua, body.single-episode) .okd-rating-choice[aria-pressed="true"]::after { content: ''; position: absolute; inset-inline-end: 5px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
:is(body.single-donghua, body.single-episode) .okd-rating-status { min-height: 0; font-size: 12px; }
:is(body.single-donghua, body.single-episode) .okd-rating-status:empty { display: none; }
:is(body.single-donghua, body.single-episode) .okd-rating-widget [hidden] { display: none; }

/* Hero autoplay: a glass control with a continuous countdown and animated icons. */
body.home .dh-home-v3 .hero-autoplay-control-btn {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(8, 20, 29, .72);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .24);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), background-color .28s, box-shadow .28s, border-color .28s;
}
body.home .dh-home-v3 .hero-autoplay-control-btn[hidden] { display: none; }
body.home .dh-home-v3 .hero-autoplay-control-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid var(--site-accent-text);
    border-radius: inherit;
    opacity: 0;
    transform: scale(.9);
    transition: opacity .28s, transform .28s;
    pointer-events: none;
}
body.home .dh-home-v3 .hero-autoplay-control-btn:hover {
    transform: translateY(-2px);
    background: rgba(13, 38, 47, .92);
    border-color: color-mix(in srgb, var(--site-accent-text) 50%, transparent);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .32), 0 0 20px var(--v4-accent-glow);
}
body.home .dh-home-v3 .hero-autoplay-control-btn:hover::before { opacity: .3; transform: scale(1); }
body.home .dh-home-v3 .hero-autoplay-control-btn:active { transform: scale(.93); }
body.home .dh-home-v3 .autoplay-ring-svg { inset: 1px; }
body.home .dh-home-v3 .autoplay-ring-svg .ring-bg { stroke: rgba(255, 255, 255, .13); stroke-width: 1.5; }
body.home .dh-home-v3 .autoplay-ring-svg .ring-progress {
    stroke: var(--site-accent-text);
    stroke-width: 2;
    filter: drop-shadow(0 0 3px var(--v4-accent-glow));
    transition: opacity .28s;
}
body.home .dh-home-v3 .autoplay-ring-svg .ring-head {
    fill: var(--site-accent-text);
    transform-origin: 22px 22px;
    filter: drop-shadow(0 0 4px var(--site-accent-text));
    transition: opacity .28s;
}
body.home .dh-home-v3 .autoplay-icon { pointer-events: none; }
body.home .dh-home-v3 .autoplay-icon > span {
    position: absolute;
    display: grid;
    place-items: center;
    transition: opacity .24s, transform .34s cubic-bezier(.2, .8, .2, 1);
}
body.home .dh-home-v3 .autoplay-icon svg { display: block; fill: currentColor; }
body.home .dh-home-v3 .icon-pause { opacity: 1; transform: scale(1) rotate(0deg); }
body.home .dh-home-v3 .icon-play { opacity: 0; transform: scale(.55) rotate(-30deg); }
body.home .dh-home-v3 .is-paused .icon-pause { opacity: 0; transform: scale(.55) rotate(30deg); }
body.home .dh-home-v3 .is-paused .icon-play { opacity: 1; transform: translateX(1px) scale(1) rotate(0deg); }
body.home .dh-home-v3 .is-paused .ring-progress { opacity: .55; }
body.home .dh-home-v3 .is-paused .ring-head { opacity: .35; }

/* Catalog, search, knowledge and work pages share the same reading measure. */
body.donghua-portal-body :is(.archive-donghua-page, .search-results-page, .schedule-page-container, .enc-body-container, .single-donghua-body) {
    width: min(calc(100% - 48px), 1360px);
    max-width: 1360px;
}
body.donghua-portal-body :is(.archive-header, .search-header, .schedule-page-header) {
    position: relative;
    margin-block: 30px 22px;
    padding: clamp(22px, 3vw, 36px);
    overflow: hidden;
    border: 1px solid var(--v4-line);
    border-radius: 20px;
    background: radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--v4-accent) 16%, transparent), transparent 46%), linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 84%, var(--bg-surface)));
}
body.donghua-portal-body :is(.archive-title, .search-title, .schedule-main-title) { font-size: clamp(28px, 3.2vw, 42px); }
body.donghua-portal-body :is(.archive-description, .schedule-subtitle, .search-summary-text) { max-width: 760px; color: var(--text-secondary); line-height: 1.8; }
body.donghua-portal-body .archive-filter-bar { padding: 16px; border: 1px solid var(--v4-line); border-radius: 16px; background: var(--v4-panel); box-shadow: var(--v4-shadow); }
body.donghua-portal-body .archive-filters-form { gap: 14px; }
body.donghua-portal-body .archive-grid,
body.donghua-portal-body .search-donghua-grid { gap: clamp(14px, 1.8vw, 22px); }
body.donghua-portal-body .genres-directory { width: min(calc(100% - 48px), 1240px); max-width: 1240px; margin-inline: auto; padding-block: 28px 64px; }
body.donghua-portal-body .genres-directory-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: center; gap: clamp(22px, 4vw, 48px); padding: clamp(22px, 4vw, 42px); border: 1px solid var(--v4-line); border-radius: 22px; background: radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--v4-accent) 18%, transparent), transparent 48%), linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 84%, var(--bg-surface))); box-shadow: var(--v4-shadow); }
body.donghua-portal-body .genres-directory-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--site-accent-text); font-size: 12px; font-weight: 800; }
body.donghua-portal-body .genres-directory-kicker span { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid color-mix(in srgb, var(--site-accent) 38%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--site-accent) 12%, transparent); }
body.donghua-portal-body .genres-directory-hero h1 { margin: 12px 0 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.2; }
body.donghua-portal-body .genres-directory-hero-copy > p { max-width: 560px; margin: 0; color: var(--text-secondary); line-height: 1.8; }
body.donghua-portal-body .genres-directory-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 20px; }
body.donghua-portal-body .genres-directory-hero-meta > span { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 10px; border: 1px solid var(--v4-line); border-radius: 999px; background: color-mix(in srgb, var(--v4-panel-raised) 70%, transparent); color: var(--text-secondary); font-size: 11px; }
body.donghua-portal-body .genres-directory-hero-meta strong { color: var(--text-primary); font-size: 13px; }
body.donghua-portal-body .genres-directory-select { max-width: 720px; padding: 17px; border: 1px solid var(--v4-line); border-radius: 16px; background: color-mix(in srgb, var(--v4-panel-raised) 68%, transparent); }
body.donghua-portal-body .genres-directory-select label { display: block; margin-block-end: 8px; color: var(--text-primary); font-size: 13px; font-weight: 750; }
body.donghua-portal-body .genres-directory-select-control { display: flex; gap: 9px; }
body.donghua-portal-body .genres-directory-select select { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid var(--v4-line); border-radius: 11px; background: var(--v4-panel-raised); color: var(--text-primary); }
body.donghua-portal-body .genres-directory-select button { min-height: 48px; padding: 10px 18px; border: 1px solid var(--site-accent); border-radius: 11px; background: var(--site-accent); color: var(--site-accent-contrast, #fff); font-weight: 800; cursor: pointer; }
body.donghua-portal-body .genres-directory-select button:hover { filter: brightness(1.08); transform: translateY(-1px); }
body.donghua-portal-body .genres-directory-categories { margin-block-start: 30px; }
body.donghua-portal-body .genres-directory-categories-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-block-end: 13px; }
body.donghua-portal-body .genres-directory-categories-heading > div { display: flex; align-items: center; gap: 9px; }
body.donghua-portal-body .genres-directory-categories-heading h2 { margin: 0; font-size: clamp(18px, 2vw, 23px); }
body.donghua-portal-body .genres-directory-categories-heading > span { color: var(--text-secondary); font-size: 12px; }
body.donghua-portal-body .genres-directory-category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
body.donghua-portal-body .genres-directory-category { display: flex; min-width: 0; min-height: 62px; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--v4-line); border-radius: 13px; background: linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 66%, var(--v4-panel))); color: var(--text-primary); text-decoration: none; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
body.donghua-portal-body .genres-directory-category:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--site-accent) 55%, var(--v4-line)); background: var(--v4-panel-raised); }
body.donghua-portal-body .genres-directory-category:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 2px; }
body.donghua-portal-body .genres-directory-category.is-active { border-color: color-mix(in srgb, var(--site-accent) 70%, var(--v4-line)); background: color-mix(in srgb, var(--site-accent) 14%, var(--v4-panel)); }
body.donghua-portal-body .genres-directory-category-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 750; }
body.donghua-portal-body .genres-directory-category-count { display: grid; min-width: 27px; height: 25px; flex: 0 0 auto; place-items: center; padding-inline: 6px; border-radius: 8px; background: color-mix(in srgb, var(--site-accent) 12%, var(--v4-panel-raised)); color: var(--site-accent-text); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.donghua-portal-body .genres-directory-section { margin-block-start: 30px; }
body.donghua-portal-body .genres-directory-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 14px; }
body.donghua-portal-body .genres-directory-section-heading > div { display: flex; align-items: center; gap: 9px; }
body.donghua-portal-body .genres-directory-section-heading h2 { margin: 0; font-size: clamp(18px, 2vw, 23px); }
body.donghua-portal-body .genres-directory-section-heading > span { color: var(--text-secondary); font-size: 12px; }
body.donghua-portal-body .genres-directory-empty { padding: 24px; border: 1px dashed var(--v4-line); border-radius: 14px; color: var(--text-secondary); text-align: center; }
body.donghua-portal-body .genres-directory-empty strong { display: block; color: var(--text-primary); font-size: 16px; }
body.donghua-portal-body .genres-directory-empty p { margin: 8px 0 14px; font-size: 13px; }
body.donghua-portal-body .genres-directory-empty a { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 13px; border: 1px solid var(--v4-line); border-radius: 10px; color: var(--site-accent-text); text-decoration: none; }
@media (max-width: 900px) {
    body.donghua-portal-body .genres-directory-hero { grid-template-columns: minmax(0, 1fr); }
    body.donghua-portal-body .genres-directory-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body.donghua-portal-body .genres-directory-works-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}
@media (max-width: 560px) {
    body.donghua-portal-body .genres-directory { width: calc(100% - 24px); padding-block: 14px 40px; }
    body.donghua-portal-body .genres-directory-hero { padding: 19px 15px; border-radius: 16px; }
    body.donghua-portal-body .genres-directory-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body.donghua-portal-body .genres-directory-category { min-height: 56px; padding: 9px; }
    body.donghua-portal-body .genres-directory-category-name { font-size: 12px; }
    body.donghua-portal-body .genres-directory-select-control { align-items: stretch; flex-direction: column; }
    body.donghua-portal-body .genres-directory-select button { width: 100%; }
    body.donghua-portal-body .genres-directory-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}
body.donghua-portal-body .single-donghua-hero-container { width: min(calc(100% - 48px), 1440px); }
body.donghua-portal-body .single-donghua-hero { border: 1px solid var(--v4-line); border-radius: 24px; box-shadow: var(--v4-shadow); }
body.donghua-portal-body .single-donghua-body > .portal-section { margin-block-end: 48px; }
body.donghua-portal-body :is(.enc-summary-box, .enc-content-section, .enc-facts-sidebar, .enc-relations-section, .enc-episode-mentions) { box-shadow: 0 10px 30px rgba(0, 0, 0, .13); }

/* Keep the mobile drawer above its backdrop while the body is scroll-locked. */
@media (max-width: 1024px) {
    body.mobile-nav-open .site-header { position: fixed !important; inset-block-start: 0; inset-inline: 0; z-index: 2100 !important; width: 100%; }
    body.mobile-nav-open .site-header .site-navigation { z-index: 2101 !important; }
    body.mobile-nav-open .mobile-nav-backdrop { z-index: 2099 !important; }
    body.admin-bar.mobile-nav-open .site-header { inset-block-start: 32px; }
}
@media (max-width: 782px) {
    body.admin-bar.mobile-nav-open .site-header { inset-block-start: 46px; }
}

/* Watch page and account center: retain their behavior, refine shared surfaces. */
body.single-episode .watch-inner-wrap { width: min(calc(100% - 40px), 1480px); }
body.single-episode .watch-header-block { margin-block-end: 18px; }
body.single-episode .watch-stage-layout { gap: 18px; }
body.single-episode .player-fixed-16x9 { border: 1px solid var(--v4-line); border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .4); }
body.single-episode .watch-stream-hub,
body.single-episode .episodes-drawer-panel { border-color: var(--v4-line); border-radius: 16px; }
/* Keep the resume choice centered within the player itself (physical insets avoid RTL offset errors). */
body.single-episode #player-screen > .watch-resume-prompt:not([hidden]) {
    position: absolute;
    inset: 0;
    width: min(92%, 440px);
    height: fit-content;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    margin: auto;
    transform: none;
    box-sizing: border-box;
}
body.donghua-portal-body .dh-account-hub { width: min(calc(100% - 48px), 1320px); }
body.donghua-portal-body :is(.dh-account-content, .dh-account-profile-hero, .dh-account-nav) { border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .13); }
body.donghua-portal-body .dh-account-nav a { border-radius: 10px; }
body.donghua-portal-body .dh-account-hub .dh-account-layout { direction: ltr; grid-template-columns: minmax(0,1fr) minmax(180px,220px); grid-template-areas: "content nav"; gap: 18px; }
body.donghua-portal-body .dh-account-hub .dh-account-layout > .dh-account-nav { grid-area: nav; direction: rtl; display: grid; align-self: start; }
body.donghua-portal-body .dh-account-hub .dh-account-layout > .dh-account-content { grid-area: content; direction: rtl; min-width: 0; }
/* Watch history gets its own editorial dashboard inside the account center. */
body.donghua-portal-body .dh-account-content.is-view-history { grid-template-columns: minmax(0, 1fr); gap: 18px; }
body.donghua-portal-body .dh-account-history-section { display: grid; gap: 18px; padding: 0 !important; border: 0 !important; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--v4-line); border-radius: 18px; background: radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--v4-accent) 19%, transparent), transparent 54%), linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 84%, var(--bg-surface))); }
body.donghua-portal-body .dh-history-heading-copy { display: grid; gap: 7px; }
body.donghua-portal-body .dh-history-heading-copy .dh-membership-eyebrow { margin: 0; color: var(--site-accent-text); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
body.donghua-portal-body .dh-history-heading-copy h2 { margin: 0; color: var(--text-primary); font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
body.donghua-portal-body .dh-history-heading-copy .dh-account-section-subtitle { max-width: 570px; margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
body.donghua-portal-body .dh-account-history-section [data-history-clear] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 132px; min-height: 44px; padding: 9px 13px; border: 1px solid color-mix(in srgb, #ef8a8a 33%, var(--v4-line)); border-radius: 11px; background: color-mix(in srgb, #a53d4a 11%, var(--v4-panel)); color: #f2b2b2; font-size: 12px; font-weight: 700; transition: background-color .2s, border-color .2s, transform .2s; }
body.donghua-portal-body .dh-account-history-section [data-history-clear]::before { content: '⌫'; font-size: 17px; }
body.donghua-portal-body .dh-account-history-section [data-history-clear]:hover { transform: translateY(-1px); border-color: rgba(239, 138, 138, .65); background: rgba(165, 61, 74, .2); color: #ffd1d1; }
body.donghua-portal-body .dh-history-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body.donghua-portal-body .dh-history-stat { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 17px 18px; border: 1px solid var(--v4-line); border-radius: 14px; background: var(--v4-panel); }
body.donghua-portal-body .dh-history-stat-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid color-mix(in srgb, var(--v4-accent) 28%, var(--v4-line)); border-radius: 12px; background: color-mix(in srgb, var(--v4-accent) 13%, var(--bg-page)); color: var(--site-accent-text); font-size: 18px; }
body.donghua-portal-body .dh-history-stat > span:last-child { display: grid; min-width: 0; gap: 3px; }
body.donghua-portal-body .dh-history-stat strong { color: var(--text-primary); font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1.1; }
body.donghua-portal-body .dh-history-stat small { color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
body.donghua-portal-body .dh-account-history-section .dh-account-history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 390px), 1fr)); gap: 13px; border: 0; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-item { position: relative; display: grid; grid-template-columns: 116px minmax(0, 1fr) 42px; grid-template-areas: 'poster copy delete' 'poster resume delete'; gap: 7px 14px; align-items: center; min-width: 0; padding: 13px; overflow: hidden; border: 1px solid var(--v4-line); border-radius: 15px; background: linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 84%, var(--bg-surface))); transition: transform .22s, border-color .22s, box-shadow .22s; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--v4-accent) 48%, var(--v4-line)); box-shadow: 0 14px 28px rgba(0, 0, 0, .18); }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-poster { grid-area: poster; align-self: stretch; width: 100%; height: auto; min-height: 76px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: var(--bg-page); }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-poster img { transition: transform .35s; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-item:hover .dh-account-history-poster img { transform: scale(1.045); }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy { grid-area: copy; display: grid; align-content: center; gap: 4px; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy h3 { margin: 0; overflow: hidden; color: var(--text-primary); font-size: 14px; line-height: 1.55; text-overflow: ellipsis; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy h3 a { color: inherit; text-decoration: none; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy h3 a:hover { color: var(--site-accent-text); }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy > p { margin: 0; color: var(--text-secondary); font-size: 12px; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-progress-row { display: grid; grid-template-columns: auto minmax(72px, 1fr); align-items: center; gap: 9px; margin-top: 3px; }
body.donghua-portal-body .dh-account-history-progress-row > .dh-account-history-percent { color: var(--site-accent-text); font-size: 11px; font-weight: 750; white-space: nowrap; }
body.donghua-portal-body .dh-account-history-progress-row .dh-account-progress { display: block; position: relative; height: 7px; min-width: 72px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--v4-accent) 20%, var(--v4-line)); border-radius: 99px; background: color-mix(in srgb, var(--v4-line) 70%, transparent); }
body.donghua-portal-body .dh-account-history-progress-row .dh-account-progress i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--v4-accent), color-mix(in srgb, var(--v4-accent) 70%, #fff)); transition: width .35s ease; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy > time { margin: 1px 0 0; color: var(--text-secondary); font-size: 10px; line-height: 1.5; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-resume-action { grid-area: resume; justify-self: start; min-width: 124px; min-height: 38px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--v4-accent) 58%, var(--v4-line)); border-radius: 10px; background: color-mix(in srgb, var(--v4-accent) 20%, var(--v4-panel)); color: #c3f5ec; font-size: 11px; font-weight: 800; text-decoration: none; transition: background-color .2s, transform .2s; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-resume-action:hover { transform: translateY(-1px); background: var(--site-accent); color: #fff; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-icon-action { grid-area: delete; justify-self: end; align-self: start; width: 38px; height: 38px; min-width: 38px; min-height: 38px; border: 1px solid var(--v4-line); border-radius: 10px; background: color-mix(in srgb, var(--bg-page) 55%, transparent); color: var(--text-secondary); font-size: 20px; line-height: 1; transition: border-color .2s, background-color .2s, color .2s; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-account-icon-action:hover { border-color: rgba(239, 138, 138, .5); background: rgba(165, 61, 74, .15); color: #ffb4b4; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-history-empty { min-height: 260px; margin: 0; padding: 32px; border: 1px dashed var(--v4-line); border-radius: 18px; background: radial-gradient(ellipse at 50% 0%, var(--v4-accent-glow), transparent 63%), var(--v4-panel); }
body.donghua-portal-body .dh-history-empty-icon { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 5px; border: 1px solid color-mix(in srgb, var(--v4-accent) 35%, var(--v4-line)); border-radius: 18px; background: color-mix(in srgb, var(--v4-accent) 13%, var(--bg-page)); color: var(--site-accent-text); font-size: 27px; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-history-empty strong { font-size: 18px; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-history-empty > span:not(.dh-history-empty-icon) { max-width: 460px; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-history-empty > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 8px 16px; border: 1px solid var(--v4-accent); border-radius: 10px; background: var(--site-accent); color: #fff; font-weight: 750; text-decoration: none; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-library-pagination { justify-content: center; gap: 14px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--v4-line); }
body.donghua-portal-body .dh-account-content.is-view-history .dh-library-pagination > span { min-width: 64px; color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: center; }
body.donghua-portal-body .dh-account-content.is-view-history .dh-library-pagination > a { min-width: 86px; border-radius: 10px; }
body.donghua-portal-body .dh-auth-card { border: 1px solid var(--v4-line); border-radius: 22px; background: linear-gradient(145deg, var(--v4-panel-raised), var(--v4-panel)); box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
body.donghua-portal-body .dh-auth-submit { border-radius: 11px; background: linear-gradient(135deg, var(--v4-accent), color-mix(in srgb, var(--v4-accent) 76%, #071018)); box-shadow: 0 10px 26px var(--v4-accent-glow); }

/* Membership, comments, schedule, and the 404 endpoint use a shared edge and hover language. */
body.donghua-portal-body :is(.dhm-tier-card, .dhm-tier-pricing, .comments-area, .schedule-day-panel, .dh-404-hero) {
    border-color: var(--v4-line);
    border-radius: 20px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .16);
}
body.donghua-portal-body :is(.dhm-tier-card, .schedule-day-tab, .schedule-filter-tab, .dh-404-link-btn):hover { transform: translateY(-2px); }
body.donghua-portal-body .schedule-day-tab.is-active { box-shadow: 0 10px 24px var(--v4-accent-glow); }
body.donghua-portal-body .dh-404-hero { background: radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--v4-accent) 18%, transparent), transparent 48%), linear-gradient(145deg, var(--v4-panel), var(--bg-page)); }
body.donghua-portal-body .dh-404-glitch-digit { color: var(--site-accent-text); text-shadow: 0 0 34px var(--v4-accent-glow); }
body.donghua-portal-body .site-footer { margin-top: 24px; border-top: 1px solid var(--v4-line); background: color-mix(in srgb, var(--bg-page) 92%, var(--bg-surface)); }
body.donghua-portal-body .footer-list a:hover { color: var(--site-accent-text); transform: translateX(-2px); }

@media (max-width: 900px) {
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-item { grid-template-columns: 100px minmax(0, 1fr) 40px; gap: 7px 11px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-poster { min-height: 66px; }
    body.home .dh-home-v3 .hero-slider-section { height: clamp(350px, 52vw, 430px); min-height: 350px; max-height: 430px; }
    body.home .dh-home-v3 .hero-slide { padding-inline: 34px; }
    body.home .dh-home-v3 .home-feature-layout { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 14px; }
    body.donghua-portal-body :is(.archive-donghua-page, .search-results-page, .schedule-page-container, .enc-body-container, .single-donghua-body, .dh-account-hub) { width: calc(100% - 32px); }
    body.single-episode .watch-inner-wrap { width: calc(100% - 28px); }
}
@media (max-width: 640px) {
    body.donghua-portal-body .dh-account-content.is-view-history { padding: 12px; gap: 13px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-heading { flex-direction: column; align-items: stretch; gap: 13px; padding: 18px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-section [data-history-clear] { align-self: flex-start; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-stats { gap: 7px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 11px; border-radius: 12px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-stat-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: 15px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-stat strong { font-size: 20px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-stat small { font-size: 10px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-item { grid-template-columns: 90px minmax(0, 1fr) 36px; gap: 6px 10px; padding: 10px; border-radius: 13px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-poster { min-height: 60px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-icon-action { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-resume-action { min-width: 116px; min-height: 40px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy h3 { font-size: 13px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-account-history-copy > p { font-size: 11px; }
    body.donghua-portal-body .dh-account-content.is-view-history .dh-history-empty { min-height: 230px; padding: 22px 16px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-panel { padding: 14px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-scale { gap: 6px; }
    body.home .dh-home-v3 .hero-slider-section { height: 344px; min-height: 344px; max-height: 344px; margin-block: 8px 20px; border-radius: 18px; }
    body.home .dh-home-v3 .hero-slide { padding-inline: 20px; background-position: 43% center; }
    body.home .dh-home-v3 .hero-slide-content { max-width: 88%; gap: 8px; }
    body.home .dh-home-v3 .hero-work-title { font-size: clamp(24px, 7vw, 31px); }
    body.home .dh-home-v3 .hero-work-synopsis { font-size: 13px; line-height: 1.65; -webkit-line-clamp: 2; }
    body.home .dh-home-v3 .hero-badges-row > span { min-height: 26px; font-size: 11px; }
    body.home .dh-home-v3 .home-quick-nav { margin-bottom: 26px; }
    body.home .dh-home-v3 .home-quick-nav a { min-height: 44px; padding-inline: 13px; }
    body.home .dh-home-v3 .portal-section-header { margin-bottom: 12px; padding-bottom: 9px; }
    body.home .dh-home-v3 .portal-section-title { font-size: 18px; }
    body.home .dh-home-v3 .home-feature-layout { grid-template-columns: minmax(0, 1fr); }
    body.home .dh-home-v3 .home-feature-sidebar { display: block; }
    body.home .dh-home-v3 .home-sidebar-rank-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
    body.home .dh-home-v3 .home-sidebar-rank-link { gap: 7px; }
    body.home .dh-home-v3 .donghua-grid { gap: 11px; }
    body.home .dh-home-v3 .home-sidebar-rank-list { grid-template-columns: minmax(0, 1fr); }
    body.donghua-portal-body :is(.archive-donghua-page, .search-results-page, .schedule-page-container, .enc-body-container, .single-donghua-body, .dh-account-hub, .single-donghua-hero-container) { width: calc(100% - 24px); }
    body.donghua-portal-body :is(.archive-header, .search-header, .schedule-page-header) { margin-block: 18px 16px; padding: 18px; border-radius: 16px; }
    body.donghua-portal-body .archive-filter-bar { padding: 11px; border-radius: 13px; }
    body.donghua-portal-body :is(.dh-404-hero, .comments-area, .dh-account-content) { border-radius: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    body.donghua-portal-body .dh-account-content.is-view-history :is(.dh-account-history-item, .dh-account-history-poster img, .dh-account-resume-action, .dh-account-icon-action, [data-history-clear]) { transition: none !important; }
    body.home .dh-home-v3 .hero-autoplay-control-btn,
    body.home .dh-home-v3 .hero-autoplay-control-btn::before,
    body.home .dh-home-v3 .autoplay-icon > span,
    body.home .dh-home-v3 .autoplay-ring-svg circle { transition: none; }
    body.home .dh-home-v3 .hero-autoplay-control-btn:hover,
    body.home .dh-home-v3 .hero-autoplay-control-btn:active { transform: none; }
    body.home .dh-home-v3 .autoplay-ring-svg .ring-head { opacity: 0; }
    body.donghua-portal-body :is(.site-navigation a, .dh-card-v3, .dh-card-v3 .card-poster-image, .glossary-card, .schedule-item-row, .dh-account-session-card, .dh-account-watch-item, .dh-library-item, .dh-account-history-item, .news-portal-item, .episode-dense-row, .btn-primary, .btn-secondary, .dh-404-link-btn) { transition: none !important; animation: none !important; }
    body.donghua-portal-body :is(.dh-card-v3, .glossary-card, .schedule-item-row, .dh-account-session-card, .dh-account-watch-item, .dh-library-item, .dh-account-history-item, .news-portal-item, .episode-dense-row, .dhm-tier-card, .schedule-day-tab, .schedule-filter-tab, .dh-404-link-btn):hover { transform: none !important; }
}

/* Personal episode state in the watch drawer. */
body.single-episode .drawer-episode-item.is-watched:not(.is-current) {
    border-color: rgba(65, 190, 157, .22);
}
body.single-episode .drawer-episode-item.is-in-progress:not(.is-current) {
    border-color: rgba(92, 167, 231, .22);
}
body.single-episode .drawer-episode-item .episode-watch-state[hidden],
body.single-episode .drawer-episode-item .item-play-arrow[hidden] { display: none !important; }
body.single-episode .drawer-episode-item .episode-watch-state {
    flex: 0 0 auto;
    margin-inline-start: auto;
    padding: 4px 8px;
    border: 1px solid rgba(65, 190, 157, .2);
    border-radius: 999px;
    background: rgba(65, 190, 157, .09);
    color: #8fe0c8;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
body.single-episode .drawer-episode-item.is-in-progress .episode-watch-state {
    border-color: rgba(92, 167, 231, .22);
    background: rgba(92, 167, 231, .09);
    color: #a9d4fb;
}
body.single-episode .drawer-episode-item.is-current .episode-watch-state {
    border-color: rgba(143, 224, 200, .28);
    background: rgba(8, 24, 31, .52);
}
body.donghua-portal-body .dh-account-history-progress-row .dh-history-not-started {
    color: var(--text-muted, #91a0ad);
    font-weight: 600;
}

/* Account overview: a deliberate dashboard surface, isolated from the other account views. */
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-hub-heading { padding: 0 0 16px; border: 0; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-hero {
    position: relative;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px 22px;
    padding: clamp(20px, 3vw, 34px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--site-accent) 25%, var(--v4-line));
    border-radius: 22px;
    background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--site-accent) 18%, transparent), transparent 42%), linear-gradient(125deg, color-mix(in srgb, var(--v4-panel) 94%, #102b32), var(--v4-panel));
    box-shadow: 0 20px 52px rgba(0,0,0,.2);
}
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-hero::after {
    position: absolute;
    inset-inline-start: -72px;
    bottom: -120px;
    width: 260px;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--site-accent) 11%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 24px color-mix(in srgb, var(--site-accent) 3%, transparent), 0 0 0 50px color-mix(in srgb, var(--site-accent) 2%, transparent);
    content: "";
    pointer-events: none;
}
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-avatar { z-index: 1; align-self: start; padding-top: 5px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-avatar img { width: 82px; height: 82px; border: 2px solid color-mix(in srgb, var(--site-accent) 55%, white 12%); border-radius: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-summary { z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 20px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-summary > .dh-membership-eyebrow,
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-name-row,
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-email,
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-membership { grid-column: 1 / -1; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-summary > .dh-membership-eyebrow { margin: 0; color: var(--site-accent-text); font-size: 11px; font-weight: 800; letter-spacing: .11em; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-name-row { gap: 9px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-name-row h1 { font-size: clamp(25px, 3vw, 36px); font-weight: 850; letter-spacing: -.035em; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-email { margin: -5px 0 2px; color: var(--text-secondary); font-size: 13px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-membership { gap: 8px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-membership > span { gap: 7px; padding: 7px 11px; border: 1px solid var(--v4-line); border-radius: 10px; background: rgba(5,13,19,.28); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions { grid-column: 1; gap: 8px; margin: 2px 0 0; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions .dh-account-inline-link { min-height: 40px; padding: 8px 12px; border: 1px solid var(--v4-line); border-radius: 10px; background: rgba(7,17,23,.24); color: var(--text-primary); font-size: 12px; text-decoration: none; transition: border-color .18s, background-color .18s, transform .18s; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions .dh-account-inline-link:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--site-accent) 50%, var(--v4-line)); background: color-mix(in srgb, var(--site-accent) 10%, var(--v4-panel)); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics { grid-column: 2; justify-self: end; display: flex; gap: 0; margin: 0; padding: 0; border: 0; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics > span { min-width: 94px; padding-inline: 16px; border-inline-start: 1px solid var(--v4-line); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics > span:first-child { border: 0; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics strong { color: var(--text-primary); font-size: 20px; font-weight: 850; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics small { color: var(--text-secondary); font-size: 10px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-layout { direction: ltr; grid-template-columns: minmax(0,1fr) 210px; grid-template-areas: "content nav"; gap: 22px; margin-top: 4px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav { top: 16px; gap: 5px; padding: 10px; border: 1px solid var(--v4-line); border-radius: 16px; background: linear-gradient(160deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 80%, var(--v4-panel))); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav a { min-height: 44px; padding-inline: 12px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; transition: color .18s, background-color .18s, border-color .18s, transform .18s; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav a:hover { transform: translateX(-2px); border-color: var(--v4-line); background: rgba(255,255,255,.035); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav a.is-current { border-color: color-mix(in srgb, var(--site-accent) 34%, var(--v4-line)); background: linear-gradient(100deg, color-mix(in srgb, var(--site-accent) 15%, var(--v4-panel)), var(--v4-panel)); color: var(--text-primary); box-shadow: inset -3px 0 var(--site-accent); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content { grid-template-areas: "continue continue" "recent notifications" "membership membership"; gap: 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content > .dh-account-section { min-height: 100%; margin: 0; padding: 19px; border: 1px solid var(--v4-line); border-radius: 17px; background: linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 88%, var(--v4-panel))); box-shadow: 0 12px 32px rgba(0,0,0,.11); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content > .dh-account-continue-section { background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--site-accent) 8%, transparent), transparent 52%), linear-gradient(145deg, var(--v4-panel), color-mix(in srgb, var(--bg-page) 88%, var(--v4-panel))); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-section-heading { align-items: center; margin-bottom: 14px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-section-heading h2 { font-size: 17px; font-weight: 800; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-section-heading .dh-membership-eyebrow { color: var(--site-accent-text); font-size: 10px; letter-spacing: .07em; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-section-heading > .dh-account-inline-link { min-height: 38px; padding: 7px 10px; border: 1px solid var(--v4-line); border-radius: 9px; font-size: 11px; text-decoration: none; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty { display: flex; align-items: center; gap: 13px; min-height: 86px; padding: 14px; border: 1px dashed color-mix(in srgb, var(--site-accent) 26%, var(--v4-line)); border-radius: 13px; background: color-mix(in srgb, var(--site-accent) 4%, transparent); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid color-mix(in srgb, var(--site-accent) 30%, var(--v4-line)); border-radius: 13px; background: color-mix(in srgb, var(--site-accent) 10%, var(--v4-panel)); color: var(--site-accent-text); font-size: 17px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty > div { min-width: 0; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty strong { color: var(--text-primary); font-size: 12px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty p { margin: 3px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty > a { flex: 0 0 auto; margin-inline-start: auto; padding: 8px 11px; border: 1px solid color-mix(in srgb, var(--site-accent) 40%, var(--v4-line)); border-radius: 9px; background: color-mix(in srgb, var(--site-accent) 13%, var(--v4-panel)); color: var(--site-accent-text); font-size: 11px; font-weight: 800; text-decoration: none; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty.is-quiet { min-height: 86px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-rail { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-item { align-content: start; gap: 9px; padding: 9px; border: 1px solid var(--v4-line); border-radius: 12px; background: rgba(255,255,255,.025); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-poster { aspect-ratio: 16/9; border-radius: 8px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-copy { display: grid; gap: 4px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-copy h3 { font-size: 12px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-copy > p { color: var(--text-secondary); font-size: 10px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-copy time { font-size: 9px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-copy .dh-account-resume-action { justify-self: start; min-height: 35px; margin-top: 3px; border-radius: 9px; font-size: 10px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list article { overflow: hidden; border: 1px solid var(--v4-line); border-radius: 11px; background: rgba(255,255,255,.025); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list article > a img { display: block; aspect-ratio: 2/3; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list article > a > span { display: grid; gap: 3px; padding: 8px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list article > a strong { font-size: 11px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-library-state { display: inline-block; margin: 0 8px 8px; padding: 4px 7px; border-radius: 99px; background: color-mix(in srgb, var(--site-accent) 12%, var(--v4-panel)); color: var(--site-accent-text); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-notification-list li { padding: 11px 0; border-color: var(--v4-line); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-payment { align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--v4-line); border-radius: 12px; background: rgba(255,255,255,.025); }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-payment strong { margin-inline-end: auto; color: var(--text-primary); font-size: 14px; }
body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-payment span { padding: 6px 9px; border: 1px solid var(--v4-line); border-radius: 8px; font-size: 11px; }
@media (max-width: 700px) {
    body.donghua-portal-body .dh-account-hub .dh-account-layout { direction: rtl; grid-template-columns: minmax(0,1fr); grid-template-areas: "nav" "content"; gap: 13px; }
    body.donghua-portal-body .dh-account-hub .dh-account-layout > .dh-account-nav { position: static; display: flex; align-self: stretch; overflow-x: auto; }
    body.donghua-portal-body .dh-account-hub .dh-account-layout > .dh-account-nav a { flex: 0 0 auto; }
}
@media (max-width: 1050px) {
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav { position: sticky; }
}
@media (max-width: 700px) {
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-layout { grid-template-columns: minmax(0,1fr); gap: 13px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav { position: static; display: flex; overflow-x: auto; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-nav a { flex: 0 0 auto; }
}
@media (max-width: 760px) {
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-hero { grid-template-columns: 60px minmax(0,1fr); gap: 10px 13px; padding: 17px; border-radius: 17px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-avatar img { width: 58px; height: 58px; border-radius: 17px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-summary { grid-template-columns: minmax(0,1fr); gap: 7px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-summary > * { grid-column: 1; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-name-row h1 { font-size: 23px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions { grid-column: 1; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics { grid-column: 1; justify-self: stretch; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--v4-line); }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics > span { min-width: 0; padding-inline: 10px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics strong { font-size: 17px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content { grid-template-columns: minmax(0,1fr); grid-template-areas: "continue" "recent" "notifications" "membership"; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content > .dh-account-section { padding: 15px; border-radius: 14px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 440px) {
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-profile-hero { grid-template-columns: 48px minmax(0,1fr); padding: 13px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-avatar img { width: 46px; height: 46px; border-radius: 14px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-identity-membership > span { padding: 6px 8px; font-size: 11px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-actions .dh-account-inline-link { justify-content: center; padding-inline: 7px; font-size: 10px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics > span { padding-inline: 6px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-summary-metrics small { font-size: 9px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-content > .dh-account-section { padding: 12px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty { align-items: flex-start; flex-wrap: wrap; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty > div { flex: 1 1 calc(100% - 58px); }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-overview-empty > a { margin-inline-start: 55px; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-rail { grid-template-columns: minmax(0,1fr); }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-item { grid-template-columns: 112px minmax(0,1fr); }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-watch-poster { align-self: stretch; }
    body.donghua-portal-body .dh-account-hub.is-account-overview .dh-account-recent-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    body.donghua-portal-body .dh-account-hub.is-account-overview :is(.dh-account-nav a, .dh-account-summary-actions a, .dh-account-watch-item, .dh-account-resume-action) { transition: none !important; }
    body.donghua-portal-body .dh-account-hub.is-account-overview :is(.dh-account-nav a, .dh-account-watch-item):hover { transform: none !important; }
}
/* Episode watch sources: keep brand marks and settings compact and scannable. */
body.single-episode .watch-downloads-section .downloads-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.single-episode .watch-downloads-section .downloads-section-title::after {
    margin-inline-start: 4px;
}
body.single-episode .downloads-heading-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(85, 197, 181, .2);
    border-radius: 8px;
    background: rgba(69, 190, 171, .1);
    color: #78d7c9;
}
body.single-episode .download-provider-icon svg { display: block; width: 22px; height: 22px; }
body.single-episode .download-provider-icon.provider-gofile { background: rgba(53, 166, 111, .13); color: #71d59b; }
body.single-episode .download-provider-icon.provider-mega { background: rgba(231, 64, 72, .14); color: #ff747b; font-weight: 900; }
body.single-episode .download-provider-icon .server-provider-generic-icon { width: 17px; height: 17px; }
body.single-episode .watch-preference-menu {
    position: relative;
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
    color: #9db0b8;
    font-size: 11px;
}
body.single-episode .watch-preference-menu summary {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid rgba(151, 181, 193, .13);
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
}
body.single-episode .watch-preference-menu summary::-webkit-details-marker { display: none; }
body.single-episode .watch-preference-menu summary::before { content: '⚙'; margin-inline-end: 7px; color: #67c7bb; }
body.single-episode .watch-preference-menu[open] summary { border-color: rgba(85, 197, 181, .3); }
body.single-episode .watch-preference-menu #watch-preferences-reset {
    position: absolute;
    z-index: 2;
    inset-inline-start: 0;
    top: calc(100% + 5px);
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid rgba(151, 181, 193, .18);
    border-radius: 8px;
    background: #0d1a23;
    color: #d7e2e6;
    cursor: pointer;
}
body.single-episode .watch-preference-menu #watch-preferences-reset:hover { border-color: rgba(85, 197, 181, .5); color: #fff; }
@media (max-width: 640px) {
    body.single-episode .watch-downloads-section .downloads-section-title { flex-wrap: wrap; }
    body.single-episode .watch-downloads-section .downloads-section-title::after { flex-basis: 100%; margin-inline-start: 36px; }
}

/* Responsive watch-page composition and star-based 1–10 ratings. */
body.single-episode .watch-page-container { overflow-x: clip; }
body.single-episode .watch-inner-wrap { width: min(calc(100% - 48px), 1560px) !important; max-width: 1560px !important; }
body.single-episode .watch-stage-layout { grid-template-columns: minmax(0, 1fr) minmax(292px, 340px) !important; gap: clamp(16px, 2vw, 28px) !important; }
body.single-episode .player-dominant-column,
body.single-episode .watch-sidebar-column { min-width: 0; }
body.single-episode .episodes-drawer-panel { max-width: 100%; }
body.single-episode .watch-stream-hub,
body.single-episode .watch-downloads-section,
body.single-episode .watch-nav-quad-bar,
body.single-episode .watch-comments-wrapper { min-width: 0; max-width: 100%; }
body.single-episode .watch-comments-wrapper { width: min(100%, 1120px); }
body.single-episode .watch-meta-badges-row,
body.single-episode .stream-hub-servers-row,
body.single-episode .watch-download-items { min-width: 0; }
body.single-episode .watch-download-item { overflow: hidden; }
body.single-episode .watch-nav-quad-bar { gap: clamp(6px, 1vw, 12px); }

:is(body.single-donghua, body.single-episode) .okd-rating-summary { gap: 8px; }
:is(body.single-donghua, body.single-episode) .okd-rating-stars-display,
:is(body.single-donghua, body.single-episode) .okd-rating-trigger-stars { display: inline-flex; direction: ltr; align-items: center; gap: 1px; white-space: nowrap; }
:is(body.single-donghua, body.single-episode) .okd-rating-average-star,
:is(body.single-donghua, body.single-episode) .okd-rating-trigger-stars > span { position: relative; display: inline-block; width: 21px; overflow: hidden; color: rgba(207, 219, 223, .24); font-size: 19px; line-height: 1; }
:is(body.single-donghua, body.single-episode) .okd-rating-average-star::before,
:is(body.single-donghua, body.single-episode) .okd-rating-trigger-stars > span::before { position: absolute; inset: 0 auto 0 0; width: var(--rating-fill, 0%); overflow: hidden; color: #f3c66f; content: '★'; white-space: nowrap; }
:is(body.single-donghua, body.single-episode) .okd-rating-average-star { color: rgba(207, 219, 223, .24); font-size: 20px; }
:is(body.single-donghua, body.single-episode) .okd-rating-trigger-stars > span { width: 14px; font-size: 13px; }
:is(body.single-donghua, body.single-episode) .okd-rating-trigger { gap: 8px; }
/* Separate the two scores into readable cards and give the rating action its own row. */
:is(body.single-donghua, body.single-episode) .okd-rating-widget { display: grid; width: min(100%, 390px); min-width: 0; max-width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'site' 'audience' 'picker'; align-items: stretch; gap: 8px; padding: 9px; border: 1px solid var(--v4-line); border-radius: 16px; background: rgba(8, 20, 29, .82); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
:is(body.single-donghua, body.single-episode) .okd-rating-site-summary { display: flex; min-width: 0; min-height: 50px; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 9px; padding: 8px 12px; border: 1px solid var(--v4-line); border-radius: 12px; background: rgba(8, 20, 29, .62); }
:is(body.single-donghua, body.single-episode) .okd-rating-site-summary .okd-rating-summary-label { flex: 1 0 100%; color: var(--text-secondary); font-size: 11px; font-weight: 750; }
:is(body.single-donghua, body.single-episode) .okd-rating-summary { display: flex; min-width: 0; min-height: 50px; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 8px; padding: 8px 12px; border: 1px solid var(--v4-line); border-radius: 12px; background: rgba(8, 20, 29, .78); white-space: normal; }
:is(body.single-donghua, body.single-episode) .okd-rating-summary-label { flex: 1 0 100%; font-size: 11px; }
:is(body.single-donghua, body.single-episode) .okd-rating-average { font-size: 17px; }
:is(body.single-donghua, body.single-episode) .okd-rating-summary > .okd-rating-out-of { white-space: nowrap; }
:is(body.single-donghua, body.single-episode) .okd-rating-stars-display { gap: 0; }
:is(body.single-donghua, body.single-episode) .okd-rating-average-star { width: 14px; font-size: 14px; }
:is(body.single-donghua, body.single-episode) .okd-rating-count,
:is(body.single-donghua, body.single-episode) .okd-rating-empty { font-size: 10px; }
:is(body.single-donghua, body.single-episode) .okd-rating-picker { justify-self: start; }
:is(body.single-donghua, body.single-episode) .okd-rating-trigger { min-height: 36px; padding: 5px 10px; }
:is(body.single-donghua, body.single-episode) .okd-rating-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; direction: ltr; }
:is(body.single-donghua, body.single-episode) .okd-rating-choice {
    display: grid;
    min-width: 0;
    min-height: 42px;
    place-items: center;
    padding: 2px 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: rgba(207, 219, 223, .32);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1;
    cursor: pointer;
    transition: color .16s ease, transform .16s ease, filter .16s ease;
}
:is(body.single-donghua, body.single-episode) .okd-rating-choice:hover,
:is(body.single-donghua, body.single-episode) .okd-rating-choice.is-selected { border-color: transparent; background: transparent; color: #f3c66f; box-shadow: none; text-shadow: 0 0 12px rgba(243, 198, 111, .4); }
:is(body.single-donghua, body.single-episode) .okd-rating-choice:hover { transform: translateY(-2px) scale(1.08); }
:is(body.single-donghua, body.single-episode) .okd-rating-choice[aria-pressed="true"] { color: #ffdb88; }
:is(body.single-donghua, body.single-episode) .okd-rating-choice[aria-pressed="true"]::after { content: none; }
:is(body.single-donghua, body.single-episode) .okd-rating-picker[open] .okd-rating-panel { animation: rating-panel-enter .2s ease-out both; transform-origin: top right; }
:is(body.single-donghua, body.single-episode) .okd-rating-widget.is-rating-started .okd-rating-choice.is-selected { animation: rating-star-pop .48s cubic-bezier(.2,.8,.25,1) both; animation-delay: calc(var(--rating-index, 1) * 28ms); }
@keyframes rating-star-pop {
    0% { transform: scale(.72) rotate(-12deg); filter: brightness(.9); }
    55% { transform: scale(1.28) rotate(5deg); filter: brightness(1.3); }
    100% { transform: scale(1); filter: brightness(1); }
}
@keyframes rating-panel-enter { from { opacity: 0; translate: 0 -5px; } to { opacity: 1; translate: 0 0; } }

@media (min-width: 1600px) {
    body.single-episode .watch-inner-wrap { width: min(calc(100% - 72px), 1640px) !important; max-width: 1640px !important; }
    body.single-episode .watch-stage-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 360px) !important; gap: 30px !important; }
}
@media (max-width: 1024px) {
    body.single-episode .watch-inner-wrap { width: min(calc(100% - 32px), 900px) !important; }
    body.single-episode .watch-stage-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
    body.single-episode .player-dominant-column { grid-column: 1 !important; grid-row: 2 !important; gap: 12px; }
    body.single-episode .watch-sidebar-column { display: contents !important; }
    body.single-episode .watch-header-block { grid-column: 1 !important; grid-row: 1 !important; }
    body.single-episode .watch-comments-wrapper { width: min(100%, 900px); }
}
@media (max-width: 640px) {
    body.single-episode .watch-inner-wrap { width: calc(100% - 24px) !important; padding-top: 10px; }
    body.single-episode .watch-episode-title { font-size: clamp(20px, 6vw, 26px) !important; line-height: 1.4; }
    body.single-episode .watch-title-meta-group { gap: 9px; }
    body.single-episode .watch-meta-badges-row { gap: 6px; }
    body.single-episode .player-fixed-16x9 { border-radius: 12px !important; }
    body.single-episode .player-dominant-column { gap: 10px; }
    body.single-episode .watch-stream-hub { gap: 12px !important; padding: 13px !important; border-radius: 14px !important; }
    body.single-episode .stream-hub-servers-row { gap: 7px !important; }
    body.single-episode .stream-hub-servers-row .server-pill { min-height: 44px !important; }
    body.single-episode .watch-vlc-inline { min-height: 44px; }
    body.single-episode .watch-downloads-section { padding: 12px !important; }
    body.single-episode .watch-download-items { display: grid; grid-template-columns: minmax(0, 1fr); }
    body.single-episode .watch-download-item { width: 100%; min-height: 58px; }
    body.single-episode .watch-nav-quad-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.single-episode .watch-comments-wrapper { width: 100%; }
    :is(body.single-donghua, body.single-episode) .okd-rating-widget { width: min(100%, 390px); min-width: 0; gap: 7px; padding: 8px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-site-summary { min-height: 66px; padding: 8px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-summary { min-height: 66px; padding: 7px 8px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-picker { flex: 0 0 auto; }
    :is(body.single-donghua, body.single-episode) .okd-rating-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 12px; }
    :is(body.single-donghua, body.single-episode) .okd-rating-scale { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0; }
    :is(body.single-donghua, body.single-episode) .okd-rating-choice { min-height: 44px; font-size: clamp(16px, 5vw, 20px); }
    :is(body.single-donghua, body.single-episode) .okd-rating-average-star { width: 19px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    :is(body.single-donghua, body.single-episode) .okd-rating-picker[open] .okd-rating-panel,
    :is(body.single-donghua, body.single-episode) .okd-rating-widget.is-rating-started .okd-rating-choice.is-selected { animation: none !important; }
}

/* Keep the external score with the episode title and the audience score beside its views. */
body.single-episode .watch-title-meta-group {
    display: grid !important;
    grid-template-columns: max-content max-content;
    grid-template-areas: 'title site' 'meta meta';
    align-items: center;
    justify-content: initial !important;
    justify-items: start;
    gap: 8px 12px !important;
    direction: rtl;
}
body.single-episode .watch-episode-title { grid-area: title; min-width: 0; }
body.single-episode .watch-meta-badges-row { grid-area: meta; min-width: 0; }
body.single-episode .okd-rating-widget[data-rating-layout="site"] { display: contents; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.single-episode .okd-rating-site-summary {
    grid-area: site;
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    min-height: 34px;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 10px;
    border-color: rgba(243, 198, 111, .28);
    border-radius: 999px;
    background: rgba(243, 198, 111, .08);
    white-space: nowrap;
}
body.single-episode .okd-rating-site-summary .okd-rating-summary-label { flex: 0 0 auto; font-size: 11px; }
body.single-episode .okd-rating-site-average { font-size: 14px; }
body.single-episode .okd-rating-site-summary .okd-rating-star { color: #f3c66f; }
body.single-episode .okd-rating-summary {
    grid-area: auto;
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-height: 36px;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
body.single-episode .okd-rating-summary-label { flex: 0 0 auto; font-size: 10px; }
body.single-episode .okd-rating-average { font-size: 14px; }
body.single-episode .okd-rating-average-star { width: 12px; font-size: 12px; }
body.single-episode .okd-rating-count,
body.single-episode .okd-rating-empty { font-size: 10px; }
body.single-episode .okd-rating-picker { grid-area: auto; justify-self: auto; }
body.single-episode .okd-rating-trigger { min-height: 32px; padding: 4px 9px; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] { flex-wrap: nowrap; gap: 4px; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-stars-display,
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-count,
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-trigger-stars { display: none; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-summary { gap: 4px; padding: 5px 9px; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-picker { margin-inline-start: 0; }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid rgba(243, 198, 111, .4);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(243, 198, 111, .16), rgba(243, 198, 111, .07));
    color: #ffe2a0;
    font-size: 11px;
    font-weight: 800;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-trigger:hover,
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-picker[open] .okd-rating-trigger {
    border-color: #f3c66f;
    background: rgba(243, 198, 111, .2);
    box-shadow: 0 0 0 3px rgba(243, 198, 111, .08);
    color: #fff0c5;
    transform: translateY(-1px);
}
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-trigger-stars > span { color: rgba(243, 198, 111, .42); }
body.single-episode .okd-rating-widget[data-rating-layout="audience"] .okd-rating-trigger-stars > span::before { color: #f3c66f; }
body.single-episode .okd-rating-panel {
    width: min(360px, calc(100vw - 28px));
    padding: 18px;
    gap: 12px;
    border-color: rgba(124, 158, 174, .24);
    border-radius: 18px;
    background: radial-gradient(ellipse at 100% 0, rgba(243, 198, 111, .09), transparent 48%), #0d1a23;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255, 255, 255, .025);
}
body.single-episode .okd-rating-panel-heading { padding-block-end: 2px; }
body.single-episode .okd-rating-panel-heading strong { font-size: 16px; letter-spacing: -.01em; }
body.single-episode .okd-rating-close { width: 38px; height: 38px; border-radius: 12px; }
body.single-episode .okd-rating-hint { color: #a9bbc4; font-size: 12px; line-height: 1.8; text-align: center; }
body.single-episode .okd-user-rating {
    width: fit-content;
    min-width: 92px;
    margin: 0 auto;
    padding: 6px 12px;
    border: 1px solid rgba(243, 198, 111, .24);
    border-radius: 999px;
    background: rgba(243, 198, 111, .08);
    color: #f5d58e;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}
body.single-episode .okd-rating-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
body.single-episode .okd-rating-choice {
    display: flex;
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    border: 1px solid rgba(142, 167, 179, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    color: rgba(190, 207, 214, .44);
    font-size: 21px;
}
body.single-episode .okd-rating-choice::after {
    position: static;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #8fa3ad;
    content: attr(data-rating-value);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
body.single-episode .okd-rating-choice:hover,
body.single-episode .okd-rating-choice.is-selected {
    border-color: rgba(243, 198, 111, .42);
    background: rgba(243, 198, 111, .1);
    color: #ffd77e;
}
body.single-episode .okd-rating-choice[aria-pressed="true"]::after { color: #ffe5ad; }
body.single-episode .okd-rating-choice:focus-visible { outline: 2px solid #f3c66f; outline-offset: 2px; }
@media (max-width: 640px) {
    body.single-episode .watch-title-meta-group {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: 'title' 'site' 'meta';
        align-items: start;
        gap: 8px !important;
    }
    body.single-episode .okd-rating-site-summary,
    body.single-episode .okd-rating-summary { width: fit-content; max-width: 100%; }
    body.single-episode .okd-rating-picker { justify-self: start; }
}
