/* 红果影视 · hongguo theme — brand #e8382a, Figma-aligned native CSS */
:root {
  --hg-brand: #e8382a;
  --hg-brand-light: #ff5a4a;
  --hg-brand-dark: #c42a1e;
  --hg-surface: #f4f4f6;
  --hg-card: #ffffff;
  --hg-text: #1a1a1a;
  --hg-muted: #6b7280;
  --hg-border: #e5e7eb;
  --hg-footer: #111827;
  --hg-footer-muted: #9ca3af;
  --hg-radius: 12px;
  --hg-radius-sm: 8px;
  --hg-radius-pill: 999px;
  --hg-max: 1280px;
  --hg-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --hg-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --hg-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --hg-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--hg-font);
  background: var(--hg-surface);
  color: var(--hg-text);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--hg-brand); }
img { max-width: 100%; height: auto; display: block; vertical-align: middle; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 0.75em; }
button, input { font: inherit; }
.hide, .hidden { display: none !important; }

.hg-container {
  width: 100%;
  max-width: var(--hg-max);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.hg-header,
.hg-main,
.hg-footer {
  width: 100%;
  max-width: 100%;
}

/* —— Header —— */
.hg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--hg-border);
  box-shadow: var(--hg-shadow);
}

.hg-header__row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}

.hg-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--hg-text);
  font-family: var(--hg-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.hg-logo:hover { color: var(--hg-text); }

.hg-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hg-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hg-nav--desktop {
  display: none;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.hg-nav--desktop a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  white-space: nowrap;
}

.hg-nav--desktop a:hover {
  color: var(--hg-brand);
  background: #fef2f2;
}

.hg-search {
  position: relative;
  flex: 1;
  max-width: 280px;
  margin-left: auto;
}

.hg-search input {
  width: 100%;
  height: 34px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius-pill);
  background: #f9fafb;
  outline: none;
  font-size: 13px;
}

.hg-search input:focus {
  border-color: var(--hg-brand-light);
  background: #fff;
}

.hg-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.hg-search button:hover { color: var(--hg-brand); }

.hg-history { position: relative; flex-shrink: 0; }

.hg-history__toggle {
  border: 1px solid var(--hg-border);
  background: #fff;
  border-radius: var(--hg-radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
}

.hg-history__toggle:hover {
  border-color: var(--hg-brand-light);
  color: var(--hg-brand);
}

.hg-history__panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  box-shadow: var(--hg-shadow-md);
  z-index: 120;
  padding: 10px 12px;
}

.hg-history__panel.is-open { display: block; }

.hg-history__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
  color: #374151;
}

.hg-history__clear,
.historyclean {
  border: 0;
  background: transparent;
  color: var(--hg-brand);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.hg-history__list li { border-top: 1px solid #f3f4f6; }
.hg-history__list a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px;
  font-size: 13px;
  color: #374151;
}
.hg-history__part { color: var(--hg-brand); font-size: 12px; flex-shrink: 0; }
.hg-history__empty { padding: 48px 8px; text-align: center; color: var(--hg-muted); font-size: 13px; }

.hg-nav__burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #374151;
  padding: 4px;
}

.hg-nav--mobile {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0 12px;
  border-top: 1px solid var(--hg-border);
}

.hg-nav--mobile.is-open { display: flex; }

.hg-nav--mobile a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #4b5563;
}

.hg-nav--mobile a:hover {
  color: var(--hg-brand);
  background: #fef2f2;
}

/* —— Main / SEO —— */
.hg-main { padding: 16px 0 40px; flex: 1; }

.hg-seo-hero {
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--hg-shadow);
}

.hg-seo-hero h1 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  font-family: var(--hg-display);
}

.hg-seo-hero p {
  margin: 0;
  font-size: 13px;
  color: var(--hg-muted);
  line-height: 1.7;
}

.hg-seo-hero a { color: var(--hg-brand); }

.hg-seo-hub {
  background: linear-gradient(105deg, #dc2626 0%, #ea580c 100%);
  border-radius: 16px;
  padding: 22px 20px;
  margin-bottom: 24px;
  color: #fff;
}

.hg-seo-hub h2,
.hg-seo-hub h1 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 6px;
  font-family: var(--hg-display);
}

