body.front {
  --cms-nav-ink: #182330;
  --cms-nav-muted: #526174;
  --cms-nav-panel: #fff;
  --cms-nav-soft: #eef2f6;
  --cms-nav-border: #dbe2eb;
  --cms-nav-active: var(--cms-accent-day,#134e73);
  --cms-nav-active-bg: #e4f1fa;
  --cms-nav-shadow: 0 14px 34px #192b4025;
  --cms-brand-end: var(--cms-brand-day,#365a88);
  --cms-app-start: #005eaa;
  --cms-app-end: #a11a72;
  --cms-page-wash: color-mix(in srgb, var(--cms-nav-active) 13%, transparent);
}

html:is([data-portal-theme="dark"], [data-db-theme="dark"]) body.front {
  --cms-nav-ink: #f2f5fa;
  --cms-nav-muted: #b8c4d5;
  --cms-nav-panel: #1c212a;
  --cms-nav-soft: #262e3a;
  --cms-nav-border: #3c4858;
  --cms-nav-active: var(--cms-accent-night,#91d9f9);
  --cms-nav-active-bg: #243e50;
  --cms-nav-shadow: 0 14px 34px #0006;
  --cms-brand-end: var(--cms-brand-night,#c2d6f4);
  --cms-app-start: #65e7ff;
  --cms-app-end: #ffbdeb;
  --cms-page-wash: color-mix(in srgb, var(--cms-nav-active) 12%, transparent);
}

body.front:is(.tpl-dbku,.tpl-anywhere) { --cms-accent-day: #166150; --cms-accent-night: #92e3cc; }
body.front:is(.tpl-nnyyin,.tpl-moviedb) { --cms-accent-day: #235d89; --cms-accent-night: #a0d7fc; }
body.front:is(.tpl-nnyy24,.tpl-ddys) { --cms-accent-day: #884522; --cms-accent-night: #f0bc98; }
body.front.tpl-jinpai { --cms-accent-day: #76501b; --cms-accent-night: #efca88; }
body.front.tpl-openframe { --cms-accent-day: #295e71; --cms-accent-night: #a0dcf0; }
body.front.tpl-applecinema { --cms-accent-day: #255da7; --cms-accent-night: #a4c9fb; }
body.front:is(.tpl-dbku,.tpl-nnyy24) { --cms-brand-day: #284f85; --cms-brand-night: #abcaff; }
body.front:is(.tpl-ddys,.tpl-jinpai) { --cms-brand-day: #705125; --cms-brand-night: #f3d6a5; }
body.front.tpl-anywhere { --cms-brand-day: #4a5274; --cms-brand-night: #b2c9f1; }


@supports (color: color-mix(in srgb,white,black)) {
  html body.front { --cms-nav-active-bg: color-mix(in srgb,var(--cms-nav-active) 12%,var(--cms-nav-panel)); }
  html:is([data-portal-theme="dark"],[data-db-theme="dark"]) body.front {
    --cms-nav-active-bg: color-mix(in srgb,var(--cms-nav-active) 15%,var(--cms-nav-panel));
  }
}

body.front :is(.cms-nav-desktop,.cms-nav-mobile,.cms-category-panel,.cms-mobile-footer)
  :is(a,button,summary):focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 2px;
}

body.front .cms-nav-desktop {
  display: flex;
  align-items: center;
  gap: clamp(4px,.8vw,13px);
  flex: 0 0 auto;
  margin-inline-end: auto;
  white-space: nowrap;
  font-size: 15px;
}

body.front .cms-nav-desktop :is(a,summary) {
  text-decoration: none;
  color: var(--cms-nav-ink);
}

body.front .cms-nav-desktop > a,
body.front .cms-nav-channel > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
  font-weight: 560;
  position: relative;
  border-radius: 7px;
}

body.front .cms-nav-desktop :is(a:hover,a[aria-current]) {
  color: var(--cms-nav-active) !important;
}

body.front .cms-nav-desktop > a[aria-current]::after,
body.front .cms-nav-channel > a[aria-current]::after {
  content: "";
  position: absolute;
  inset: auto 4px 4px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

body.front .cms-nav-channel {
  display: flex;
  align-items: center;
  position: relative;
}

body.front .cms-nav-submenu {
  position: static;
}

body.front .cms-nav-submenu > summary,
body.front .cms-nav-mobile > summary,
body.front .cms-nav-mobile-channel > summary,
body.front .cms-language > summary,
body.front .cms-category-more > summary {
  list-style: none;
  cursor: pointer;
}
body.front :is(.cms-nav-submenu,.cms-nav-mobile,.cms-nav-mobile-channel,.cms-language,.cms-category-more)
  > summary::-webkit-details-marker { display: none; }

body.front .cms-nav-submenu > summary {
  display: grid;
  place-items: center;
  width: 27px;
  height: 42px;
  border-radius: 5px;
}

body.front .cms-nav-submenu > summary > span,
.cms-nav-arrow {
  display: inline-block;
  width: 9px;
  height: 5px;
  background-color: currentColor;
  clip-path: polygon(0 0,100% 0,50% 100%);
}
body.front .cms-nav-submenu[open] > summary > span,
body.front .cms-nav-mobile-channel[open] > summary > .cms-nav-arrow {
  transform: rotate(180deg);
}

body.front .cms-nav-submenu[open] > summary,
body.front .cms-nav-submenu > summary:hover {
  color: var(--cms-nav-active) !important;
  background: var(--cms-nav-active-bg) !important;
}

body.front .cms-nav-flyout {
  position: absolute;
  inset: calc(100% + 5px) auto auto 0;
  z-index: 55;
  width: min(390px,32vw);
  box-sizing: border-box;
  padding: 12px;
  background: var(--cms-nav-panel) !important;
  border: 1px solid var(--cms-nav-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--cms-nav-shadow) !important;
}

body.front .cms-nav-flyout ul,
body.front .cms-nav-mobile-channel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

body.front .cms-nav-flyout a,
body.front .cms-nav-mobile-panel a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 9px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--cms-nav-ink);
}

body.front .cms-nav-flyout a:hover,
body.front .cms-nav-mobile-panel a:is(:hover,[aria-current]) {
  background: var(--cms-nav-active-bg) !important;
  color: var(--cms-nav-active) !important;
}

html body.front .ref-shell :is(.cms-nav-desktop,.cms-nav-quick) > a.cms-app-entry {
  background: transparent !important;
}
body.front .cms-app-entry:is(:hover,:focus-visible) > span,
body.front .cms-app-prompt > a:is(:hover,:focus-visible) > span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cms-mobile-footer { display: none !important; }

html body.front[class] section.cms-category-panel {
  display: grid !important;
  gap: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 10px 0 14px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--cms-nav-ink);
}

body.front .cms-category-row {
  display: grid;
  grid-template-columns: 65px minmax(0,1fr);
  align-items: start;
  gap: 11px;
  padding-block: 4px;
}

body.front .cms-category-row > span {
  padding-top: 8px;
  color: var(--cms-nav-muted);
  font-size: 13px;
  font-weight: 650;
}

body.front .cms-category-row nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px 7px;
  min-width: 0;
  margin: 0;
}

body.front[class] .cms-category-row nav a {
  min-height: 34px;
  max-width: 100%;
  padding: 5px 11px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px !important;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cms-nav-panel) 44%, transparent), color-mix(in srgb, var(--cms-nav-panel) 10%, transparent)) !important;
  color: var(--cms-nav-ink) !important;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
}

body.front[class] .cms-category-row nav a:is(:hover,[aria-current]) {
  background: linear-gradient(125deg, var(--cms-nav-active-bg), color-mix(in srgb, var(--cms-brand-end) 13%, var(--cms-nav-panel))) !important;
  color: var(--cms-nav-active) !important;
}

body.front .cms-category-row nav a[aria-current] { font-weight: 700; }

body.front .cms-category-more > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 3px;
  font-size: 13px;
  color: var(--cms-nav-muted);
  cursor: pointer;
}

body.front .cms-category-more > summary::-webkit-details-marker { display: none; }
body.front .cms-category-more[open] > summary .cms-nav-arrow { transform: rotate(225deg); }
body.front #reference-category-filters { scroll-margin-top: 72px; }
body.front .cms-category-options { display: grid; gap: 4px; min-width: 0; }
body.front .cms-category-toggle { display: none !important; }


body.front .cms-category-heading { margin-block: 18px 8px; }

body.front:is(.ref-player-layout-v2,.db-player-page) .ref-player-information {
  min-width: 0;
  padding: clamp(10px,1.1vw,15px);
  border: 1px solid var(--cms-nav-border);
  border-radius: 12px;
  background: var(--cms-nav-panel);
  color: var(--cms-nav-ink);
}

body.front:is(.ref-player-layout-v2,.db-player-page) .ref-player-content-tabs {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 3px;
  padding: 3px;
  margin: 0 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--cms-nav-soft);
}

html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page) .ref-player-content-tabs > a {
  min-width: 0;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 4px !important;
  border-radius: 7px;
  box-shadow: none;
  text-decoration: none;
  color: var(--cms-nav-muted) !important;
}

html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page) .ref-player-content-tabs > a:is([aria-selected="true"],:hover) {
  color: var(--cms-nav-active) !important;
  background: var(--cms-nav-panel) !important;
}

body.front .ref-player-information :is(a,button,summary,textarea,select):focus-visible {
  outline: 2px solid var(--cms-nav-active) !important;
  outline-offset: 2px !important;
}

body.front .ref-player-information .ref-player-summary {
  overflow-wrap: anywhere;
}

@media (max-width: 1079px) {
  html body.front .cms-nav-desktop { display: none !important; }
}
  html body.front[class] header[class] details.cms-nav-mobile {
    display: block !important;
    position: relative;
    flex: none;
    order: 4;
  }
  html body.front .cms-nav-mobile > summary {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--cms-nav-ink);
  }
  body.front .cms-nav-mobile > summary > svg {
    display: block;
    width: 21px;
    height: 21px;
  }
  body.front .cms-nav-mobile[open] > summary { background: var(--cms-nav-soft); }
  html body.front[class] header[class] .cms-nav-mobile-panel {
    position: absolute;
    inset: calc(100% + 6px) 0 auto auto;
    z-index: 65;
    box-sizing: border-box;
    width: min(410px,calc(100vw - 24px));
    max-height: calc(100dvh - 124px);
    padding: 8px 12px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--cms-nav-border) !important;
    border-radius: 16px !important;
    background: linear-gradient(145deg, color-mix(in srgb,var(--cms-brand-end) 11%,var(--cms-nav-panel)), var(--cms-nav-panel) 72%) !important;
    color: var(--cms-nav-ink);
    box-shadow: var(--cms-nav-shadow) !important;
  }

