/* IQiyi private layout layer. Loaded after app.css and scoped to IQiyi pages only. */
body.front.portal.iqiyi-template {
  --iq-accent: #32c86b;
  --iq-accent-strong: #1aa857;
  --iq-ink: #e9f5ed;
  --iq-muted: #a6b8ac;
  --iq-surface: #10221a;
  --iq-surface-raised: #173126;
  --iq-border: rgba(222, 246, 230, .15);
  --iq-nav-pill-h: 36px;
  --iq-nav-pill-x: 14px;
  --iq-nav-gap: 6px;
  overflow-x: hidden;
}

:root[data-portal-theme="light"] body.front.portal.iqiyi-template,
body.front.portal.iqiyi-template.theme-light {
  --iq-ink: #13261c;
  --iq-muted: #5f7568;
  --iq-surface: #f7fbf8;
  --iq-surface-raised: #ffffff;
  --iq-border: rgba(19, 38, 28, .14);
}

:root[data-portal-theme="light"] {
  background: #f7f8fb;
  scrollbar-color: rgba(47, 111, 73, .34) #f7f8fb;
}

:root[data-portal-theme="light"]::-webkit-scrollbar {
  width: 8px;
  background: #f7f8fb;
}

:root[data-portal-theme="light"]::-webkit-scrollbar-track {
  background: #f7f8fb;
}

:root[data-portal-theme="light"]::-webkit-scrollbar-thumb {
  border: 2px solid #f7f8fb;
  border-radius: 999px;
  background: rgba(47, 111, 73, .34);
}

body.front.portal.iqiyi-template .iqiyi-header.portal-top {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  overflow: visible;
  background: color-mix(in srgb, var(--iq-surface) 96%, transparent);
  border-bottom: 1px solid var(--iq-border);
  backdrop-filter: none;
}

body.front.portal.iqiyi-template .iqiyi-header .portal-bar,
body.front.portal.iqiyi-template .iqiyi-header .iqiyi-channel-nav {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
  box-sizing: border-box;
}

body.front.portal.iqiyi-template .iqiyi-header .portal-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

body.front.portal.iqiyi-template .iqiyi-menu-toggle { display: none; }
body.front.portal.iqiyi-template .iqiyi-brand { flex: 0 1 auto; min-width: 0; }
body.front.portal.iqiyi-template .iqiyi-search-form { flex: 1 1 360px; min-width: 180px; }
body.front.portal.iqiyi-template .iqiyi-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
body.front.portal.iqiyi-template .iqiyi-action { width: 36px; height: 36px; display: grid; place-items: center; }
body.front.portal.iqiyi-template .iqiyi-login { min-width: 52px; max-width: 132px; overflow: hidden; text-overflow: ellipsis; }