.hg-seo-hub p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-bottom: 14px;
}

.hg-hub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hg-hub-links a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--hg-radius-pill);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  transition: background 0.2s;
}

.hg-hub-links a:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.hg-seo-hub .hg-search {
  max-width: 420px;
  margin: 0 0 12px;
  display: flex;
  gap: 8px;
}

.hg-seo-hub .hg-search input {
  flex: 1;
  height: 40px;
  background: #fff;
  color: var(--hg-text);
}

.hg-seo-hub .hg-search button {
  position: static;
  transform: none;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--hg-radius-pill);
  background: #111827;
  color: #fff;
  border: 0;
}

.hg-breadcrumb {
  font-size: 12px;
  color: var(--hg-muted);
  margin-bottom: 14px;
}

.hg-breadcrumb a:hover { color: var(--hg-brand); }
.hg-breadcrumb em { font-style: normal; color: #374151; }

/* —— Cards / Grid —— */
.hg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.hg-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hg-card { min-width: 0; }

.hg-card__thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--hg-radius-sm);
  background: #e5e7eb;
  aspect-ratio: 2 / 3;
}

.hg-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.hg-card:hover .hg-card__thumb img { transform: scale(1.05); }

.hg-card__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.hg-card__rating {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #facc15;
  font-size: 12px;
  font-weight: 700;
}

.hg-card__title {
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-card__title a { color: var(--hg-text); }
.hg-card__title a:hover { color: var(--hg-brand); }

.hg-card__meta {
  margin: 0;
  font-size: 12px;
  color: var(--hg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Channel / Carousel —— */
.hg-channel { margin-bottom: 28px; }

.hg-channel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hg-channel__head h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.hg-channel__head h3 a { color: var(--hg-text); }
.hg-channel__head h3 a:hover { color: var(--hg-brand); }

.hg-more {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--hg-muted);
  white-space: nowrap;
}

.hg-more:hover { color: var(--hg-brand); }

.hg-genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hg-genre-tags a {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--hg-radius-pill);
  background: #fef2f2;
  color: var(--hg-brand);
}

.hg-channel__layout { display: block; }

/* 默认单列堆叠；≥1024 再变左右栏，避免移动端残留 1fr+220px 半屏空白 */
.hg-channel__layout--side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hg-channel__main,
.hg-channel__side {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hg-channel__textlist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  overflow: hidden;
  box-shadow: var(--hg-shadow);
}

.hg-channel__textlist a,
.hg-textlist__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--hg-text);
  border-bottom: 1px solid #f1f2f4;
  background: #fff;
}

.hg-channel__textlist a:nth-child(even),
.hg-textlist__item:nth-child(even) {
  background: #fafbfc;
}

.hg-channel__textlist a:last-child,
.hg-textlist__item:last-child {
  border-bottom: none;
}

.hg-channel__textlist a:hover,
.hg-textlist__item:hover {
  background: #fef2f2;
  color: var(--hg-brand);
}

.hg-channel__textlist a span:first-child,
.hg-textlist__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-channel__textlist a:hover span:first-child,
.hg-textlist__item:hover .hg-textlist__name {
  color: var(--hg-brand);
}

.hg-channel__textlist a span:last-child,
.hg-textlist__meta {
  flex-shrink: 0;
  max-width: 42%;
  font-size: 12px;
  font-weight: 400;
  color: var(--hg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.hg-channel__side {
  margin-top: 4px;
}

.hg-carousel { margin-bottom: 24px; }

.hg-carousel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hg-carousel__head h2 {
  font-size: 1rem;
  margin: 0;
}

.hg-carousel__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hg-carousel__nav button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hg-border);
  background: #fff;
  cursor: pointer;
  color: #374151;
}

.hg-carousel__nav button:hover {
  border-color: var(--hg-brand);
  color: var(--hg-brand);
}

.hg-carousel__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.hg-carousel__track::-webkit-scrollbar { height: 4px; }
.hg-carousel__track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.hg-carousel__item {
  flex: 0 0 120px;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  scroll-snap-align: start;
}