body.front :is(.cms-nav-quick,.cms-nav-resources) {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 2px;
}
body.front .cms-nav-quick {
  grid-template-columns: repeat(2,minmax(0,1fr));
  padding-bottom: 6px;
}
body.front .cms-nav-quick > a {
  min-height: 42px;
  justify-content: center;
  font-size: 14px;
  font-weight: 650;
}
body.front .cms-nav-primary {
  padding-block: 4px;
  border-block: 1px solid var(--cms-nav-border);
}
body.front .cms-nav-mobile-channel > summary,
body.front .cms-nav-primary > .cms-nav-standalone {
  display: grid;
  grid-template-columns: 23px minmax(0,1fr) 10px;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 9px;
  border-radius: 9px;
  font-weight: 650;
}
body.front .cms-nav-primary > .cms-nav-standalone::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
body.front .cms-nav-desktop > .cms-nav-standalone > svg { display: none; }
body.front .cms-nav-primary :is(.cms-nav-standalone,summary) > svg {
  width: 19px;
  height: 19px;
  color: var(--cms-nav-active);
}
body.front .cms-nav-mobile-channel:is([open],[data-current-channel]) > summary,
body.front .cms-nav-mobile-channel > summary:hover {
  background: var(--cms-nav-active-bg);
  color: var(--cms-nav-active);
}
body.front .cms-nav-mobile-channel ul { padding: 3px 0 7px 27px; }
body.front .cms-nav-resources { padding-block: 5px; font-size: 13px; }
body.front .cms-nav-resources a {
  justify-content: center;
  min-height: 38px;
  padding-inline: 4px;
  text-align: center;
}
body.front .cms-nav-resources { border-top: 1px solid var(--cms-nav-border); }
body.front .cms-nav-resources a { color: var(--cms-nav-muted); }

body.front .cms-language { position: relative; }
body.front .cms-language[hidden] { display: none; }
body.front .cms-language > summary {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  min-width: 44px;
  min-height: 42px;
  padding-inline: 3px;
  border-radius: 8px;
  background: transparent;
  color: var(--cms-nav-ink);
  font-size: 12px;
  font-weight: 650;
}
body.front .cms-language > summary > svg { width: 19px; height: 19px; flex: none; }
body.front .cms-language[open] > summary,
body.front .cms-language > summary:hover { color: var(--cms-nav-active); }
body.front .cms-language-options {
  position: absolute;
  inset: calc(100% + 2px) 0 auto auto;
  z-index: 66;
  display: grid;
  gap: 3px;
  width: max-content;
  min-width: 126px;
  padding: 5px;
  border: 1px solid var(--cms-nav-border);
  border-radius: 10px;
  background: var(--cms-nav-panel);
  box-shadow: var(--cms-nav-shadow);
}
body.front .cms-language-options > button {
  display: block;
  min-height: 38px;
  padding: 2px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cms-nav-ink);
  font: inherit;
  font-size: 13px;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}
