/* mother-diversity · midnight-gold · 深夜影厅 · 近黑底+金橙主色+电蓝点缀 */
:root {
  --mg-gold: #f59e0b;
  --mg-gold-dark: #d97706;
  --mg-blue: #38bdf8;
  --mg-blue-deep: #0ea5e9;
  --mg-bg: #0a0a0f;
  --mg-surface: #14141c;
  --mg-surface-2: #1c1c28;
  --mg-text: #f5f5f7;
  --mg-muted: #9ca3af;
  --mg-line: rgba(245, 158, 11, 0.22);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body.body-mg {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 158, 11, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(56, 189, 248, 0.06), transparent 55%),
    var(--mg-bg);
  color: var(--mg-text);
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.55;
}

body.body-mg a {
  color: var(--mg-gold);
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

body.body-mg a:hover { color: var(--mg-blue); }
body.body-mg img { display: block; max-width: 100%; height: auto; }

/* ── Header: 单行暗色顶栏 + 居中导航 ── */
.mg-top {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--mg-line);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.mg-top__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  min-height: 64px;
}

.mg-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--mg-gold) !important;
}

.mg-brand__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--mg-gold), var(--mg-gold-dark));
  color: #0a0a0f;
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.mg-brand__text { display: flex; flex-direction: column; gap: 2px; }
.mg-brand__text strong { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }
.mg-brand__text em { font-style: normal; font-size: 0.65rem; font-weight: 600; color: var(--mg-muted); letter-spacing: 0.06em; }

.mg-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.mg-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--mg-muted) !important;
  border-bottom: 2px solid transparent;
}

.mg-nav a:hover {
  color: var(--mg-gold) !important;
  background: rgba(245, 158, 11, 0.08);
}

.mg-nav a[aria-current="page"] {
  color: var(--mg-gold) !important;
  border-bottom-color: var(--mg-gold);
  background: rgba(245, 158, 11, 0.1);
}

.mg-top__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mg-search {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: var(--mg-surface);
}

.mg-search input {
  width: 140px;
  border: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
  background: transparent;
  color: var(--mg-text);
}

.mg-search button {
  border: 0;
  padding: 0 12px;
  font-size: 1rem;
  color: var(--mg-blue);
  cursor: pointer;
  background: rgba(56, 189, 248, 0.12);
}

.mg-hotlink {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0a0a0f !important;
  background: linear-gradient(135deg, var(--mg-gold), var(--mg-gold-dark));
  white-space: nowrap;
}

.mg-hotlink:hover { filter: brightness(1.08); color: #0a0a0f !important; }

.mg-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--mg-line);
  border-radius: 8px;
  background: var(--mg-surface);
  color: var(--mg-gold);
  font-size: 1.2rem;
  cursor: pointer;
}

.mg-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Home hero: 单海报焦点 ── */
.mg-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
  min-height: 320px;
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.mg-hero__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.55) 55%, rgba(10, 10, 15, 0.3) 100%),
    linear-gradient(0deg, rgba(10, 10, 15, 0.85) 0%, transparent 50%),
    url("../../img/1.jpg") center / cover no-repeat;
  filter: saturate(1.1);
}

.mg-hero__content {
  position: relative;
  z-index: 2;
  padding: 40px 36px;
  max-width: 620px;
}

.mg-hero__eyebrow {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mg-blue);
}

.mg-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 4.2vw, 2.5rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.mg-hero__intro {
  margin: 0 0 24px;
  font-size: clamp(0.9rem, 1.8vw, 1.02rem);
  line-height: 1.7;
  color: rgba(245, 245, 247, 0.88);
  max-width: 520px;
}

.mg-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.mg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.88rem;
  border: 2px solid transparent;
}

.mg-btn--gold {
  color: #0a0a0f !important;
  background: linear-gradient(135deg, var(--mg-gold), var(--mg-gold-dark));
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.mg-btn--gold:hover { filter: brightness(1.08); transform: translateY(-1px); color: #0a0a0f !important; }

.mg-btn--outline {
  color: var(--mg-blue) !important;
  background: transparent;
  border-color: rgba(56, 189, 248, 0.5);
}

.mg-btn--outline:hover { background: rgba(56, 189, 248, 0.12); color: var(--mg-blue) !important; }

/* ── Category grid tiles ── */
.mg-channels { margin-bottom: 36px; }

.mg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.mg-section-head h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 900;
}

.mg-section-head a {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--mg-blue) !important;
  white-space: nowrap;
}

