body:is(.front,.dpab){--brand-word-a:#4253cc;--brand-word-b:#6833b5}
[data-portal-theme="dark"] body:is(.front,.dpab){--brand-word-a:#9aaaff;--brand-word-b:#c99fff}
body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand,.dpab-brand,.iqiyi-brand,.keke-brand,.keke-sidebar-brand,.ref-footer-brand a,.haoju-logo-copy,.brand-copy) strong,body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand) h1:not(:has(strong)),body.front .gold-brand-text{color:var(--brand-word-a)}
@supports(background-clip:text){
body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand,.dpab-brand,.iqiyi-brand,.keke-brand,.keke-sidebar-brand,.ref-footer-brand a,.haoju-logo-copy,.brand-copy) strong,body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand) h1:not(:has(strong)),body.front .gold-brand-text{background-image:linear-gradient(110deg,var(--brand-word-a),var(--brand-word-b));background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
}
@media(forced-colors:active){
body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand,.dpab-brand,.iqiyi-brand,.keke-brand,.keke-sidebar-brand,.ref-footer-brand a,.haoju-logo-copy,.brand-copy) strong,body.front :is(.nn24-brand,.nnin-brand,.dd-brand,.jp-brand,.rn-brand,.dbku-brand) h1:not(:has(strong)),body.front .gold-brand-text{background-image:none!important;color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}
}