body.front .cms-language-options > button:is(:hover,[aria-pressed="true"]) {
  background: var(--cms-nav-active-bg);
  color: var(--cms-nav-active);
}

@media (max-width: 700px) {
  html body.front[class] section.cms-category-panel { margin: 8px 0 12px; }
  body.front .cms-category-row {
    grid-template-columns: 44px minmax(0,1fr);
    gap: 5px;
    padding-block: 3px;
  }
  body.front .cms-category-row > span { padding-top: 10px; font-size: 12px; }
  body.front .cms-category-row nav { gap: 4px; }
  body.front[class] .cms-category-row nav a { min-height: 36px; padding-inline: 8px; font-size: 13px; }
  body.front .cms-category-panel.is-collapsed .cms-category-options { display: none; }
  body.front .cms-category-panel.is-collapsed > .cms-category-row > nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }
  body.front .cms-category-panel.is-collapsed > .cms-category-row > nav > a { flex: 0 0 auto; }
  body.front .cms-category-panel.is-collapsed > .cms-category-row > nav::-webkit-scrollbar { display: none; }
  body.front[class] .cms-category-toggle:not([hidden]) {
    justify-self: start;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-inline-start: 49px;
    padding: 5px 11px;
    border: 0;
    border-radius: 999px !important;
    background: linear-gradient(125deg, var(--cms-nav-active-bg), color-mix(in srgb, var(--cms-brand-end) 12%, var(--cms-nav-panel))) !important;
    color: var(--cms-nav-active) !important;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
  }
  body.front .cms-category-toggle[aria-expanded="true"] .cms-nav-arrow { transform: rotate(225deg); }


  html body.front[class]:has(.cms-mobile-footer) {
    --cms-dock-size: 54px;
    --cms-app-size: 46px;
    padding-bottom: calc(var(--cms-dock-size) + 6px + env(safe-area-inset-bottom,0px)) !important;
  }

  html body.front[class]:has(.cms-app-prompt:not([hidden])) {
    padding-bottom: calc(var(--cms-dock-size) + var(--cms-app-size) + 6px + env(safe-area-inset-bottom,0px)) !important;
  }

  html body.front .cms-mobile-footer {
    display: block !important;
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
  }

  html body.front[class] .cms-mobile-footer > .ref-mobile-dock {
    display: flex !important;
    position: static !important;
    min-height: calc(var(--cms-dock-size) + env(safe-area-inset-bottom,0px));
    box-sizing: border-box;
    padding: 0 8px env(safe-area-inset-bottom,0px);
    background: var(--cms-nav-panel) !important;
    color: var(--cms-nav-ink);
    border-top: 1px solid var(--cms-nav-border) !important;
  }

  html body.front[class] .cms-mobile-footer > .ref-mobile-dock > a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 53px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 0;
    font-size: 11px !important;
    line-height: 1.15;
    color: var(--cms-nav-muted) !important;
    text-decoration: none;
  }
  body.front .cms-mobile-footer > .ref-mobile-dock > a > svg {
    width: 20px;
    height: 20px;
  }
  html body.front[class] .cms-mobile-footer > .ref-mobile-dock > a[aria-current] {
    color: var(--cms-nav-active) !important;
    font-weight: 700 !important;
  }

  html body.front[class] .cms-mobile-footer > .ref-mobile-dock > a[aria-current] > svg {
    box-sizing: content-box;
    margin-block: -2px;
    padding: 2px 9px;
    border-radius: 10px;
    background: var(--cms-nav-active-bg);
  }

  html body.front[class] .cms-mobile-footer > .cms-app-prompt {
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    min-height: var(--cms-app-size);
    padding: 1px max(12px, env(safe-area-inset-right,0px)) 1px max(12px, env(safe-area-inset-left,0px));
    border: 0 !important;
    border-top: 1px solid var(--cms-nav-border) !important;
    border-radius: 0 !important;
    background: var(--cms-nav-panel) !important;
    color: var(--cms-nav-ink);
    font-size: 13px;
  }

  html body.front[class] .cms-mobile-footer > .cms-app-prompt[hidden],
  body.front .cms-app-prompt button[hidden] { display: none; }

  body.front .cms-app-prompt > svg { width: 19px; height: 19px; flex: none; color: var(--cms-nav-active); }
  body.front .cms-app-copy { flex: 1; min-width: 0; }
  body.front .cms-app-copy :is(strong,small) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
  }
  body.front .cms-app-copy > strong { font-size: 13px; }
  body.front .cms-app-copy > small { color: var(--cms-nav-muted); font-size: 11px; margin-top: 2px; }
  body.front .cms-app-prompt > :is(a,button) {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border: 0;
    border-radius: 6px;
    text-decoration: none;
  }
  html body.front[class] .cms-app-prompt > a {
    min-height: 44px;
    padding-inline: 6px;
    background: transparent !important;
    font-weight: 650;
  }
  body.front .cms-app-prompt > button {
    min-width: 34px;
    font: inherit;
    font-size: 20px;
    color: var(--cms-nav-muted);
    cursor: pointer;
    background: transparent;
  }

  html body.front:is(.projection-mode,:has(:fullscreen)) .cms-mobile-footer {
    display: none !important;
  }
}

.ref-home-cover {
  min-width: 0;
  margin: 14px 0 24px;
}

.ref-home-cover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

body.front .ref-home-cover-head h2 {
  margin: 0;
  color: var(--ui-ink, var(--cms-nav-ink));
  font: 700 clamp(24px, 2.6vw, 38px)/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}

.ref-home-cover-head a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 7px;
  color: var(--ui-accent, var(--cms-nav-active));
  font-size: 14px;
  font-weight: 600;
}

.ref-home-cover-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: clamp(16px, 2.7vw, 40px);
  padding: 19px clamp(10px, 1.5vw, 22px) 30px;
}

.ref-home-cover-card {
  --cover-angle: 3deg;
  --cover-offset: 0px;
  min-width: 0;
  transform: translateY(var(--cover-offset)) rotate(var(--cover-angle));
}

.ref-home-cover-card:nth-child(even) {
  --cover-angle: 4deg;
  --cover-offset: 12px;
}

.ref-home-cover-card:nth-child(3) {
  --cover-angle: 1.5deg;
  --cover-offset: -4px;
}

body.front .ref-home-cover-card > a {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  isolation: isolate;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  background: #192a35;
  box-shadow: 0 10px 20px -9px #061522a6, inset 0 0 0 1px #fff3;
}