body.front.portal.iqiyi-template .iqiyi-channel-nav {
  display: flex;
  align-items: center;
  gap: var(--iq-nav-gap);
  min-height: 48px;
  padding: 6px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
body.front.portal.iqiyi-template .iqiyi-channel-nav::-webkit-scrollbar { display: none; }
body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-pill {
  min-height: var(--iq-nav-pill-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding-inline: var(--iq-nav-pill-x);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--iq-muted);
  white-space: nowrap;
}
body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-pill:hover,
body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-pill:focus-visible,
body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-pill.active {
  color: #072113;
  background: var(--iq-accent);
  border-color: var(--iq-accent);
}
body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-detail { margin-left: auto; }

body.front.portal.iqiyi-template .detail-layout,
body.front.portal.iqiyi-template .detail-copy,
body.front.portal.iqiyi-template .detail-actions { min-width: 0; }
body.front.portal.iqiyi-template .detail-layout { display: grid !important; grid-template-columns: 188px minmax(0, 1fr) auto !important; gap: 24px !important; align-items: start !important; }
body.front.portal.iqiyi-template .detail-poster { width: 188px !important; max-width: 100%; grid-column: 1 !important; }
body.front.portal.iqiyi-template .detail-copy { grid-column: 2 !important; overflow-wrap: anywhere; }
body.front.portal.iqiyi-template .detail-actions { grid-column: 3 !important; }
body.front.portal.iqiyi-template .detail-copy > .eyebrow {
  margin: 0 0 8px !important;
  line-height: 1.4 !important;
}
body.front.portal.iqiyi-template .detail-copy > h1 { margin: 0 0 12px !important; }
body.front.portal.iqiyi-template .detail-copy > .facts {
  gap: 6px !important;
  margin-top: 0 !important;
}
body.front.portal.iqiyi-template .iqiyi-detail-credits {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px;
  margin: 0 !important;
  min-width: 0;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit strong {
  color: var(--iq-muted);
  font-weight: 700;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit span {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit a {
  color: inherit;
  text-decoration: none;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit a:hover,
body.front.portal.iqiyi-template .iqiyi-detail-credit a:focus-visible {
  color: var(--iq-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.front.portal.iqiyi-template .iqiyi-detail-credit a + a::before {
  content: "、";
  color: var(--iq-muted);
  text-decoration: none;
}

body.front.portal.iqiyi-template .detail-actions > .like-form {
  min-width: 0;
}
body.front.portal.iqiyi-template .detail-actions .like-button {
  border-color: rgba(244, 114, 145, .34) !important;
  background: linear-gradient(135deg, rgba(121, 31, 62, .72), rgba(171, 47, 86, .58)) !important;
  color: #ffe6ed !important;
}
:root[data-portal-theme="light"] body.front.portal.iqiyi-template .detail-actions .like-button {
  border-color: rgba(219, 72, 111, .28) !important;
  background: linear-gradient(135deg, #fff0f4, #ffc8d6) !important;
  color: #8b1f43 !important;
}
body.front.portal.iqiyi-template .detail-actions .like-button span,
body.front.portal.iqiyi-template .detail-actions .like-button strong,
body.front.portal.iqiyi-template .detail-actions .like-button em {
  color: inherit !important;
}

body.front.portal.iqiyi-template .synopsis-panel { position: relative !important; }
body.front.portal.iqiyi-template .synopsis-panel > h2 {
  min-height: 38px;
  margin-bottom: 14px !important;
  padding-right: 124px !important;
}
body.front.portal.iqiyi-template .synopsis-details { margin-top: 0 !important; }
body.front.portal.iqiyi-template .synopsis-details > summary {
  position: absolute !important;
  top: clamp(14px, 1.8vw, 22px) !important;
  right: clamp(14px, 1.8vw, 22px) !important;
  z-index: 1;
}
body.front.portal.iqiyi-template .synopsis-details[open] { margin-top: 12px !important; }

body.front.portal.iqiyi-template .ds3-bottom-nav { display: none; }
body.front.portal.iqiyi-template :focus-visible { outline: 3px solid color-mix(in srgb, var(--iq-accent) 72%, white); outline-offset: 2px; }

@media (max-width: 900px) {
  :root {
    scrollbar-width: none;
  }
  :root::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  body.front.portal.iqiyi-template {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    scrollbar-width: none;
  }
  body.front.portal.iqiyi-template::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  body.front.portal.iqiyi-template .iqiyi-header .portal-bar,
  body.front.portal.iqiyi-template .iqiyi-header .iqiyi-channel-nav { width: calc(100% - 24px); }
  body.front.portal.iqiyi-template .iqiyi-header .portal-bar { min-height: 56px; gap: 10px; }
  body.front.portal.iqiyi-template .iqiyi-menu-toggle {
    display: grid;
    flex: 0 0 38px;
    place-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--iq-surface-raised);
    border: 1px solid var(--iq-border);
    border-radius: 8px;
  }
  body.front.portal.iqiyi-template .iqiyi-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 0;
    background: var(--iq-ink);
    border-radius: 2px;
  }
  body.front.portal.iqiyi-template .iqiyi-brand { min-width: 0; }
  body.front.portal.iqiyi-template .iqiyi-brand small { display: none; }
  body.front.portal.iqiyi-template .iqiyi-search-form { display: none; }
  body.front.portal.iqiyi-template .iqiyi-actions { margin-left: auto; gap: 5px; }
  body.front.portal.iqiyi-template .iqiyi-action { width: 34px; height: 34px; }
  body.front.portal.iqiyi-template .iqiyi-login { min-width: 42px; max-width: 72px; padding-inline: 8px; }
  html body.front.portal.iqiyi-template .iqiyi-header .iqiyi-channel-nav {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    width: auto;
    display: none;
    min-height: 0 !important;
    height: max-content !important;
    block-size: max-content !important;
    max-height: min(60vh, 420px);
    padding: 10px;
    overflow: auto;
    background: var(--iq-surface-raised);
    border: 1px solid var(--iq-border);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .24);
  }
  body.front.portal.iqiyi-template .iqiyi-header .iqiyi-channel-nav.nav-open { display: flex !important; flex-wrap: wrap; align-content: flex-start; }
  body.front.portal.iqiyi-template .iqiyi-channel-nav .iqiyi-nav-detail { margin-left: 0; }
  :root[data-portal-theme="light"] body.front.portal.iqiyi-template .detail-hero,
  body.front.portal.iqiyi-template .detail-hero {
    box-shadow: none !important;
  }
  body.front.portal.iqiyi-template .detail-breadcrumb {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin: 0 auto 8px !important;
  }
  body.front.portal.iqiyi-template .detail-breadcrumb::after {
    content: none !important;
    display: none !important;
  }
  body.front.portal.iqiyi-template .detail-layout {
    display: grid !important;
    grid-template-columns: clamp(124px, 40vw, 160px) minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
  }
  body.front.portal.iqiyi-template .detail-poster {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    order: initial;
  }
  body.front.portal.iqiyi-template .detail-copy {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start;
    width: auto;
    order: initial;
  }
  body.front.portal.iqiyi-template .detail-actions {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px !important;
    width: 100%;
    order: initial;
  }
  body.front.portal.iqiyi-template .detail-actions > .primary-btn,
  body.front.portal.iqiyi-template .detail-actions > .ghost-btn,
  body.front.portal.iqiyi-template .detail-actions > .disabled-action,
  body.front.portal.iqiyi-template .detail-actions > .like-form,
  body.front.portal.iqiyi-template .detail-actions .like-button {
    width: 100% !important;
    max-width: none !important;
  }
  body.front.portal.iqiyi-template .detail-actions > .primary-btn,
  body.front.portal.iqiyi-template .detail-actions > .ghost-btn,
  body.front.portal.iqiyi-template .detail-actions > .disabled-action,
  body.front.portal.iqiyi-template .detail-actions .like-button {
    min-height: 34px !important;
    height: 34px !important;
  }
  body.front.portal.iqiyi-template .iqiyi-detail-credits {
    gap: 3px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
  }
  body.front.portal.iqiyi-template .iqiyi-detail-credit {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 3px;
  }
  body.front.portal.iqiyi-template .iqiyi-detail-credit-actors span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  body.front.portal.iqiyi-template .synopsis-panel > h2 {
    min-height: 34px;
    margin-bottom: 12px !important;
  }
  body.front.portal.iqiyi-template .synopsis-details > summary {
    top: 14px !important;
    right: 14px !important;
  }
  body.front.portal.iqiyi-template .synopsis-details[open],
  body.front.portal.iqiyi-template .synopsis-body {
    margin-top: 14px !important;
  }
  body.front.portal.iqiyi-template .ds3-bottom-nav.iqiyi-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 60;
    display: grid !important;
    min-height: 58px;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px;
    padding: 5px;
    align-items: stretch;
    overflow: hidden;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--iq-surface-raised) 97%, transparent);
    border: 1px solid var(--iq-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  }
  body.front.portal.iqiyi-template .ds3-bottom-nav.iqiyi-bottom-nav::-webkit-scrollbar { display: none; }
  body.front.portal.iqiyi-template .iqiyi-dock-pill {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    display: grid;
    place-items: center;
    gap: 1px;
    padding: 3px 2px;
    border-radius: 6px;
    color: var(--iq-muted);
    font-size: 11px;
    white-space: nowrap;
  }
  body.front.portal.iqiyi-template .iqiyi-dock-pill.current { color: #072113; background: var(--iq-accent); }
}

@media (prefers-reduced-motion: reduce) {
  body.front.portal.iqiyi-template * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* IQIYI template-family detail/player spacing sync R1 (2026-08-28).
   Keep the loading state inside the fixed player frame instead of allowing it
   to consume normal-flow height and crop the iframe below the frame. */
body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-frame > .player-loading-stage {
  position: absolute !important;
  inset: 0 !important;
  z-index: 7 !important;
  box-sizing: border-box !important;
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 24px !important;
  overflow: hidden !important;
  background: rgba(5, 7, 11, .96) !important;
  pointer-events: none !important;
}

body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-frame > .player-loading-stage.is-hidden {
  display: none !important;
}

body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-loading-box {
  min-width: 0 !important;
  max-width: min(520px, 82%) !important;
  text-align: center !important;
}

body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-ad-badge,
body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-ad-countdown {
  position: absolute !important;
  top: 14px !important;
}

body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-ad-badge {
  left: 14px !important;
}

body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-ad-countdown {
  left: 52px !important;
}

/* Restore the breadcrumb to compact content flow on detail and player pages. */
@media (min-width: 761px) {
  body.front.portal.iqiyi-template.tpl-iqiyi .detail-hero {
    display: block !important;
    min-height: 0 !important;
    padding: 18px 0 22px !important;
  }

  body.front.portal.iqiyi-template.tpl-iqiyi .detail-breadcrumb {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    width: var(--iqiyi-shell) !important;
    max-width: var(--iqiyi-shell) !important;
    margin: 0 auto 12px !important;
    padding: 0 0 5px !important;
    border-bottom: 1px solid var(--iq-border) !important;
  }

  body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-shell {
    margin-top: 16px !important;
  }
}

@media (max-width: 760px) {
  body.front.portal.iqiyi-template.tpl-iqiyi .detail-breadcrumb {
    top: auto !important;
    margin: 0 auto 8px !important;
    padding: 0 0 4px !important;
    border-bottom: 1px solid var(--iq-border) !important;
  }

  body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-shell {
    margin-top: 10px !important;
  }

  body.front.portal.iqiyi-template.tpl-iqiyi.player-page .player-frame > .player-loading-stage {
    padding: 16px !important;
  }
}
