:root {
  color-scheme: dark;
  --site-bg: #101112;
  --site-panel: #191b1d;
  --site-raised: #22262a;
  --site-line: #ffffff17;
  --site-text: #f5f5f3;
  --site-muted: #a9afb5;
  --site-blue: #1d9bf0;
  --site-blue-hover: #187fc5;
  --site-blue-on-primary: #fff;
  --site-blue-text: #a2cdea;
  --site-blue-ink: #071a29;
  --site-blue-panel: #153249;
  --site-gold: #e4c695;
  --site-gutter: clamp(16px, 2.25vw, 32px);
  --site-content-limit: 1552px;
  --site-content: min(var(--site-content-limit), calc(100% - 2 * var(--site-gutter)));
  --brand-primary: var(--site-blue);
  --home-accent: var(--site-blue);
  --site-breadcrumb-size: 14px;
  --site-breadcrumb-line: 20px;
  --site-breadcrumb-baseline-before: 36px;
  --site-breadcrumb-baseline-after: 24px;
  --site-breadcrumb-before: calc(var(--site-breadcrumb-baseline-before) * var(--site-pc-scale-1552, 1));
  --site-breadcrumb-after: calc(var(--site-breadcrumb-baseline-after) * var(--site-pc-scale-1552, 1));
}

@media (max-width: 767px) {
  :root {
    --site-breadcrumb-size: 12px;
    --site-breadcrumb-line: 20px;
    --site-breadcrumb-baseline-before: 20px;
    --site-breadcrumb-baseline-after: 16px;
  }
}

@media (min-width: 861px) and (max-width: 1919px) {
  :root {
    --site-content-limit: var(--site-pc-width-1552, 1396.8px);
  }
}

html {
  background: var(--site-bg);
  scroll-padding-top: 144px;
  scrollbar-color: #44474a var(--site-bg);
}

html body:not(.nav-page-body) {
  background-color: var(--site-bg);
  color: var(--site-text);
}

body::selection,
body ::selection {
  background: var(--site-blue-panel);
  color: var(--site-text);
}

body :is(input, textarea) {
  caret-color: var(--site-blue);
}

html body nav[data-site-breadcrumb][aria-label] {
  /* Match the /ai-short canvas without changing the enclosing page scale. */
  --breadcrumb-scale: calc(var(--site-pc-scale-1552, 1) / var(--site-breadcrumb-parent-scale, 1));
  color: var(--site-muted);
  font-size: calc(var(--site-breadcrumb-size) * var(--breadcrumb-scale));
  line-height: calc(var(--site-breadcrumb-line) * var(--breadcrumb-scale));
  min-block-size: 0;
  flex-wrap: nowrap;
  margin-block: 0 calc(var(--site-breadcrumb-after) / var(--site-breadcrumb-parent-scale, 1) - var(--site-breadcrumb-layout-gap, 0px));
}