/* 精选横滑：强制统一海报框，避免源图比例把卡片撑乱 */
.hg-carousel__item .hg-card {
  width: 100%;
}

.hg-carousel__item .hg-card__thumb {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e5e7eb;
}

.hg-carousel__item .hg-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hg-carousel__item .hg-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
  line-height: 1.2;
}

/* —— Rank sidebar —— */
.hg-rank {
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  padding: 14px;
  box-shadow: var(--hg-shadow);
  margin-bottom: 14px;
}

.hg-rank h3 {
  font-size: 14px;
  margin: 0 0 10px;
  padding-left: 8px;
  border-left: 3px solid var(--hg-brand);
}

.hg-rank ol { counter-reset: hg-rank; }
.hg-rank li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.hg-rank li:last-child { border-bottom: 0; }

.hg-rank .num {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hg-rank .num.top {
  background: var(--hg-brand);
  color: #fff;
}

.hg-rank a {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #374151;
}

.hg-rank .score {
  color: var(--hg-muted);
  font-size: 11px;
  flex-shrink: 0;
  max-width: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2px;
}

.hg-rank-quad {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
  min-width: 0;
}

.hg-rank-quad > .hg-rank {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  overflow: hidden;
}

.hg-rank-quad .hg-rank li {
  gap: 6px;
  padding-right: 2px;
}

.hg-rank-quad .hg-rank .score {
  max-width: 3.2em;
}

/* —— Hero banner —— */
.hg-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: #111;
  margin-bottom: 20px;
  min-height: 180px;
}

.hg-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}

.hg-hero__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.hg-hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hg-hero__slide .hg-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px 36px;
  color: #fff;
}

.hg-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px 36px;
  color: #fff;
}

.hg-hero__overlay h2 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  margin: 0 0 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  font-family: var(--hg-display);
}

.hg-hero__overlay p {
  max-width: 420px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hg-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hg-hero__dots {
  position: absolute;
  right: 20px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.hg-hero__dots button {
  width: 8px;
  height: 8px;
  border-radius: var(--hg-radius-pill);
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
}

.hg-hero__dots button.is-active {
  width: 20px;
  background: var(--hg-brand);
}

.hg-home-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-bottom: 8px;
}

.hg-home-top__main,
.hg-home-top__side {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* —— Detail / Player —— */
.hg-detail { display: block; }
.hg-detail--side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hg-detail__main,
.hg-detail__side {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hg-panel {
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--hg-shadow);
}

.hg-panel > h2,
.hg-panel > h3,
.hg-panel__title {
  font-size: 15px;
  margin: 0 0 12px;
}

.hg-tip {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--hg-radius-sm);
  margin-bottom: 12px;
}

.hg-movie-info {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--hg-shadow);
}

.hg-detail__stack > .hg-tip {
  margin-bottom: 12px;
}

.hg-poster {
  position: relative;
  width: 128px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #e5e7eb;
}

.hg-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hg-poster__badge {
  position: absolute;
  left: 6px;
  top: 6px;
  background: var(--hg-brand);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.hg-meta { flex: 1; min-width: 0; }

.hg-meta .title {
  font-size: 1.2rem;
  margin: 0 0 10px;
}

.hg-meta .score,
.text-red { color: var(--hg-brand); }

.hg-meta .data {
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 6px;
}

.hg-meta .text-muted { color: var(--hg-muted); }
.hg-meta .desc { font-size: 13px; color: #4b5563; }

.hg-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--hg-radius-pill);
  background: var(--hg-brand);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s, background 0.15s;
}

.hg-cta:hover {
  background: var(--hg-brand-dark);
  color: #fff !important;
  transform: scale(1.03);
}

.hg-play-btns { margin-top: 12px; }

.hg-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hg-source-tabs a {
  padding: 6px 12px;
  border-radius: var(--hg-radius-sm);
  background: #f3f4f6;
  font-size: 13px;
  color: #4b5563;
}

.hg-source-tabs a.active,
.hg-source-tabs a:hover {
  background: var(--hg-brand);
  color: #fff;
}