.ref-home-cover-card > a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #07141bdc, transparent 33%, #07141b0d 43%, #07141bc9 77%, #07141bf5);
  box-shadow: inset 0 0 0 1px #ffffff30;
}

body.front .ref-home-cover-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  object-fit: cover;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-brand {
  position: absolute;
  top: 7%;
  inset-inline: 8%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff !important;
  font: 700 clamp(16px, 2vw, 30px)/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  text-shadow: 0 1px 8px #000b;
}

.ref-home-cover-story {
  position: absolute;
  bottom: 7%;
  inset-inline: 8%;
  color: #fff;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-category {
  display: block;
  margin-bottom: 5px;
  color: #eef4f6 !important;
  font-size: 12px;
}

body.front .ref-home-cover-story h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  color: #fff;
  font: 700 clamp(17px, 1.8vw, 28px)/1.25 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  text-shadow: 0 1px 8px #000a;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-arrow {
  display: block;
  margin-top: 7px;
  color: #fff !important;
  font-size: 20px;
  line-height: 1;
  text-align: end;
}

.ref-home-cover :is(a:focus-visible) {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 3px;
}

.ref-home-cover-hint {
  display: none;
}

@media (max-width: 720px) {
  .ref-home-cover {
    margin: 8px 0 18px;
  }

  .ref-home-cover-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(128px, 44%);
    gap: 16px;
    padding: 15px 10px 25px;
    overflow-x: auto;
    scroll-padding-inline: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .ref-home-cover-card {
    scroll-snap-align: start;
  }

  .ref-home-cover-card:nth-child(even) {
    --cover-offset: 7px;
  }

  .ref-home-cover-brand {
    font-size: clamp(18px, 4vw, 26px);
  }

  .ref-home-cover-hint {
    display: block;
    margin: 3px 0 0;
    color: var(--ui-muted, var(--cms-nav-muted));
    font-size: 12px;
  }
}


/* One gradient surface and one set of icon controls for each reference skin. */
html body.front:is(.tpl-nnyy24,.tpl-nnyyin,.tpl-ddys,.tpl-jinpai,.tpl-openframe,.tpl-applecinema,.tpl-moviedb,.tpl-anywhere) {
  background-image: radial-gradient(ellipse at 15% 0, var(--cms-page-wash) 0%, transparent 470px),
                    linear-gradient(135deg, var(--ui-page-a), var(--ui-page-b)) !important;
}
html body.front.dpab.tpl-dbku {
  background-image: radial-gradient(ellipse at 15% 0, var(--cms-page-wash) 0%, transparent 470px),
                    linear-gradient(135deg, var(--dp-bg), color-mix(in srgb, var(--dp-bg) 80%, var(--cms-nav-panel))) !important;
}
body.front .ref-shell .cms-nav-desktop { order: 1; }
body.front .ref-shell .ref-search-menu { order: 2; }
body.front .ref-shell .cms-header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
body.front .cms-header-actions > :is(a,button),
html[data-portal-theme] body.front[class] .ref-shell :is(.ref-search-menu,.cms-nav-mobile) > summary {
  display: grid !important;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  width: 42px !important;
  height: 42px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--cms-nav-ink) !important;
  text-decoration: none;
  cursor: pointer;
}
html[data-portal-theme] body.front[class] .ref-shell :is(.ref-search-menu,.cms-nav-mobile)[open] > summary,
html[data-portal-theme] body.front[class] .ref-shell :is(.ref-search-menu,.cms-nav-mobile) > summary:hover,
body.front .cms-header-actions > :is(a,button):hover {
  color: var(--cms-nav-active) !important;
}
body.front .cms-header-actions > :is(a,button):focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 2px;
}
body.front .cms-header-actions svg,
body.front .ref-shell :is(.ref-search-menu,.cms-nav-mobile) > summary > svg {
  width: 21px;
  height: 21px;
  display: block;
}
html[data-portal-theme] body.front .ref-shell .ref-search-menu > .ref-menu-toggle > .ref-search-label,
body.front .cms-header-actions .theme-label { display: none !important; }

