/* 黄果仿站：在 ref1/ref2 之上的少量补丁 */
:root {
  --age-gate-cta: var(--brand-cta);
  --color-primary: #ffd21c;
  --color-primary-end: #f5a623;
  --color-red: #ff3332;
  --hg-page-gutter: 16px;
}

@media (min-width: 768px) {
  :root {
    --hg-page-gutter: 24px;
  }
}

.hg-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 20px;
}

.hg-breadcrumb,
.hg-breadcrumb a,
.hg-breadcrumb__sep {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.hg-breadcrumb a:hover {
  color: var(--color-primary);
}

.hg-breadcrumb__current {
  color: var(--color-primary);
}

.hg-ep-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hg-ep-range {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.hg-ep-range.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(255, 210, 28, 0.08);
}

.hg-web-play__fact-accent {
  display: block;
  width: 2px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--color-primary), transparent);
}

.hg-web-play__quota {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.hg-web-play__quota a {
  color: var(--color-primary);
  text-decoration: underline;
}

.hg-web-play__ep.is-locked {
  pointer-events: auto;
  opacity: 0.45;
  font-size: 12px;
}

.hg-web-play__viewport.is-playing .hg-web-play__cover {
  opacity: 0;
  pointer-events: none;
}

.hg-web-play__viewport.needs-tap::after {
  content: '点击播放';
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.hg-web-play__ep[hidden] {
  display: none !important;
}

.hg-web-play__star {
  color: rgba(255, 255, 255, 0.25);
  font-size: 22px;
}

.hg-web-play__introcard .hg-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid rgb(45, 40, 49);
  border-radius: 8px;
  background: rgb(28, 25, 30);
  color: rgb(162, 159, 166);
  font-size: 12px;
  font-weight: 500;
}

.hg-web-play__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.hg-web-play__video {
  z-index: 2;
}

.hg-web-play__video[hidden] {
  display: none !important;
}

.hg-web-play__viewport:not(.is-playing) .hg-web-play__video {
  display: none !important;
}

@media (max-width: 1199px) {
  .hg-web-play__main {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hg-web-play__side {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-height: 0 !important;
  }

  .hg-web-play__left {
    width: 100%;
    min-width: 0;
  }

  .hg-web-play__viewport {
    aspect-ratio: 16 / 9;
  }
}

.hg-web-play button.hg-web-play__ep {
  font-family: inherit;
}

.hg-web-play__scorebox .hg-web-play__intro-split {
  display: none;
}

@media (min-width: 1024px) {
  .hg-web-play__introcard .hg-web-play__scorebox {
    border-left: none;
  }
}

#age-gate-dialog:not([open]) {
  display: none;
}

#age-gate-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(calc(100% - 32px), 420px);
  padding: 28px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  background: #141417;
  color: #f2f2f4;
}

#age-gate-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(8px);
}

.FeaturedHero_dot__Ieg9L[aria-pressed="true"] {
  opacity: 1;
  transform: scale(1.15);
}

.hg-detail-layout {
  display: none;
}

.hg-detail-stage {
  position: relative;
  width: min(420px, 100%);
  max-width: 420px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
  aspect-ratio: 9 / 16;
  max-height: min(740px, calc(100vh - 160px));
}

@media (min-width: 1024px) {
  .hg-detail-stage {
    margin-inline: 0;
  }
}

.hg-detail-poster,
.hg-detail-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hg-detail-poster {
  background-color: #242424;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: opacity 0.2s ease;
}

.hg-detail-video {
  object-fit: contain;
  object-position: center center;
  background: #000;
}

.hg-detail-video[hidden] {
  display: none !important;
}

.hg-detail-stage.is-playing .hg-detail-poster {
  opacity: 0;
  pointer-events: none;
}

.hg-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.hg-ep-grid button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f2f2f4;
  font-size: 13px;
  cursor: pointer;
}

.hg-ep-grid button.is-active {
  border-color: var(--brand-pink);
  background: rgba(255, 74, 123, 0.15);
}

.hg-ep-grid button.is-locked {
  opacity: 0.55;
}

/* 搜索/分区列表：多行网格（勿用 .poster-carousel，其为首页横向滚动条） */
.hg-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 7px;
}