.hg-episode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hg-episode-grid a {
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--hg-radius-sm);
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #4b5563;
}

.hg-episode-grid a.is-current,
.hg-episode-grid a:hover {
  background: var(--hg-brand);
  color: #fff;
}

.hg-platforms__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hg-platforms__grid .btn,
.hg-platforms__grid a {
  display: block;
  text-align: center;
  padding: 8px 6px;
  border-radius: var(--hg-radius-sm);
  background: #f9fafb;
  border: 1px solid var(--hg-border);
  font-size: 12px;
  color: #374151;
}

.hg-platforms__grid .btn-default,
.hg-platforms__grid a.btn-default {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--hg-brand);
}

.hg-highlights { margin-top: 12px; }
.hg-highlights h4 { font-size: 14px; margin-bottom: 8px; }
.hg-highlights li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #4b5563;
}
.hg-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hg-brand);
}

.hg-faq__title { margin-bottom: 12px !important; }
.hg-faq__item {
  border-top: 1px solid #f3f4f6;
  padding: 12px 0;
}
.hg-faq__item h4 {
  font-size: 14px;
  margin: 0 0 6px;
  color: #111827;
}
.hg-faq__item p {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}

/* Player 16:9 */
.hg-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--hg-radius-sm);
  overflow: hidden;
}

.hg-player-stage #dplayer,
.hg-player-stage .m3u8_type {
  width: 100%;
  height: 100%;
}

.hg-player-stage .url_type {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 20px;
  text-align: center;
  background: #111;
}

.hg-player-stage .url_type.is-on { display: flex; }

.hg-player-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.hg-player-info { margin-top: 12px; }
.hg-player-info__title { font-size: 1.1rem; margin: 8px 0; }
.hg-player-info__title em { font-style: normal; color: var(--hg-muted); font-weight: 500; }
.hg-player-info__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #4b5563;
}
.hg-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hg-player-actions a {
  padding: 6px 12px;
  border-radius: var(--hg-radius-sm);
  background: #f3f4f6;
  font-size: 13px;
}
.hg-player-actions a.is-disabled { opacity: 0.45; pointer-events: none; }

/* Filter / list helpers */
.hg-filter-bar,
.filter-bar {
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  padding: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.hg-filter-row,
.filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  max-width: 100%;
}

.hg-filter-row:last-child,
.filter-row:last-child {
  margin-bottom: 0;
}

.hg-filter-row dt,
.filter-row dt {
  flex: 0 0 auto;
  width: 2.75em;
  margin: 0;
  padding-top: 6px;
  color: var(--hg-muted);
  font-weight: 600;
  line-height: 1.2;
}

.hg-filter-row dd,
.filter-row dd {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.hg-filter-row a,
.filter-row a {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--hg-radius-pill);
  color: #4b5563;
  line-height: 1.3;
  white-space: nowrap;
}

.hg-filter-row a.active,
.filter-row a.active,
.hg-filter-row a.is-active,
.filter-row a.is-active {
  background: var(--hg-brand);
  color: #fff;
}

.hg-pager,
.pager,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 20px 0;
}

.hg-pager a,
.pager a,
.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hg-radius-sm);
  background: #fff;
  border: 1px solid var(--hg-border);
  font-size: 13px;
}

.hg-pager a.active,
.pager a.active,
.pagination .active {
  background: var(--hg-brand);
  border-color: var(--hg-brand);
  color: #fff;
}

.hg-new-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hg-new-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--hg-border);
  transition: box-shadow 0.2s;
}

.hg-new-item:hover { box-shadow: var(--hg-shadow-md); }

.hg-new-item__poster {
  width: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #e5e7eb;
}

.hg-new-item__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hg-friend {
  background: #fff;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  padding: 16px;
  margin-top: 8px;
}