html[data-portal-theme] body.front[class] .ref-shell .ref-brand > img {
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  flex: none;
  box-sizing: border-box;
  object-fit: contain;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  background: linear-gradient(var(--cms-logo-plate,#f8fafc),var(--cms-logo-plate,#f8fafc)) padding-box,
              linear-gradient(140deg,var(--cms-nav-active),var(--cms-brand-end)) border-box !important;
}
body.front.tpl-dbku .ref-shell .ref-brand { --cms-logo-plate: #182d36; }
html[data-portal-theme] body.front[class] .ref-shell .ref-brand > :is(h1,strong) {
  color: var(--cms-nav-ink) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-weight: 750 !important;
}
html[data-portal-theme] body.front[class] .ref-shell .ref-brand:focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 3px;
  border-radius: 10px;
}
@media (forced-colors: active) {
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > img {
    background: Canvas !important;
    border-color: CanvasText !important;
  }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > :is(h1,strong) {
    color: LinkText !important;
  }
}
body.front :is(.cms-app-entry > span,.cms-app-copy > strong,.cms-app-prompt > a > span) {
  color: var(--cms-app-start) !important;
}
@supports (background-clip: text) {
  body.front :is(.cms-app-entry > span,.cms-app-copy > strong,.cms-app-prompt > a > span) {
    background: linear-gradient(105deg, var(--cms-app-start), var(--cms-app-end));
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  body.front :is(.cms-app-entry > span,.cms-app-copy > strong,.cms-app-prompt > a > span) {
    color: LinkText !important;
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}
body.front .cms-db-menu-tools { display: flex; gap: 12px; padding: 4px 6px; }
body.front .cms-db-menu-tools svg { width: 19px; height: 19px; }
body.front .cms-db-menu-tools > button { background: transparent; border: 0; cursor: pointer; }
body.front .cms-db-menu-tools .db-dropdown { position: static; min-width: 0; }
body.front.tpl-dbku .ref-shell .ref-header-row { --ui-content-width: 1440px; }
@media (max-width: 460px) {
  html[data-portal-theme] body.front[class] .ref-shell .ref-header-row { gap: 3px !important; }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > :is(h1,strong) { font-size: 16px !important; }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > img {
    width: 35px !important;
    height: 35px !important;
    border-radius: 9px !important;
  }
  body.front .cms-header-actions > :is(a,button),
  html[data-portal-theme] body.front[class] .ref-shell :is(.ref-search-menu,.cms-nav-mobile) > summary {
    width: 38px !important;
    height: 42px !important;
  }
}

@media (max-width: 359px) {
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand { gap: 5px !important; }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > :is(h1,strong) { font-size: 15px !important; }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand > img { width: 33px !important; height: 33px !important; }
  body.front .cms-header-actions > :is(a,button),
  html[data-portal-theme] body.front[class] .ref-shell :is(.ref-search-menu,.cms-nav-mobile) > summary {
    width: 34px !important;
  }
  body.front .cms-language > summary { min-width: 41px; padding-inline: 2px; }
}

body.front .ref-detail-overview {
  display: grid;
  grid-template-columns: minmax(110px,clamp(145px,20vw,220px)) minmax(0,1fr);
  align-items: start;
  gap: clamp(14px,3vw,38px);
  margin: 12px 0 18px;
}
body.front .ref-detail-cover { display: block; }
body.front .ref-detail-poster {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2/3;
  border-radius: 9px;
  object-fit: cover;
  background: var(--cms-nav-soft);
}
body.front .ref-detail-poster[src$="-logo.svg"] {
  box-sizing: border-box;
  object-fit: contain;
  padding: 15%;
}
body.front .ref-detail-copy { min-width: 0; }
html[data-portal-theme] body.front[class] main h1 {
  color: var(--cms-nav-active) !important;
  font-size: clamp(25px, 19px + 2.2vw, 46px) !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
html[data-portal-theme] body.front[class] main .ref-detail-copy > h1#reference-detail-title {
  margin: 0 0 10px !important;
  font-size: clamp(23px, 16px + 2.2vw, 41px) !important;
}
html[data-portal-theme] body.front[class] main :is(#ref-home-cover-heading,.db-cover-heading > h2) {
  color: var(--cms-nav-active) !important;
  font-size: clamp(23px, 17px + 2vw, 39px) !important;
  line-height: 1.2 !important;
}
html[data-portal-theme] body.front[class] main h1.ma-caption-line {
  flex-wrap: wrap;
  justify-content: center;
}
html[data-portal-theme] body.front[class] main h1.ma-caption-line > span {
  max-width: 100%;
}
html[data-portal-theme] body.front[class] main
  :is(.nn24-section-head,.nnin-section-head,.dd-catalog-heading,.jp-section-head,.rn-section-head,.db-section-head,.dpab-section-head) > h2 {
  font-size: clamp(17px, 15px + .6vw, 24px) !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere;
}
html[data-portal-theme] body.front main section > h3 {
  font-size: clamp(15px, 14px + .3vw, 18px);
  line-height: 1.4;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  html[data-portal-theme] body.front[class] main :is(h1:not(.ma-caption-line),#ref-home-cover-heading,.db-cover-heading > h2,.ma-caption-line > span:not([aria-hidden="true"])) {
    background-image: linear-gradient(115deg,var(--cms-nav-active),var(--cms-brand-end)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand[data-cms-brand]:not([data-cms-brand=""]) > h1 {
    background: linear-gradient(115deg,var(--cms-nav-ink),var(--cms-nav-active)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
}
body.front .ref-detail-copy > :is(.ref-detail-original,.ref-detail-meta) {
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cms-nav-muted);
}
body.front .ref-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
}
body.front .ref-detail-meta > * { max-width: 100%; overflow-wrap: anywhere; }
body.front .ref-detail-meta > a { color: var(--cms-nav-active); }
body.front .ref-detail-meta time { font-variant-numeric: tabular-nums; }
html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 5px 17px;
  border: 1px solid transparent;
  border-radius: 999px !important;
  background-color: var(--cms-nav-active,#134e73) !important;
  background-image: linear-gradient(112deg,var(--cms-nav-active),var(--cms-brand-end)) !important;
  color: var(--cms-nav-panel,#fff) !important;
  box-shadow: 0 5px 14px -9px var(--cms-nav-active), inset 0 1px #ffffff38;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch::before {
  content: "";
  width: 10px;
  height: 12px;
  flex: none;
  background: currentColor;
  clip-path: polygon(0 0,100% 50%,0 100%);
}
html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch:hover {
  box-shadow: 0 5px 14px -6px var(--cms-nav-active), inset 0 1px #ffffff58;
}
html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch:focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 3px;
}
@media (forced-colors: active) {
  html[data-portal-theme] body.front[class] main :is(h1,#ref-home-cover-heading,.db-cover-heading > h2,.ma-caption-line > span) {
    background-image: none !important;
    color: CanvasText !important;
    -webkit-text-fill-color: currentColor !important;
  }
  html[data-portal-theme] body.front[class] .ref-shell .ref-brand[data-cms-brand]:not([data-cms-brand=""]) > h1 {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
  }
  html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch {
    background: ButtonFace !important;
    color: ButtonText !important;
    border-color: ButtonText;
    box-shadow: none;
  }
  html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch:focus-visible {
    outline-color: Highlight;
  }
  html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch::before {
    forced-color-adjust: none;
  }
}
body.front .ref-detail-information {
  min-width: 0;
  grid-column: 1;
}
body.front .ref-detail-information .ref-player-content-tabs {
  border-color: var(--cms-nav-border);
}
body.front .ref-detail-information .ref-player-content-tabs > a[aria-selected="true"] {
  color: var(--cms-nav-active) !important;
  border-bottom: 2px solid var(--cms-nav-active) !important;
  font-weight: 700;
}
body.front .ref-detail-information :is([data-ref-synopsis-text],.ref-detail-credits) {
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
body.front .ref-detail-information [data-ref-synopsis-text] {
  margin: 8px 0;
  white-space: pre-line;
}
body.front .ref-detail-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 10px 0 0;
}
body.front .ref-detail-credits > div {
  display: inline;
  max-width: 100%;
}
body.front .ref-detail-credits :is(dt,dd) { display: inline; margin: 0; }
body.front .ref-detail-credits dt { color: var(--cms-nav-muted); margin-inline-end: 6px; }
html[data-portal-theme] body.front .ref-detail-information :is(.ref-mobile-source-tabs,.nn24-episodes,.nnin-episodes,.dd-episodes,.jp-episodes,.rn-episodes,.db-episodes,.dpab-episodes) a {
  min-width: 0;
  min-height: 44px;
  padding: 6px 12px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--cms-nav-soft) !important;
  color: var(--cms-nav-ink) !important;
  font-size: 13px !important;
  text-decoration: none;
}
html[data-portal-theme] body.front .ref-detail-information :is(.ref-mobile-source-tabs,.nn24-episodes,.nnin-episodes,.dd-episodes,.jp-episodes,.rn-episodes,.db-episodes,.dpab-episodes) a:is([aria-current],:hover) {
  background: var(--cms-nav-active-bg) !important;
  color: var(--cms-nav-active) !important;
}
body.front .ref-detail-information :is(a,button):focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 2px;
}
body.front .ref-detail-information .db-lines:has(>.ref-mobile-source-tabs) :is(details:not([open]),details[open]>summary) {
  display: none !important;
}
@media (max-width: 700px) {
  body.front .ref-detail-overview {
    grid-template-columns: minmax(78px,28%) minmax(0,1fr);
    gap: 12px;
    margin-block: 8px 14px;
  }
  body.front .ref-detail-copy > :is(.ref-detail-original,.ref-detail-meta) { font-size: 13px; }
  html[data-portal-theme] body.front .ref-detail-overview .ref-detail-copy > a.ref-detail-watch { margin-top: 3px; }
}

.cms-category-done { display: none; }
.ref-player-tab-slot:empty { display: none; }
body.front .ref-player-volume { position: relative; }
body.front .ref-player-volume > summary {
  list-style: none;
  justify-content: center;
}
body.front .ref-player-volume > summary::-webkit-details-marker { display: none; }
body.front .ref-player-volume svg { width: 21px; height: 21px; }
body.front .ref-player-volume[data-muted="true"] svg { opacity: .55; }
body.front .ref-player-volume:not([open]) > .ref-player-volume-panel { display: none; }
body.front .ref-player-volume-panel {
  position: absolute;
  inset: auto auto calc(100% + 42px) 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 2px 10px;
  background: #182532;
  color: #f3f7fa;
  font-size: 12px;
}
html[data-portal-theme] body.front .ref-player-volume-panel > input {
  width: clamp(96px,28vw,144px);
  min-height: 35px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  accent-color: #9ad4fc;
}
body.front .ref-player-volume-panel > [hidden] { display: none !important; }

@media (max-width: 700px) {
  body.front .cms-category-done:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    min-height: 44px;
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--cms-nav-active-bg);
    color: var(--cms-nav-active);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page):not(.projection-mode) [data-player-frame]:not(:fullscreen) {
    inline-size: 100dvw !important;
    max-inline-size: none !important;
    margin-inline: calc((100% - 100dvw) / 2) !important;
    padding: 0 !important;
  }
  html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page) :is(
    [data-player-frame], [data-player-frame] > :is(video,iframe:not([data-preroll-code])),
    .ref-player-controls, .ref-player-sidebar, .ref-player-information,
    .db-player-information, .ref-player-tab-slot, .ref-player-tab-slot .ref-player-content-tabs,
    .ref-player-options-panel, .ref-player-volume-panel
  ) {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page) :is(.ref-player-sidebar,.ref-player-information,.db-player-information) {
    background: transparent !important;
    padding-inline: 0 !important;
  }
  body.front .ref-player-tab-slot {
    order: 0;
    width: 100%;
  }
  html[data-portal-theme] body.front .ref-player-tab-slot > .ref-player-content-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 14px;
    min-height: 43px;
    margin: 0;
    padding: 0 4px;
    background: transparent !important;
  }
  html[data-portal-theme] body.front .ref-player-tab-slot .ref-player-content-tabs > a {
    position: relative;
    flex: 0 0 auto;
    min-width: 50px;
    min-height: 43px;
    text-align: center;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--cms-nav-muted) !important;
  }
  html[data-portal-theme] body.front .ref-player-tab-slot .ref-player-content-tabs > a[aria-selected="true"] {
    background: transparent !important;
    color: var(--cms-nav-active) !important;
    font-weight: 700;
  }
  body.front .ref-player-tab-slot a[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset: auto calc(50% - 10px) 0;
    height: 2px;
    background: currentColor;
  }
  body.front:is(.ref-player-layout-v2,.db-player-page) :is(
    .dpab-player-note,.dpab-kicker,.nn24-player-kicker,.nnin-player-kicker,.nn24-player-caption,
    .dd-detail-kicker,.jp-detail-kicker,.of-film-kicker,.md-film-kicker,.ma-film-kicker,
    .dd-viewer-navigation,.jp-viewer-navigation,.of-viewer-navigation,.md-viewer-navigation,
    .ac-viewer-navigation,.ac-viewer-episode,.db-watch-heading .db-eyebrow,
    .ma-viewer-heading > a,.ref-player-information .ref-player-summary > h2
  ) {
    display: none !important;
  }
  html[data-portal-theme] body.front:is(.ref-player-layout-v2,.db-player-page) :is([data-player-seek],[data-player-volume-level]) {
    border: 0 !important;
    box-shadow: none !important;
  }
}