/* The original site surface resumes after the first viewport. */
body:where(.front,.dpab) {
  --fold-base: var(--cinema-page, var(--bg, #f6f8fc));
  --fold-light: 40%;
  --fold-hue-a: #36cbaa;
  --fold-hue-b: #8b8cf3;
  --fold-a: color-mix(in srgb, var(--fold-hue-a) var(--fold-light), var(--fold-base));
  --fold-b: color-mix(in srgb, var(--fold-hue-b) var(--fold-light), var(--fold-base));
  --fold-depth: clamp(32rem, 100svh, 64rem);
  --fold-origin: 8%;
  --fold-opposite: 94%;
}

body.front:is(.tpl-nnyy24,.tpl-openframe) {
  --fold-hue-a: #27c898;
  --fold-hue-b: #4a9cf5;
}
body.front:is(.tpl-nnyyin,.tpl-anywhere) {
  --fold-hue-a: #f38859;
  --fold-hue-b: #ac6af0;
  --fold-origin: 88%;
  --fold-opposite: 4%;
}
body.front:is(.tpl-ddys,.tpl-jinpai) {
  --fold-hue-a: #f4ae46;
  --fold-hue-b: #ea765e;
}
body.front:is(.tpl-applecinema,.tpl-moviedb) {
  --fold-hue-a: #4b9dff;
  --fold-hue-b: #8b79f4;
}
body.front.tpl-dbku, body.dpab {
  --fold-hue-a: #42cbb5;
  --fold-hue-b: #7891f4;
}
body.front:is(.tpl-haoju,.haoju-template) {
  --fold-hue-a: #38c4c7;
  --fold-hue-b: #ef8c53;
}
body.front.iqiyi-template {
  --fold-hue-a: #30c878;
  --fold-hue-b: #59b1f2;
  --fold-origin: 20%;
}
body.front.keke-template {
  --fold-hue-a: #467cfa;
  --fold-hue-b: #5fd7d0;
  --fold-origin: 18%;
}
body.front:is(.tpl-oletv-direct-v2,.site-oletv) {
  --fold-hue-a: #24c96b;
  --fold-hue-b: #ec603d;
  --fold-opposite: 84%;
}

:root:is([data-portal-theme="dark"],[data-db-theme="dark"],[data-theme="dark"])
  body:is(.front,.dpab) {
  --fold-base: var(--cinema-page, var(--bg, #141924));
  --fold-light: 32%;
}

/* Match the reference-template background rules without changing inner cards. */
html:root body:is(.front,.dpab):is([class*="tpl-"],[data-site-id],.portal),
html:root:is([data-portal-theme="dark"],[data-theme="dark"]) body.front.portal.site-oletv.tpl-keke {
  background-image:
    linear-gradient(180deg, transparent 32%, var(--fold-base) 99%),
    radial-gradient(ellipse at var(--fold-origin) 12%, var(--fold-a) 0%, transparent 58%),
    radial-gradient(ellipse at var(--fold-opposite) 42%, var(--fold-b) 0%, transparent 66%) !important;
  background-color: var(--fold-base) !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: 100% var(--fold-depth) !important;
  background-attachment: scroll !important;
}

/* Navigation stays legible while fixed or sticky. */
html:root[data-portal-theme] body.front:has(> .ref-shell .ref-brand[data-cms-brand]) > .ref-shell,
html:root body.front > .ref-shell,
html:root body.front.portal :is(.ds3-head,.iqiyi-header,.keke-topbar),
html:root body.dpab[data-site-id] > .dpab-header {
  background:
    linear-gradient(108deg,
      color-mix(in srgb, var(--fold-a) 50%, var(--fold-base)),
      color-mix(in srgb, var(--fold-b) 38%, var(--fold-base))) !important;
}

@media (max-width: 720px) {
  body:is(.front,.dpab) {
    --fold-origin: 0%;
    --fold-opposite: 100%;
    --fold-depth: clamp(31rem, 100svh, 52rem);
  }
}

@media (forced-colors: active) {
  html:root body:is(.front,.dpab):is([class*="tpl-"],[data-site-id],.portal),
html:root:is([data-portal-theme="dark"],[data-theme="dark"]) body.front.portal.site-oletv.tpl-keke {
    background: Canvas !important;
  }
  html:root[data-portal-theme] body.front:has(> .ref-shell .ref-brand[data-cms-brand]) > .ref-shell,
  html:root body.front > .ref-shell,
  html:root body.front.portal :is(.ds3-head,.iqiyi-header,.keke-topbar),
  html:root body.dpab[data-site-id] > .dpab-header {
    background: Canvas !important;
  }
}

/* Keep the category banner within the existing page column. */
body.front.portal.tpl-haoju.catalog-page .stream-category-mid-ad {
  max-width: 100%;
}

/* Theme-specific colors keep the site name readable on either header surface. */
body:is(.front,.dpab) {
  --fold-logo-a: #074fb0;
  --fold-logo-b: #a61b75;
}
body:is(.tpl-nnyy24,.tpl-openframe,.tpl-haoju,.tpl-iqiyi,.tpl-oletv-direct-v2) {
  --fold-logo-a: #00614e;
  --fold-logo-b: #224cca;
}
body:is(.tpl-nnyyin,.tpl-anywhere,.tpl-jinpai,.tpl-ddys) {
  --fold-logo-a: #a63214;
  --fold-logo-b: #87219e;
}
:root:is([data-portal-theme="dark"],[data-db-theme="dark"],[data-theme="dark"])
  body:is(.front,.dpab) {
  --fold-logo-a: #60dcff;
  --fold-logo-b: #f1a2fa;
}
:root:is([data-portal-theme="dark"],[data-db-theme="dark"],[data-theme="dark"])
  body:is(.tpl-nnyy24,.tpl-openframe,.tpl-haoju,.tpl-iqiyi,.tpl-oletv-direct-v2) {
  --fold-logo-a: #68efca;
  --fold-logo-b: #97adff;
}
:root:is([data-portal-theme="dark"],[data-db-theme="dark"],[data-theme="dark"])
  body:is(.tpl-nnyyin,.tpl-anywhere,.tpl-jinpai,.tpl-ddys) {
  --fold-logo-a: #ffbd5b;
  --fold-logo-b: #f9a1ce;
}

/* Match only logo lettering, including heading-only and compact mobile labels. */
html:root body:is(.front,.dpab) :is(header,.ref-shell)
  :is(.ref-brand,.dpab-brand,.ds3-logo,.iqiyi-brand,.keke-brand,.jv2-brand,.brand-copy)
  :is(strong,h1:not(:has(strong)),.brand-name,.logo-text) {
  color: var(--brand-word-a,var(--fold-logo-a));
}
@supports (background-clip:text) {
  html:root body:is(.front,.dpab) :is(header,.ref-shell)
    :is(.ref-brand,.dpab-brand,.ds3-logo,.iqiyi-brand,.keke-brand,.jv2-brand,.brand-copy)
    :is(strong,h1:not(:has(strong)),.brand-name,.logo-text),
  html:root:is([data-portal-theme],[data-db-theme],[data-theme]) body:is(.front,.dpab)
    :is(header,.ref-shell) :is(.ref-brand,.dpab-brand,.ds3-logo,.iqiyi-brand,.keke-brand,.jv2-brand,.brand-copy)
    :is(strong,h1:not(:has(strong)),.brand-name,.logo-text) {
    background-image: linear-gradient(105deg,var(--brand-word-a,var(--fold-logo-a)),var(--brand-word-b,var(--fold-logo-b))) !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
}
@media (forced-colors: active) {
  html:root body:is(.front,.dpab) :is(header,.ref-shell)
    :is(.ref-brand,.dpab-brand,.ds3-logo,.iqiyi-brand,.keke-brand,.jv2-brand,.brand-copy)
    :is(strong,h1:not(:has(strong)),.brand-name,.logo-text),
  html:root:is([data-portal-theme],[data-db-theme],[data-theme]) body:is(.front,.dpab)
    :is(header,.ref-shell) :is(.ref-brand,.dpab-brand,.ds3-logo,.iqiyi-brand,.keke-brand,.jv2-brand,.brand-copy)
    :is(strong,h1:not(:has(strong)),.brand-name,.logo-text) {
    background-image: none !important;
    color: CanvasText !important;
    -webkit-text-fill-color: CanvasText !important;
  }
}