html body nav[data-site-breadcrumb][aria-label] > :is(a, span) {
  font-size: inherit;
  line-height: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body nav[data-site-breadcrumb] > .breadcrumb-separator {
  flex: none;
}

html body nav[data-site-breadcrumb][aria-label] > [aria-current="page"] {
  color: var(--site-blue);
}

:where(nav[data-site-breadcrumb]) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

:where(nav[data-site-breadcrumb]) > a {
  color: inherit;
  text-decoration: none;
}

:where(nav[data-site-breadcrumb]) > a:hover { color: var(--site-text); }

/* Preserve the gaps between content sections while giving the breadcrumb the same leading and trailing space. */
html body :is(.haijiao-channel, .feedback-shell, .search-page, .richtext-page, .edit-password-page, .page-shell.cinema-detail, .page-shell.cinema-play):has(nav[data-site-breadcrumb]) {
  padding-block-start: calc(var(--site-breadcrumb-before) / var(--site-breadcrumb-parent-scale, 1));
}

html body :is(.topic-layout:not(.haijiao-channel), .library-page, .edit-profile-page):has(nav[data-site-breadcrumb]) {
  margin-block-start: calc(var(--site-breadcrumb-before) / var(--site-breadcrumb-parent-scale, 1));
}

.topic-layout:not(.haijiao-channel),
:is(.collect-pc, .history-pc) { --site-breadcrumb-layout-gap: var(--site-breadcrumb-baseline-after); }
.richtext-page { --site-breadcrumb-layout-gap: 30px; }
.content-pc { --site-breadcrumb-layout-gap: 28px; }
.edit-profile-pc { --site-breadcrumb-layout-gap: 18px; }
.edit-password-pc { --site-breadcrumb-layout-gap: 14px; }

@media (min-width: 768px) {
  html body .haijiao-account:has(> nav[data-site-breadcrumb]),
  html body .content-page:has(> .content-pc > nav[data-site-breadcrumb]) {
    padding-block-start: var(--site-breadcrumb-before);
  }
}

@media (max-width: 768px) {
  .richtext-page { --site-breadcrumb-layout-gap: 18px; }
}

@media (max-width: 767px) {
  .edit-profile-pc { --site-breadcrumb-layout-gap: 14px; }
}

body :where(a, button, input, textarea, select):not(:where(#eightPop *)):focus-visible {
  outline: 2px solid var(--site-blue-text);
  outline-offset: 3px;
}

.mobile-site-nav { display: none; }

html body:is(.home-page, .drama-shared-cards) {
  --home-accent: var(--site-blue);
}

html body :is(.section-title, .footer-friends h2)::before {
  background: var(--site-blue);
}

html body.is-home-page .section-heading {
  gap: 7px;
  align-items: flex-start;
  flex-direction: column;
}

html body.is-home-page .section-header {
  align-items: flex-start;
}

html body.is-home-page .section-title,
html body .footer-friends h2 {
  font-weight: 650;
}

html body.is-home-page .section-subtitle {
  color: var(--site-muted);
  font-size: 13px;
  line-height: 1.55;
}

html body :is(.home-page, .drama-shared-cards, .search-discovery) .poster-card,
html body:is(.home-page, .drama-shared-cards) .poster-card {
  background: transparent;
}

html body :is(.home-page, .drama-shared-cards, .search-discovery) .poster-cover,
html body:is(.home-page, .drama-shared-cards) .poster-cover {
  border-radius: 12px;
  background: var(--site-panel);
}

html body :is(.home-page, .drama-shared-cards) .poster-card-body,
html body:is(.home-page, .drama-shared-cards) .poster-card-body {
  padding-inline: 0;
  background: transparent;
}

html body .poster-card :is(.poster-card-subtitle, .poster-card-heat) {
  color: var(--site-muted);
}

html body .poster-card .poster-card-tag {
  border-color: #83ceff30;
  background: var(--site-blue-panel);
  color: var(--site-blue-text);
}

html body .site-breadcrumb [aria-current],
html body .search-discovery button,
html body .footer-box a:hover,
html body .friend-list a:hover {
  color: var(--site-blue-text);
}

html body .footer-box {
  border-top: 1px solid var(--site-line);
  background: #161819;
  color: var(--site-muted);
}

html body .friend-section,
html body .search-history-tags a {
  border-color: var(--site-line);
  background: var(--site-panel);
}

html body .friend-section h3 img {
  background: var(--site-blue-panel);
}

/* Shared content, playback, directory and account surfaces. */
html body :is(
  .rank-tab--active, .app-category-tab--active, .topic-tab--active, .search-tab--active,
  .filter-chip--active, .detail-episode--active, .detail-episode--pc-active,
  .detail-episode--h5-active, .play-ep--active, .play-ep-sheet-item--active,
  .detail-episode-range--active, .play-ep-range--active
) {
  border-color: var(--site-blue);
  background: var(--site-blue-panel);
  color: var(--site-blue-text);
}

html body :is(
  .rank-tab-text--active, .filter-chip-text--active, .adult-tabs a[aria-current],
  .detail-action--active, .detail-h5-collect--active, .play-ep--active .play-ep-num,
  .drama-player-speeds button[aria-pressed="true"], .account-invite-code
) {
  color: var(--site-blue-text);
}

html body :is(
  .detail-play-btn, .detail-comment-inline-send, .search-bar-submit, .search-screen-submit,
  .road-primary, .return-actions a, .feedback-submit, .haijiao-primary, .account-login,
  .pagination-btn--active, .pagination-jump-submit, .app-category-tab[aria-pressed="true"],
  .feedback-select-menu button[aria-selected="true"]
) {
  border-color: var(--site-blue);
  background: var(--site-blue);
  color: var(--site-blue-on-primary);
}

html body :is(.detail-play-btn, .detail-comment-inline-send, .search-bar-submit, .search-screen-submit, .road-primary, .account-login, .pagination-jump-submit):hover {
  border-color: var(--site-blue-hover);
  background: var(--site-blue-hover);
  color: var(--site-blue-on-primary);
}

html body .detail-play-btn img {
  filter: brightness(0) invert(1);
}

html body .download-fab .download-fab-text {
  color: var(--site-blue-ink);
  font-weight: 650;
}

html body .download-fab .download-fab-icon {
  filter: brightness(0);
}

html body:is(.is-detail-page, .is-play-page) {
  --drama-accent: var(--site-blue);
}

html body .detail-tag--primary {
  color: var(--site-blue-text);
  background: var(--site-blue-panel);
}

html body .play-player .dplayer-bar-wrap .dplayer-played {
  background: var(--site-blue) !important;
}

html body :is(.detail-comment-inline-input, .search-bar):focus-within,
html body .detail-comment-inline-input:focus-visible {
  border-color: var(--site-blue);
  box-shadow: none;
}

html body :is(.detail-hero, .play-sidebar, .drama-contacts, .user-center-profile, .deposit-transactions, .deposit-pay-surface, .road-section) {
  border-color: var(--site-line);
  background-color: var(--site-panel);
}

html body :is(.detail-episode, .play-ep, .play-ep-sheet-item):not(.detail-episode--active, .play-ep--active, .play-ep-sheet-item--active) {
  background-color: var(--site-raised);
}

html body :is(.detail-episode, .play-ep, .play-ep-sheet-item):hover {
  border-color: var(--site-blue);
  color: var(--site-blue-text);
}

html body :is(.user-center-profile, .deposit-pay-surface, .deposit-transactions) {
  border-radius: 14px;
}

html body .user-center-eyebrow {
  display: none;
}

html body :is(.user-center-head h1, .wallet-page-title) {
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 650;
}

html body :is(.user-center-vip-card, .user-center-mobile-vip, .deposit-package--active) {
  border-color: #b99a62;
}

html body :is(.user-center-vip-card, .user-center-mobile-vip) {
  color: var(--site-gold);
}

html body :is(.user-center-head p, .deposit-breadcrumb, .deposit-transactions time, .deposit-selection, .deposit-customer) {
  color: var(--site-muted);
}

html body :is(.search-bar, .deposit-tabs, .deposit-package, .deposit-pay-btn) {
  border-color: var(--site-line);
  background-color: var(--site-raised);
}

html body :is(.search-bar, .deposit-tabs) {
  border-radius: 9px;
}

html body .deposit-tabs button {
  border-radius: 7px;
  color: var(--site-muted);
}

html body .deposit-tabs [aria-selected="true"] {
  background: var(--site-blue-panel);
  color: var(--site-blue-text);
}

html body :is(.wallet-balance-card, .deposit-packages-panel, .deposit-benefits, .deposit-coin-help, .wallet-redeem) {
  border-color: var(--site-line);
  border-radius: 14px;
  background-color: var(--site-panel);
}

html body :is(.deposit-layout, .deposit-pay-dialog) .deposit-submit:not(:disabled),
html body .deposit-package-check,
html body .deposit-pay-btn--active::after {
  background: var(--site-gold);
  color: #282016;
}

html body .deposit-layout .deposit-package--active,
html body .deposit-pay-dialog .deposit-pay-btn--active {
  border-color: #b99a62;
  box-shadow: none;
}

html body .deposit-layout .deposit-package--active {
  background-color: #2b2520;
}

html body .deposit-breadcrumb [aria-current],
html body .deposit-customer a {
  color: var(--site-blue-text);
}

html body .feedback-page {
  --feedback-accent: var(--site-blue);
}

html body .feedback-file-retry {
  border-color: var(--site-blue-text);
  color: var(--site-blue-text);
}

@media (min-width: 1024px) {
  html body.deposit-layout .deposit-page {
    width: min(1180px, calc(100% - 2 * var(--site-gutter))) !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(235px, 27%);
    align-items: start;
    zoom: 1;
  }

  .deposit-page > * {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .deposit-page > .deposit-tab-panel {
    grid-column: 1;
  }

  html body .deposit-page > .deposit-purchase {
    grid-column: 2;
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--site-line);
    border-radius: 14px;
    background: var(--site-panel);
  }

  html body .deposit-purchase .deposit-submit {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 70px;
  }

  body:has(> .mobile-site-nav):not(.is-detail-page, .is-play-page) {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  body:not(.is-detail-page, .is-play-page) > .mobile-site-nav {
    position: fixed;
    z-index: 95;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 2px 8px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--site-line);
    background: #171a1d;
  }

  .mobile-site-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 55px;
    gap: 3px;
    border-radius: 6px;
    color: var(--site-muted);
    font-size: 11px;
    line-height: 1.3;
    text-decoration: none;
  }

  .mobile-site-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7px;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-site-nav a[aria-current],
  .mobile-site-nav a:active {
    color: var(--site-blue-text);
  }

}