html[data-portal-theme] body.front > header.ref-shell {
  position: sticky !important;
  inset-block-start: 0 !important;
  z-index: 80;
  background: var(--cms-nav-panel) !important;
  transition: transform .16s ease;
}
html[data-portal-theme] body.front > header.ref-shell.cms-header-scrolling:not(:has(details[open], :focus-visible)) {
  transform: translateY(calc(-100% - 2px));
  pointer-events: none;
}
html[data-portal-theme] body.front.projection-mode > header.ref-shell { display: none !important; }
@supports (overflow: clip) {
  body.front:not(.projection-mode):has(> header.ref-shell) { overflow-x: clip; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-portal-theme] body.front > header.ref-shell { transition: none; }
}

/* Shared branding follows the active site theme, including manual theme switches. */
html[data-portal-theme] body.front .ref-brand[data-cms-brand]:not([data-cms-brand=""]) > img {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.front img[src^="/static/cinema-brand-"] {
  color-scheme: light;
}
html:is([data-portal-theme="dark"],[data-db-theme="dark"]) body.front img[src^="/static/cinema-brand-"] {
  color-scheme: dark;
}
body.front :is(.nn24-poster,.nnin-poster,.dd-poster,.jp-poster,.rn-poster) > img[src^="/static/cinema-brand-"] {
  object-fit: contain !important;
  padding: 18%;
}

body.front:where(:has(> .ref-shell .ref-brand[data-cms-brand]:not([data-cms-brand=""]))) {
  --cinema-page-light: #f5f8f6;
  --cinema-edge-light: #e8eef1;
  --cinema-page-dark: #121a20;
  --cinema-edge-dark: #1a2431;
  --cinema-glow-light: #dcebf2;
  --cinema-glow-dark: #253645;
  --cinema-glow-center: 12%;
  --cinema-gradient-angle: 146deg;
  --cinema-page: var(--cinema-page-light);
  --cinema-edge: var(--cinema-edge-light);
  --cinema-glow: var(--cinema-glow-light);
  background-color: var(--cinema-page) !important;
  background-image: radial-gradient(ellipse 85vw 580px at var(--cinema-glow-center) 0, var(--cinema-glow), transparent 78%),
                    linear-gradient(var(--cinema-gradient-angle), var(--cinema-page), var(--cinema-edge) 66%, var(--cinema-page)) !important;
}
html:is([data-portal-theme="dark"],[data-db-theme="dark"]) body.front:has(> .ref-shell .ref-brand[data-cms-brand]:not([data-cms-brand=""])) {
  --cinema-page: var(--cinema-page-dark);
  --cinema-edge: var(--cinema-edge-dark);
  --cinema-glow: var(--cinema-glow-dark);
}
html[data-portal-theme] body.front:has(> .ref-shell .ref-brand[data-cms-brand]:not([data-cms-brand=""])) > .ref-shell {
  background: linear-gradient(112deg, var(--cinema-page), color-mix(in srgb, var(--cinema-edge) 76%, var(--cinema-glow))) !important;
  backdrop-filter: none;
}
body.front.tpl-nnyy24 {
  --cinema-page-light: #f6faf7; --cinema-edge-light: #e5f1e9; --cinema-glow-light: #d5ebdf;
  --cinema-page-dark: #121c19; --cinema-edge-dark: #192d25; --cinema-glow-dark: #254339;
}
body.front.tpl-nnyyin {
  --cinema-page-light: #fcf6f4; --cinema-edge-light: #f0e5e5; --cinema-glow-light: #f4ded8;
  --cinema-page-dark: #1e171a; --cinema-edge-dark: #302227; --cinema-glow-dark: #462d32;
  --cinema-glow-center: 85%;
}
body.front.tpl-ddys {
  --cinema-page-light: #f9f5eb; --cinema-edge-light: #efe6d6; --cinema-glow-light: #eee0c0;
  --cinema-page-dark: #1e1c16; --cinema-edge-dark: #2d291d; --cinema-glow-dark: #3b3220;
  --cinema-gradient-angle: 110deg;
}
body.front.tpl-jinpai {
  --cinema-page-light: #faf4e7; --cinema-edge-light: #eee2c9; --cinema-glow-light: #edd9b2;
  --cinema-page-dark: #211a16; --cinema-edge-dark: #33251c; --cinema-glow-dark: #463526;
}
body.front.tpl-openframe {
  --cinema-page-light: #f6fafb; --cinema-edge-light: #e1eef0; --cinema-glow-light: #cfe4ea;
  --cinema-page-dark: #111a20; --cinema-edge-dark: #1d2b36; --cinema-glow-dark: #2a4551;
  --cinema-glow-center: 88%;
}
body.front.tpl-applecinema {
  --cinema-page-light: #f6f7fa; --cinema-edge-light: #e8edf6; --cinema-glow-light: #dbe7f7;
  --cinema-page-dark: #121724; --cinema-edge-dark: #1c2740; --cinema-glow-dark: #2a3a58;
  --cinema-gradient-angle: 172deg;
}
body.front.tpl-moviedb {
  --cinema-page-light: #f4f7f9; --cinema-edge-light: #e4edf5; --cinema-glow-light: #cfdff1;
  --cinema-page-dark: #131b26; --cinema-edge-dark: #1c2a39; --cinema-glow-dark: #293c54;
  --cinema-glow-center: 52%;
}
body.front.tpl-anywhere {
  --cinema-page-light: #faf5f0; --cinema-edge-light: #f0e5dd; --cinema-glow-light: #efd8cb;
  --cinema-page-dark: #211918; --cinema-edge-dark: #33262a; --cinema-glow-dark: #473133;
  --cinema-gradient-angle: 114deg;
}
body.front.tpl-dbku {
  --cinema-page-light: #f3f8f4; --cinema-edge-light: #e4ede9; --cinema-glow-light: #d0e8db;
  --cinema-page-dark: #132021; --cinema-edge-dark: #222e3c; --cinema-glow-dark: #2b4046;
}
body.front:has(.ref-brand[data-cms-brand="gold"]) {
  --cinema-glow-light: #f1dfbb; --cinema-glow-dark: #3b2e24;
  --cms-accent-day: #795118; --cms-accent-night: #f4ce8e;
}
body.front:has(.ref-brand[data-cms-brand="sakura"]) {
  --cinema-glow-light: #f8e0e7; --cinema-glow-dark: #423047;
  --cms-accent-day: #923963; --cms-accent-night: #f9b7d3;
}
body.front:has(.ref-brand[data-cms-brand="zhuiju"]) {
  --cinema-glow-light: #d6e6f4; --cinema-glow-dark: #273b58;
  --cms-accent-day: #265493; --cms-accent-night: #b0d3ff;
}
body.front:has(.ref-brand[data-cms-brand="xiaoxiao"]) {
  --cinema-glow-light: #eddff5; --cinema-glow-dark: #382c48;
  --cms-accent-day: #70488d; --cms-accent-night: #e3b8fb;
}
body.front:has(.ref-brand[data-cms-brand="dianying"]) {
  --cinema-glow-light: #efe3cc; --cinema-glow-dark: #3b3428;
  --cms-accent-day: #715022; --cms-accent-night: #f1cb86;
}
body.front:has(.ref-brand[data-cms-brand="tianlang"]) {
  --cinema-glow-light: #dce2f5; --cinema-glow-dark: #283450;
  --cms-accent-day: #414e86; --cms-accent-night: #c8cfff;
}
body.front:has(.ref-brand[data-cms-brand="nangua"]) {
  --cinema-glow-light: #f5dfc1; --cinema-glow-dark: #493123;
  --cms-accent-day: #87451e; --cms-accent-night: #fac493;
}
body.front:has(.ref-brand[data-cms-brand="mahua"]) {
  --cinema-glow-light: #f2dbe3; --cinema-glow-dark: #452e3c;
  --cms-accent-day: #8a3c59; --cms-accent-night: #f7b7ce;
}
body.front:has(.ref-brand[data-cms-brand="quanji"]) {
  --cinema-glow-light: #d0e9e9; --cinema-glow-dark: #21464b;
  --cms-accent-day: #245f67; --cms-accent-night: #a9e6e7;
}
body.front:has(.ref-brand[data-cms-brand="kanju"]) {
  --cinema-glow-light: #d7ecdf; --cinema-glow-dark: #234139;
  --cms-accent-day: #27644c; --cms-accent-night: #9fe3c3;
}
body.front:has(.ref-brand[data-cms-brand="xigua"]) {
  --cinema-glow-light: #f3dadc; --cinema-glow-dark: #452e33;
  --cms-accent-day: #8e3444; --cms-accent-night: #ffaeb9;
}
body.front:has(.ref-brand[data-cms-brand="xiaoya"]) {
  --cinema-glow-light: #f5e7bc; --cinema-glow-dark: #3d3828;
  --cms-accent-day: #75561f; --cms-accent-night: #f3d68b;
}

/* The existing discovery sections receive template-specific card rhythm. */
body.front.tpl-nnyy24 { --cinema-columns: 6; --cinema-mobile-columns: 3; --cinema-grid-gap: 13px; }
body.front.tpl-nnyyin { --cinema-columns: 4; --cinema-mobile-columns: 2; --cinema-grid-gap: 19px; }
body.front.tpl-ddys { --cinema-columns: 5; --cinema-mobile-columns: 2; --cinema-grid-gap: 24px; }
body.front.tpl-jinpai { --cinema-columns: 7; --cinema-mobile-columns: 3; --cinema-grid-gap: 12px; }
body.front.tpl-openframe { --cinema-columns: 4; --cinema-mobile-columns: 2; --cinema-grid-gap: 28px; }
body.front.tpl-applecinema { --cinema-columns: 4; --cinema-mobile-columns: 2; --cinema-grid-gap: 24px; }
body.front.tpl-moviedb { --cinema-columns: 6; --cinema-mobile-columns: 3; --cinema-grid-gap: 15px; }
body.front.tpl-anywhere { --cinema-columns: 5; --cinema-mobile-columns: 3; --cinema-grid-gap: 18px; }
body.front.tpl-dbku { --cinema-columns: 6; --cinema-mobile-columns: 3; --cinema-grid-gap: 15px; }
body.front.tpl-applecinema:has(.ref-brand[data-cms-brand="mahua"]) { --cinema-columns: 5; --cinema-grid-gap: 18px; }
body.front.tpl-applecinema:has(.ref-brand[data-cms-brand="xigua"]) { --cinema-columns: 6; --cinema-mobile-columns: 3; --cinema-grid-gap: 14px; }
body.front.tpl-anywhere:has(.ref-brand[data-cms-brand="xiaoxiao"]) { --cinema-columns: 4; --cinema-mobile-columns: 2; --cinema-grid-gap: 22px; }
body.front.tpl-anywhere:has(.ref-brand[data-cms-brand="kanju"]) { --cinema-columns: 6; --cinema-grid-gap: 12px; }
body.front.tpl-dbku:has(.ref-brand[data-cms-brand="tianlang"]) { --cinema-columns: 7; --cinema-grid-gap: 13px; }
body.front.tpl-dbku:has(.ref-brand[data-cms-brand="quanji"]) { --cinema-columns: 5; --cinema-grid-gap: 19px; }
body.front.tpl-dbku:has(.ref-brand[data-cms-brand="xiaoya"]) { --cinema-columns: 4; --cinema-mobile-columns: 2; --cinema-grid-gap: 23px; }

body.front:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""]))
  :is(.ref-home-channel-section .nn24-grid,.nnin-home .nnin-grid,.ref-home-channel-section .dd-grid,
      .ref-home-channel-section .jp-grid,.ref-home-channel-section .rn-grid,.ref-home-channel-section .rn-shelf,
      .db-home .db-channel-grid):not(:has(> article:nth-child(2):last-child, > article:only-child)) {
  grid-template-columns: repeat(var(--cinema-columns), minmax(0,1fr)) !important;
  grid-auto-flow: row;
  gap: var(--cinema-grid-gap) !important;
}
body.front.tpl-openframe:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .of-editorial {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
  align-items: start;
  gap: 24px;
}
body.front.tpl-moviedb:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .md-magazine {
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 20px !important;
}
body.front.tpl-anywhere:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ma-collage {
  grid-template-columns: repeat(5,minmax(0,1fr)) !important;
  gap: 12px !important;
}
body.front:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])).tpl-openframe
  :is(.rn-section-head h2,.ref-home-cover-head h2),