.mg-section-head__tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0a0a0f;
  background: var(--mg-gold);
}

.mg-section-head__tag--blue {
  background: var(--mg-blue);
  color: #0a0a0f;
}

.mg-channel-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.mg-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-channel:hover { transform: translateY(-3px); }

.mg-channel--gold {
  background: var(--mg-surface);
  border-color: rgba(245, 158, 11, 0.3);
}

.mg-channel--gold:hover { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2); }

.mg-channel--blue {
  background: var(--mg-surface-2);
  border-color: rgba(56, 189, 248, 0.25);
}

.mg-channel--blue:hover { box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15); }

.mg-channel__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 900;
}

.mg-channel--gold .mg-channel__icon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--mg-gold);
}

.mg-channel--blue .mg-channel__icon {
  background: rgba(56, 189, 248, 0.15);
  color: var(--mg-blue);
}

.mg-channel__name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--mg-text) !important;
}

.mg-channel:hover .mg-channel__name { color: var(--mg-gold) !important; }

/* ── Sections ── */
.mg-section { margin-bottom: 38px; }

/* ── Poster cards (2:3 portrait, overlay title) ── */
.mg-poster-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mg-poster-grid--compact { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.mg-poster-grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mg-pcard__link { display: block; color: inherit !important; }

.mg-pcard__frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--mg-surface);
  border: 1px solid rgba(245, 158, 11, 0.15);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.mg-pcard:hover .mg-pcard__frame {
  transform: translateY(-4px);
  border-color: var(--mg-gold);
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.18);
}

.mg-pcard__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.mg-pcard:hover .mg-pcard__frame img { transform: scale(1.05); }

.mg-pcard__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #0a0a0f;
  background: var(--mg-gold);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
  z-index: 2;
}

.mg-pcard__shade {
  position: absolute;
  inset: auto 0 0;
  padding: 40px 12px 12px;
  background: linear-gradient(0deg, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.5) 70%, transparent 100%);
}

.mg-pcard__shade h3 {
  margin: 0 0 6px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
}

.mg-pcard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--mg-muted);
}

.mg-pcard__meta span:first-child { color: var(--mg-blue); }

/* ── Compact row card (related / rank) ── */
.mg-rcard__link {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--mg-surface);
  border: 1px solid rgba(56, 189, 248, 0.12);
  color: inherit !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mg-rcard__link:hover {
  border-color: var(--mg-gold);
  background: var(--mg-surface-2);
}

.mg-rcard__thumb {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--mg-surface-2);
}

.mg-rcard__thumb img { width: 100%; height: 100%; object-fit: cover; }

.mg-rcard__badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 900;
  color: #0a0a0f;
  background: var(--mg-gold);
}

.mg-rcard__body h3 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--mg-text);
}

.mg-rcard__meta {
  margin: 0;
  font-size: 0.66rem;
  color: var(--mg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Category page: 左栏筛选 + 右栏栅格 ── */
.mg-cat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.mg-cat-side {
  position: sticky;
  top: 84px;
  padding: 22px 20px;
  border-radius: 8px;
  background: var(--mg-surface);
  border: 1px solid var(--mg-line);
  border-top: 3px solid var(--mg-gold);
}

.mg-cat-side h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 900;
  color: var(--mg-gold);
}

.mg-cat-side__desc {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--mg-muted);
  line-height: 1.65;
}

.mg-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mg-muted);
}

.mg-crumb a { color: var(--mg-blue) !important; }

.mg-cat-filters { display: flex; flex-direction: column; gap: 10px; }

.mg-cat-filters__label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--mg-gold);
  text-transform: uppercase;
}

.mg-cat-filters__input,
.mg-cat-filters__select {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mg-text);
  background: var(--mg-surface-2);
  outline: none;
}

.mg-cat-filters__input:focus,
.mg-cat-filters__select:focus { border-color: var(--mg-gold); }

.mg-empty {
  padding: 32px;
  text-align: center;
  border-radius: 8px;
  background: var(--mg-surface);
  color: var(--mg-muted);
  font-weight: 700;
}