.hg-friend h3 { font-size: 14px; margin-bottom: 8px; }
.hg-friend__lead,
.hg-friend__note,
.hg-friend__apply { font-size: 13px; color: var(--hg-muted); }
.hg-friend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0;
}
.hg-friend a { color: #4b5563; font-size: 13px; }
.hg-friend a:hover { color: var(--hg-brand); }

/* 404 */
.hg-404 { text-align: center; padding: 24px 12px; }
.hg-404__code {
  font-size: 72px;
  font-weight: 800;
  color: var(--hg-brand);
  line-height: 1;
  margin: 0 0 8px;
  font-family: var(--hg-display);
}
.hg-404__heading { font-size: 1.2rem; margin-bottom: 8px; }
.hg-404__path,
.hg-404__hint { font-size: 13px; color: var(--hg-muted); }
.hg-404__nav-title { margin: 18px 0 10px; font-size: 14px; }

/* —— Footer —— */
.hg-footer {
  background: var(--hg-footer);
  color: var(--hg-footer-muted);
  margin-top: 40px;
  padding: 40px 0 28px;
  font-size: 13px;
  overflow: hidden;
}

.hg-footer a { color: var(--hg-footer-muted); }
.hg-footer a:hover { color: #fff; }

.hg-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.hg-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 700;
  font-family: var(--hg-display);
}

.hg-footer__brand .hg-logo__mark {
  width: 28px;
  height: 28px;
  font-size: 9px;
}

.hg-footer h4 {
  color: #fff;
  font-size: 13px;
  margin-bottom: 12px;
}

.hg-footer__col ul { display: flex; flex-direction: column; gap: 8px; }

.hg-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #1f2937;
  margin-bottom: 16px;
  font-size: 12px;
}

.hg-footer__copy {
  text-align: center;
  font-size: 12px;
  color: #4b5563;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid #1f2937;
}

.hg-footer p { color: #9ca3af; line-height: 1.7; }

.hg-footer__legal {
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}

/* Back to top */
.hg-backtop {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--hg-brand);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 90;
  box-shadow: var(--hg-shadow-md);
}

.hg-backtop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Search result rows */
.search-result-item,
.hg-search-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.search-result-item img,
.hg-search-item img {
  width: 72px;
  height: 108px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Utility aliases kept for residual markup during migration */
.split-line::before { content: "|"; color: #d1d5db; margin: 0 4px; }
.btn { cursor: pointer; }

/* —— List / Rank / Search rows（海报+信息横排） —— */
.list-card__title {
  font-size: 1.05rem;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hg-border);
}

.movie-list-row,
.hg-list-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f2f4;
}

.movie-list-row:last-child,
.hg-list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.movie-list-row:first-of-type,
.hg-list-row:first-of-type {
  padding-top: 4px;
}

.movie-list-row__thumb,
.hg-list-row__thumb {
  display: block;
  width: 88px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow: var(--hg-shadow);
}

.movie-list-row__thumb img,
.hg-list-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-list-row__body,
.hg-list-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movie-list-row__title,
.hg-list-row__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.movie-list-row__title a,
.hg-list-row__title a {
  color: var(--hg-text);
}

.movie-list-row__title a:hover,
.hg-list-row__title a:hover {
  color: var(--hg-brand);
}

.movie-list-row__meta,
.hg-list-row__meta {
  font-size: 12px;
  color: var(--hg-muted);
  line-height: 1.5;
  margin: 0;
}

.movie-list-row__desc,
.hg-list-row__desc {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-list-row__actions,
.hg-list-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 4px 0 0;
}

.movie-list-row__actions .hg-cta,
.hg-list-row__actions .hg-cta,
.play-cta--sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--hg-radius-pill);
  background: var(--hg-brand);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  width: auto;
}

.movie-list-row__actions .hg-cta:hover,
.play-cta--sm:hover {
  background: var(--hg-brand-dark);
  color: #fff !important;
}

.text-link--sm {
  font-size: 13px;
  color: var(--hg-muted);
  font-weight: 500;
}

.text-link--sm:hover {
  color: var(--hg-brand);
}