body.front:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])).tpl-dbku .db-section-head h2 {
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}
@media (min-width: 701px) and (max-width: 1199px) {
  body.front:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) { --cinema-columns: 4; }
}
@media (max-width: 700px) {
  body.front:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) {
    --cinema-columns: var(--cinema-mobile-columns);
    --cinema-grid-gap: 11px;
  }
  body.front.tpl-openframe:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .of-editorial {
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
  }
  body.front.tpl-moviedb:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .md-magazine {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 12px !important;
  }
  body.front.tpl-anywhere:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ma-collage {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }
}

/* Distinguish the first screen as well as the catalogue rows. */
body.front.tpl-nnyy24:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
  gap: 14px;
  padding-inline: 4px;
}
body.front:is(.tpl-nnyy24,.tpl-ddys,.tpl-applecinema):has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card {
  transform: none;
}
body.front.tpl-ddys:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card > a {
  aspect-ratio: 4/5;
  border-radius: 2px;
}
body.front.tpl-applecinema:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card > a {
  aspect-ratio: 3/4;
  border-radius: 14px;
}
body.front.tpl-jinpai:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card:nth-child(even) {
  --cover-angle: -2deg;
}
body.front.tpl-openframe:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card:nth-child(even) {
  --cover-angle: 0deg;
  --cover-offset: 15px;
}
body.front.tpl-anywhere:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-card:nth-child(odd) {
  --cover-angle: -2deg;
}
@media (min-width: 721px) {
  body.front.tpl-nnyyin:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
    grid-template-columns: minmax(0,1.22fr) repeat(4,minmax(0,1fr));
  }
  body.front.tpl-openframe:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
    grid-template-columns: repeat(2,minmax(0,1.12fr)) repeat(3,minmax(0,1fr));
  }
  body.front.tpl-moviedb:has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) minmax(0,1.22fr) repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 720px) {
  body.front:is(.tpl-nnyy24,.tpl-jinpai):has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
    grid-auto-columns: minmax(110px,37%);
  }
  body.front:is(.tpl-nnyyin,.tpl-openframe,.tpl-applecinema):has(.ref-brand[data-cms-brand]:not([data-cms-brand=""])) .ref-home-cover-grid {
    grid-auto-columns: minmax(130px,49%);
  }
}