/* ── Play page: 全宽播放器 + 下方信息 + 横向相关 ── */
.mg-watch__screen {
  position: relative;
  margin-bottom: 24px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  border: 2px solid var(--mg-gold);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.15);
}

.mg-watch__screen video,
#movie-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: #000;
}

.mg-watch__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  text-align: center;
  font-weight: 800;
  color: #fff;
  background: rgba(10, 10, 15, 0.88);
}

.mg-watch__info { margin-bottom: 32px; }

.mg-watch__title-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}

.mg-watch__thumb {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 2px solid rgba(245, 158, 11, 0.35);
}

.mg-watch__title-block h1 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--mg-gold);
}

.mg-watch__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mg-watch__tags span {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12);
  color: var(--mg-blue);
}

.mg-watch__tags span:nth-child(odd) {
  background: rgba(245, 158, 11, 0.15);
  color: var(--mg-gold);
}

.mg-watch__brief {
  margin: 0 0 16px;
  color: var(--mg-muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

.mg-watch__synopsis {
  padding: 20px 22px;
  border-radius: 8px;
  background: var(--mg-surface);
  border-left: 4px solid var(--mg-blue);
}

.mg-watch__synopsis h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--mg-gold);
}

.mg-watch__synopsis p {
  margin: 0;
  line-height: 1.75;
  color: var(--mg-text);
  font-size: 0.9rem;
}

.mg-watch__related { margin-top: 8px; }

.mg-related-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 160px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.mg-related-scroll .mg-rcard__link {
  grid-template-columns: 1fr;
  padding: 0;
  border: none;
  background: transparent;
}

.mg-related-scroll .mg-rcard__thumb { aspect-ratio: 2 / 3; }
.mg-related-scroll .mg-rcard__body { padding: 8px 2px 0; }

/* ── Footer: 双列暗底 ── */
.mg-foot {
  margin-top: 24px;
  background: var(--mg-surface);
  border-top: 2px solid var(--mg-gold);
}

.mg-foot__wrap {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  padding: 36px 20px 28px;
}

.mg-foot__brand strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--mg-gold);
  margin-bottom: 10px;
}

.mg-foot__brand p {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--mg-muted);
  line-height: 1.6;
}

.mg-foot__about { font-size: 0.82rem !important; }

.mg-foot__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mg-foot__col span {
  display: block;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--mg-text);
}

.mg-foot__col ul { list-style: none; margin: 0; padding: 0; }
.mg-foot__col li { margin-bottom: 8px; }
.mg-foot__col li a { font-size: 0.82rem; font-weight: 700; color: var(--mg-blue) !important; }
.mg-foot__col li a:hover { color: var(--mg-gold) !important; }

.mg-foot__bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--mg-muted);
  border-top: 1px solid rgba(245, 158, 11, 0.15);
}

/* ── Mobile ── */
@media (max-width: 1100px) {
  .mg-poster-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mg-channel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .mg-top__inner {
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
  }

  .mg-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px 14px;
    background: rgba(10, 10, 15, 0.98);
    border-bottom: 1px solid var(--mg-line);
  }

  .mg-nav.open { display: flex; }
  .mg-nav a { text-align: center; border-bottom: none; border-left: 3px solid transparent; }
  .mg-nav a[aria-current="page"] { border-left-color: var(--mg-gold); }

  .mg-top { position: relative; }
  .mg-top__inner { position: relative; }

  .mg-search { display: none; }
  .mg-hotlink { display: none; }
  .mg-burger { display: grid; place-items: center; }

  .mg-poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mg-poster-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mg-poster-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mg-cat-layout { grid-template-columns: 1fr; }
  .mg-cat-side { position: static; }

  .mg-foot__wrap { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .mg-main { padding: 16px 14px 48px; }
  .mg-hero { min-height: 260px; }
  .mg-hero__content { padding: 28px 20px; }
  .mg-channel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .mg-channel { padding: 12px 4px; }
  .mg-poster-grid,
  .mg-poster-grid--compact,
  .mg-poster-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mg-watch__title-row { grid-template-columns: 1fr; }
  .mg-watch__thumb { max-width: 120px; }
  .mg-foot__links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