@media (min-width: 768px) {
  .hg-search-grid {
    grid-template-columns: repeat(var(--site-poster-columns), minmax(0, 1fr));
    gap: 24px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 播放页 · 手机端：播放器优先，选集紧跟其后 */
@media (max-width: 767px) {
  .hg-web-play {
    padding-bottom: 12px !important;
  }

  [data-play-page] {
    padding-top: 0;
    padding-bottom: 8px;
  }

  .hg-web-play__breadcrumb {
    display: none;
  }

  .hg-web-play__main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
  }

  .hg-web-play__left {
    display: contents;
  }

  .hg-web-play__titlebar {
    order: 1;
    padding: 0 var(--hg-page-gutter);
    background: transparent;
    border: 0;
    border-radius: 0;
    gap: 0;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .hg-web-play__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hg-web-play__title-ep {
    display: none !important;
  }

  .hg-web-play__viewport {
    order: 2;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    aspect-ratio: 9 / 16;
    max-height: min(58dvh, 480px);
    min-height: 0;
    height: auto;
  }

  .hg-web-play__actions {
    order: 3;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 var(--hg-page-gutter);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    touch-action: manipulation;
  }

  .hg-web-play__actions .hg-web-play__action {
    position: relative;
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 210, 28, 0.2);
  }

  .hg-web-play__actions .hg-web-play__action[aria-disabled='true'] {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
  }

  .hg-web-play__actions .hg-web-play__action[aria-disabled='true'] > * {
    opacity: 1;
  }

  .hg-web-play__actions a.hg-web-play__action:not([aria-disabled='true']) {
    opacity: 1;
  }

  .hg-web-play__action--minor {
    display: none !important;
  }

  .hg-web-play__action {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .hg-web-play__side {
    order: 4;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none;
    align-self: stretch;
    box-sizing: border-box;
    margin: 0 var(--hg-page-gutter);
    padding: 12px 14px 14px;
    min-height: 0 !important;
    border-radius: 12px;
  }

  .hg-web-play__side-head {
    align-items: center;
    gap: 8px;
  }

  .hg-web-play__side-head > div {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .hg-web-play__side-head > div p {
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
  }

  .hg-web-play__side-current {
    flex-shrink: 0;
    font-size: 12px;
  }

  .hg-web-play__side > .hg-web-play__episode-scroll,
  .hg-web-play__episode-scroll > .hg-web-play__ep-grid {
    width: 100%;
  }

  .hg-web-play__side > * {
    flex: 0 0 auto;
    width: 100%;
  }

  .hg-web-play__side > .hg-web-play__episode-scroll {
    flex: 0 0 auto;
    overflow: visible;
  }

  .hg-web-play__side-head h2 {
    font-size: 16px;
  }

  .hg-web-play__side-rule {
    margin: 12px 0;
  }

  .hg-web-play__ep-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .hg-web-play__ep {
    height: 36px;
    font-size: 13px;
  }

  .hg-web-play__ep:disabled,
  .hg-web-play__ep.is-locked {
    pointer-events: none;
    opacity: 0.35;
  }

  .hg-web-play__viewport {
    cursor: pointer;
  }

  .hg-web-play__episode-scroll {
    max-height: none;
    overflow: visible;
  }

  .hg-web-play__detail-more {
    order: 5;
    padding: 0 var(--hg-page-gutter);
  }

  .hg-web-play__introcard {
    display: none !important;
  }

  .hg-web-play__synopsis {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgb(22, 22, 22);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .hg-web-play__synopsis h2 {
    font-size: 15px;
    margin: 0 0 8px;
  }

  .hg-web-play__synopsis-text.is-clamped {
    -webkit-line-clamp: 3;
  }

  .page-shell:has([data-play-page]) .fixed.bottom-6 {
    display: none;
  }

  .page-shell:has([data-play-page]) footer {
    padding: 10px var(--hg-page-gutter);
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    margin-top: 4px;
    border-top-color: rgba(255, 255, 255, 0.05);
  }

  .page-shell:has([data-play-page]) footer .site-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .page-shell:has([data-play-page]) footer .site-content > .flex {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0 !important;
    margin: 0;
  }

  .page-shell:has([data-play-page]) footer .max-w-xl {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: none;
    min-width: 0;
  }

  .page-shell:has([data-play-page]) footer .max-w-xl > p.mt-4,
  .page-shell:has([data-play-page]) footer .max-w-xl > p.mt-2,
  .page-shell:has([data-play-page]) footer .flex-wrap {
    display: none !important;
  }

  .page-shell:has([data-play-page]) footer .site-content > p.mt-8 {
    margin: 0 !important;
    flex: 0 1 auto;
    text-align: right;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.35);
  }

  .page-shell:has([data-play-page]) footer img {
    height: 22px;
    width: auto;
    flex-shrink: 0;
  }

  .page-shell:has([data-play-page]) .hg-web-play__main {
    gap: 10px;
    margin-top: 6px;
  }

  .page-shell:has([data-play-page]) main {
    padding-bottom: 0 !important;
  }
}

@media (min-width: 768px) {
  .hg-web-play__detail-more {
    display: contents;
  }
}