body.front .cms-episodes-collapsed .cms-episode-extra-range,
body.front .cms-episodes-collapsed a:nth-of-type(n+13):not([aria-current="true"]) {
  display: none !important;
}

html[data-portal-theme] body.front button.cms-episode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: auto !important;
  min-height: 44px;
  margin-block: 3px 8px;
  padding: 7px 14px !important;
  border: 1px solid var(--cms-nav-border) !important;
  border-radius: 999px !important;
  background: var(--cms-nav-active-bg) !important;
  color: var(--cms-nav-active) !important;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

body.front .cms-episode-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

body.front .cms-episode-toggle[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

body.front .cms-episode-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

html[data-portal-theme] body.front .ref-results-sort > summary {
  min-width: max-content !important;
  padding-inline: 10px !important;
  color: var(--cms-nav-ink) !important;
  background: var(--cms-nav-soft) !important;
  font-weight: 650 !important;
  white-space: nowrap;
}

html[data-portal-theme] body.front .ref-results-sort[open] > summary {
  color: var(--cms-nav-active) !important;
  background: var(--cms-nav-active-bg) !important;
}

body.front .ref-results-sort > summary:focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  body.front .ref-results-bar { flex-wrap: wrap; }
  body.front .ref-results-sort { flex: none; }
}