/* —— Responsive（移动端优先） —— */
@media (max-width: 1023.98px) {
  .hg-home-top,
  .hg-channel__layout--side,
  .hg-detail--side {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: 100% !important;
  }
  .hg-home-top > *,
  .hg-home-top__main,
  .hg-home-top__side,
  .hg-channel__main,
  .hg-channel__side,
  .hg-detail__main,
  .hg-detail__side {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
}

@media (max-width: 767px) {
  .hg-container { padding: 0 12px; }
  .hg-header__row {
    gap: 8px;
    min-height: 52px;
  }
  .hg-logo span:not(.hg-logo__mark) {
    font-size: 0.95rem;
  }
  .hg-search {
    max-width: none;
    flex: 1;
    min-width: 0;
  }
  .hg-search input {
    font-size: 14px;
    height: 36px;
  }
  .hg-history { display: none; }
  .hg-main { padding: 12px 0 28px; }
  .hg-seo-hero {
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .hg-seo-hero h1 {
    font-size: 1.12rem;
    margin-bottom: 8px;
  }
  .hg-seo-hero p {
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
  }
  .hg-seo-hub {
    padding: 16px 16px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .hg-seo-hub h1 {
    font-size: 1.1rem;
    line-height: 1.35;
  }
  .hg-seo-hub p {
    font-size: 12px;
    line-height: 1.55;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hg-seo-hub .hg-search {
    max-width: none;
    width: 100%;
    margin: 0 0 12px;
  }
  .hg-seo-hub .hg-search input {
    min-width: 0;
    flex: 1;
  }
  .hg-seo-hub .hg-search button {
    flex-shrink: 0;
    padding: 0 14px;
  }
  .hg-hub-links {
    gap: 8px;
  }
  .hg-hub-links a {
    font-size: 12px;
    padding: 7px 11px;
    line-height: 1.2;
  }
  .hg-hero {
    aspect-ratio: 16 / 9;
    max-height: 200px;
    border-radius: 14px;
    margin-bottom: 16px;
    width: 100%;
  }
  .hg-hero__slide img {
    object-fit: cover;
    object-position: center 18%;
  }
  .hg-hero__overlay {
    padding: 12px 14px 28px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
    justify-content: flex-end;
  }
  .hg-hero__overlay h2 {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }
  .hg-hero__overlay p {
    display: none;
  }
  .hg-hero__actions {
    gap: 8px;
  }
  .hg-hero__actions .hg-cta {
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }
  .hg-hero__actions .hg-cta:last-child {
    display: none;
  }
  .hg-hero__dots {
    right: 12px;
    bottom: 10px;
  }
  .hg-home-top {
    gap: 12px;
  }
  /* 手机端两列海报，触控更大；避免三列过碎 */
  .hg-grid,
  .hg-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .hg-card__title {
    font-size: 13px;
  }
  .hg-card__meta {
    font-size: 11px;
  }
  .hg-channel__textlist {
    grid-template-columns: 1fr;
  }
  .hg-channel__layout--side,
  .hg-detail--side {
    gap: 12px;
  }
  .hg-channel__side,
  .hg-detail__side,
  .hg-home-top__side {
    display: block;
  }
  .hg-rank {
    width: 100%;
  }
  .hg-movie-info {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    margin-bottom: 14px;
  }
  .hg-poster {
    width: 112px;
    margin: 0 auto;
  }
  .hg-meta .title {
    font-size: 1.05rem;
    text-align: left;
  }
  .hg-play-btns .hg-cta,
  .hg-meta .hg-cta {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .hg-hero__actions .hg-cta {
    width: auto;
    min-height: 36px;
  }
  .hg-episode-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .hg-episode-grid a {
    min-height: 40px;
  }
  .hg-source-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .hg-footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 10px;
    margin-bottom: 18px;
  }
  .hg-footer__intro {
    grid-column: 1 / -1;
  }
  .hg-footer__intro > p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hg-footer {
    padding: 24px 0 36px;
    font-size: 12px;
  }
  .hg-footer__brand {
    margin-bottom: 8px;
    font-size: 0.95rem;
  }
  .hg-footer__col h4 {
    margin-bottom: 8px;
    font-size: 12px;
  }
  .hg-footer__col ul {
    gap: 6px;
  }
  .hg-footer__col a {
    font-size: 12px;
    line-height: 1.4;
  }
  .hg-footer__links {
    gap: 8px 12px;
    margin-bottom: 12px;
    padding-top: 12px;
  }
  .hg-footer .hg-container > p:not(.hg-footer__copy) {
    font-size: 11px;
    line-height: 1.6;
    margin: 0 0 10px;
    word-break: break-word;
  }
  .hg-footer__copy {
    margin-top: 12px;
    padding-top: 12px;
    font-size: 11px;
  }
  .hg-rank-quad {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hg-rank-quad > .hg-rank {
    padding: 12px 12px 10px;
  }
  .hg-rank-quad .hg-rank h3 {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .hg-rank-quad .hg-rank li {
    gap: 6px;
    padding: 6px 4px 6px 0;
    font-size: 12px;
  }
  .hg-rank-quad .hg-rank .score {
    display: none;
  }
  .hg-filter-bar,
  .filter-bar {
    padding: 12px;
  }
  .hg-filter-row,
  .filter-row {
    gap: 8px;
    margin-bottom: 10px;
  }
  .hg-filter-row dt,
  .filter-row dt {
    width: 2.5em;
    padding-top: 5px;
    font-size: 12px;
  }
  .hg-filter-row dd,
  .filter-row dd {
    gap: 6px;
  }
  .hg-filter-row a,
  .filter-row a {
    padding: 5px 9px;
    font-size: 12px;
  }
  .hg-carousel {
    width: 100%;
  }
  .hg-carousel__item {
    flex: 0 0 120px;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
  }
  .hg-breadcrumb {
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .hidden-xs { display: none !important; }
  .movie-list-row,
  .hg-list-row {
    gap: 12px;
    padding: 12px 0;
  }
  .movie-list-row__thumb,
  .hg-list-row__thumb {
    width: 72px;
  }
  .movie-list-row__title,
  .hg-list-row__title {
    font-size: 15px;
  }
  .movie-list-row__desc,
  .hg-list-row__desc {
    -webkit-line-clamp: 2;
    font-size: 12px;
  }
  .movie-list-row__actions .hg-cta,
  .play-cta--sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .hg-grid,
  .hg-grid--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hg-channel__textlist {
    grid-template-columns: 1fr 1fr;
  }
  .hg-channel__textlist a,
  .hg-textlist__item {
    border-right: 1px solid #f1f2f4;
  }
  .hg-channel__textlist a:nth-child(2n),
  .hg-textlist__item:nth-child(2n) {
    border-right: none;
  }
}

@media (min-width: 640px) {
  .hg-grid,
  .hg-grid--6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hg-carousel__item {
    flex: 0 0 140px;
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }
  .hg-platforms__grid { grid-template-columns: repeat(4, 1fr); }
  .hg-new-list { grid-template-columns: repeat(2, 1fr); }
  .hg-channel__textlist {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .hg-nav--desktop { display: flex; }
  .hg-nav__burger { display: none; }
  .hg-nav--mobile,
  .hg-nav--mobile.is-open { display: none !important; }
  .hg-grid,
  .hg-grid--6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hg-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hg-footer__intro { grid-column: 1 / -1; }
  .hg-rank-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .hg-rank-quad .hg-rank .score { display: inline; max-width: 3.5em; }
  .hg-episode-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1024px) {
  .hg-container { padding: 0 20px; }
  .hg-grid,
  .hg-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hg-channel__layout--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: start;
  }
  .hg-detail--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
  }
  .hg-home-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 224px;
  }
  .hg-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .hg-footer__intro { grid-column: auto; }
  .hg-rank-quad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hg-new-list { grid-template-columns: repeat(3, 1fr); }
  .hg-poster { width: 160px; }
  .hg-seo-hero h1 { font-size: 1.4rem; }
  .hg-movie-info {
    flex-wrap: nowrap;
  }
  .hg-meta { min-width: 180px; }
  .movie-list-row__thumb,
  .hg-list-row__thumb {
    width: 110px;
  }
  .movie-list-row__title,
  .hg-list-row__title {
    font-size: 17px;
  }
  .movie-list-row__desc,
  .hg-list-row__desc {
    -webkit-line-clamp: 3;
  }
}
