:root {
  color-scheme: dark;
  --bg: #0f1110;
  --panel: #181a18;
  --panel-strong: #24211d;
  --line: rgba(255, 255, 255, 0.1);
  --text: #fffaf2;
  --muted: rgba(255, 250, 242, 0.58);
  --accent: #ff861f;
  --accent-ink: #fff8ef;
  --rose: #f14c35;
  --danger: #ffb06a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --deep-shadow: 0 32px 110px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 70% 26%, rgba(255, 156, 47, 0.12), transparent 19%),
    linear-gradient(90deg, rgba(15, 17, 16, 0.94), transparent 34%, transparent 65%, rgba(15, 17, 16, 0.94)),
    linear-gradient(180deg, rgba(15, 17, 16, 0.92), transparent 13%, transparent 58%, #0f1110 96%);
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 3;
  width: min(1920px, 100%);
  margin: 0 auto;
  padding: 0;
}

.home-stage {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.watch-stage {
  min-height: 100vh;
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at 74% 12%, rgba(255, 134, 31, 0.12), transparent 26%),
    linear-gradient(180deg, #131210 0%, #0a0b0a 100%);
}

body.is-watching .home-stage {
  display: none;
}

body.is-watching .watch-stage {
  display: flex;
}

.topbar,
.topbar-actions,
.home-nav,
.brand-lockup,
.hero-actions,
.section-heading,
.player-layout,
.episode-meta,
.series-card,
.purchase-strip,
.episodes-header {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1500px, 100%);
  margin: 0 auto;
}

.topbar-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-nav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 20;
  width: min(1320px, calc(100% - 64px));
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 0 12px;
}

.brand-lockup {
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 900;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #ff701f, #ff9a1f 34%, #29d0a2 35%, #5ce1d0 64%, #ff701f 65%);
  box-shadow: 0 0 18px rgba(255, 126, 31, 0.34);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  border-left: 8px solid #fff8e8;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.home-nav nav {
  display: flex;
  gap: 50px;
  margin-right: auto;
}

.home-nav a {
  color: rgba(255, 255, 255, 0.38);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.home-nav a:hover,
.home-nav a.is-active {
  color: var(--text);
}

.account-button {
  min-height: 38px;
  max-width: 180px;
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(16px);
}

.topbar-actions .account-button {
  border-radius: 8px;
}

.eyebrow,
.episode-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.95;
}

.hero-banner {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 max(32px, calc((100vw - 1320px) / 2));
  background: #0f1110;
}

.hero-banner::before,
.hero-banner::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-banner::before {
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 61% 30%, transparent 0 28%, rgba(15, 17, 16, 0.2) 39%, rgba(15, 17, 16, 0.86) 72%),
    linear-gradient(90deg, rgba(15, 17, 16, 0.96) 0%, rgba(15, 17, 16, 0.54) 26%, rgba(15, 17, 16, 0.05) 46%, rgba(15, 17, 16, 0.16) 72%, rgba(15, 17, 16, 0.98) 100%),
    linear-gradient(180deg, rgba(15, 17, 16, 0.78) 0%, transparent 16%, transparent 62%, rgba(15, 17, 16, 0.96) 91%, #0f1110 100%);
}

.hero-banner::after {
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 49% 29%, rgba(255, 172, 74, 0.32), transparent 21%),
    radial-gradient(circle at 58% 22%, rgba(255, 255, 255, 0.16), transparent 12%);
  background-size: 120% 120%;
  mix-blend-mode: screen;
  animation: light-breathe 12s ease-in-out infinite alternate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./assets/hero-couple.jpg");
  background-position: center 28%;
  background-size: cover;
  filter: saturate(1.12) contrast(1.05);
  transform: scale(1.02);
  transition: background-image 240ms ease, filter 240ms ease;
  animation: poster-drift 18s ease-in-out infinite alternate;
  will-change: transform, background-position;
}

.hero-motion {
  position: absolute;
  inset: -18%;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 14%, rgba(255, 146, 46, 0.1) 34%, transparent 52%),
    radial-gradient(ellipse at 42% 46%, rgba(255, 196, 118, 0.13), transparent 30%),
    radial-gradient(ellipse at 62% 35%, rgba(255, 255, 255, 0.08), transparent 22%);
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.72;
  transform: translate3d(-4%, 0, 0) rotate(-2deg);
  animation: light-river 16s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.hero-copy {
  position: absolute;
  left: max(32px, calc((100vw - 1320px) / 2));
  bottom: 22vh;
  z-index: 4;
  width: min(620px, 46vw);
  max-width: 620px;
}

.hero-copy h1 {
  margin-bottom: 28px;
  color: #fff;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "Songti SC", serif;
  font-size: clamp(42px, 5vw, 86px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.04;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.58);
  word-break: keep-all;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-tags span {
  padding: 9px 15px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  backdrop-filter: blur(12px);
}

.hero-copy p {
  max-width: 640px;
  margin-bottom: 38px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.52);
  font-size: 15px;
  line-height: 1.75;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.play-button {
  display: flex;
  min-width: 206px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  font-size: 20px;
}

.play-button span {
  width: 0;
  height: 0;
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.featured-strip {
  position: absolute;
  right: max(32px, calc((100vw - 1320px) / 2));
  bottom: 22vh;
  z-index: 4;
  display: flex;
  gap: 20px;
  width: min(590px, 42vw);
  align-items: flex-end;
}

.featured-card {
  width: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.featured-card:hover {
  transform: translateY(-8px);
}

.mini-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 0.72;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--cover);
  background-position: center;
  background-size: cover;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
}

.has-image-cover .mini-cover::after,
.has-image-cover .drama-cover::after,
.poster.has-image-cover::after {
  display: none;
}

.mini-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 58%);
}

.mini-cover::after {
  content: "";
  position: absolute;
  left: 34%;
  top: 22%;
  width: 31%;
  height: 44%;
  border-radius: 999px 999px 42% 42%;
  background: linear-gradient(#ffe0c2, rgba(78, 27, 24, 0.92));
}

.featured-card:first-child .mini-cover {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
}

.featured-card strong {
  display: block;
  margin-top: -36px;
  padding: 0 8px 8px;
  position: relative;
  z-index: 1;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.34);
  font-size: 12px;
}

.scroll-hint i,
.scroll-hint i::after {
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  transform: rotate(45deg);
}

.scroll-hint i::after {
  content: "";
  display: block;
  margin: 5px 0 0 5px;
}

@keyframes poster-drift {
  0% {
    transform: scale(1.02) translate3d(-0.6%, -0.4%, 0);
    background-position: center 28%;
  }

  100% {
    transform: scale(1.07) translate3d(0.8%, 0.4%, 0);
    background-position: 52% 30%;
  }
}

@keyframes light-river {
  0% {
    opacity: 0.42;
    transform: translate3d(-7%, -2%, 0) rotate(-3deg);
  }

  48% {
    opacity: 0.82;
  }

  100% {
    opacity: 0.58;
    transform: translate3d(7%, 3%, 0) rotate(3deg);
  }
}

@keyframes light-breathe {
  0% {
    opacity: 0.64;
    background-position: 46% 44%;
  }

  100% {
    opacity: 0.95;
    background-position: 58% 36%;
  }
}

.content-rail {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.section-heading {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
}

.section-heading > span {
  color: var(--muted);
  font-size: 14px;
}

.drama-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.drama-card {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease;
}

.drama-card:hover {
  transform: translateY(-6px);
}

.drama-cover {
  position: relative;
  aspect-ratio: 3 / 4.2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cover);
  background-position: center;
  background-size: cover;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.26);
}

.drama-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84), transparent 54%);
}

.drama-cover::after {
  content: "";
  position: absolute;
  left: 34%;
  top: 24%;
  width: 30%;
  height: 42%;
  border-radius: 999px 999px 42% 42%;
  background: linear-gradient(#ffe0c2, rgba(78, 27, 24, 0.9));
}

.drama-badge,
.drama-count {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 900;
}

.drama-badge {
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  color: var(--accent);
}

.drama-count {
  right: 9px;
  bottom: 9px;
  padding: 5px 8px;
  color: var(--text);
}

.drama-card h3 {
  margin: 10px 0 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.player-layout {
  width: min(1500px, 100%);
  margin: 0 auto;
  flex: 1;
  gap: 18px;
  align-items: stretch;
}

.player-panel,
.playlist-panel {
  border: 1px solid var(--line);
  background: rgba(18, 18, 16, 0.84);
  box-shadow: var(--deep-shadow);
  backdrop-filter: blur(18px);
}

.player-panel {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
}

.video-frame {
  position: relative;
  background: #050405;
  aspect-ratio: 16 / 9;
  min-height: min(64vh, 760px);
}

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(5, 6, 4, 0.82);
  backdrop-filter: blur(10px);
}

.lock-overlay.is-hidden {
  display: none;
}

.lock-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 30px;
  font-weight: 900;
}

.lock-overlay h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
}

.lock-overlay p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

.episode-meta {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 6px;
}

.episode-meta h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
}

.episode-summary {
  margin: 0;
  padding: 0 28px 28px;
  color: var(--muted);
  line-height: 1.75;
}

.playlist-panel {
  width: min(420px, 31vw);
  min-width: 340px;
  border-radius: 10px;
  padding: 18px;
  overflow: hidden;
}

.series-card {
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.series-card h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.series-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.poster {
  flex: 0 0 92px;
  height: 132px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end center;
  padding-bottom: 12px;
  border-radius: 6px;
  background: var(--cover),
    linear-gradient(160deg, rgba(255, 207, 106, 0.92), transparent 48%),
    linear-gradient(20deg, #47202d, #0c080b);
  background-position: center;
  background-size: cover;
  color: #fff4dc;
  font-size: 12px;
  font-weight: 900;
}

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.76), transparent 58%);
}

.poster span {
  position: relative;
  z-index: 1;
}

.purchase-strip {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.purchase-strip span,
.episodes-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.purchase-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.episodes-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.episodes-header h2 {
  margin: 0;
  font-size: 18px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.episode-button {
  position: relative;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.episode-button:hover,
.episode-button.is-active {
  border-color: var(--accent);
  background: rgba(255, 134, 31, 0.14);
  color: #fff4dc;
}

.episode-button.is-locked::after {
  content: "锁";
  position: absolute;
  top: 5px;
  right: 7px;
  color: var(--danger);
  font-size: 11px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-ink);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button.compact {
  min-width: 76px;
}

.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 207, 106, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.is-paid {
  background: rgba(255, 179, 107, 0.13);
  color: var(--danger);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 6, 5, 0.68);
  backdrop-filter: blur(14px);
}

.auth-modal.is-hidden,
.auth-form.is-hidden,
.profile-panel.is-hidden,
#displayNameField.is-hidden {
  display: none;
}

.auth-panel {
  position: relative;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 134, 31, 0.12), transparent 36%),
    rgba(18, 18, 16, 0.96);
  box-shadow: var(--deep-shadow);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-panel h2 {
  margin: 0 36px 8px 0;
  font-size: 28px;
}

.auth-copy {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.auth-tabs button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.auth-tabs button:disabled {
  cursor: default;
  opacity: 0.72;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.auth-field input:focus {
  border-color: rgba(255, 134, 31, 0.76);
  box-shadow: 0 0 0 3px rgba(255, 134, 31, 0.14);
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
}

.profile-panel {
  display: grid;
  gap: 16px;
}

.profile-panel > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-avatar {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 20px;
  font-weight: 900;
}

.profile-panel h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .watch-stage,
  .home-stage {
    min-height: auto;
  }

  .topbar,
  .home-nav,
  .section-heading {
    align-items: flex-start;
  }

  .home-nav {
    position: absolute;
    width: calc(100% - 32px);
    flex-wrap: wrap;
    gap: 22px;
    padding-top: 18px;
  }

  .home-nav nav {
    margin-right: 0;
  }

  .hero-banner {
    min-height: 900px;
    padding: 0 16px;
  }

  .hero-image {
    background-position: 58% 18%;
  }

  .hero-copy {
    left: 24px;
    right: 24px;
    bottom: 285px;
    width: auto;
  }

  .hero-copy h1 {
    font-size: 58px;
  }

  .hero-copy p {
    white-space: normal;
  }

  .featured-strip {
    left: 24px;
    right: auto;
    bottom: 116px;
    width: calc(100% - 48px);
    overflow-x: auto;
    padding-bottom: 8px;
  }

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

  .player-layout {
    flex-direction: column;
  }

  .playlist-panel {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .topbar,
  .topbar-actions,
  .home-nav,
  .hero-actions,
  .section-heading,
  .episode-meta {
    flex-direction: column;
  }

  .home-nav nav {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }

  .home-nav .account-button {
    width: 100%;
    max-width: none;
  }

  .hero-banner {
    min-height: 820px;
  }

  .hero-banner::before {
    background:
      linear-gradient(90deg, rgba(15, 17, 16, 0.9), rgba(15, 17, 16, 0.18) 56%, rgba(15, 17, 16, 0.82)),
      linear-gradient(180deg, rgba(15, 17, 16, 0.82) 0%, transparent 20%, transparent 52%, rgba(15, 17, 16, 0.98) 84%, #0f1110 100%);
  }

  .hero-image {
    background-position: 61% 12%;
    background-size: auto 72%;
    background-repeat: no-repeat;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-copy {
    bottom: 260px;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    padding: 7px 10px;
    font-size: 12px;
  }

  .play-button,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .featured-strip {
    bottom: 96px;
  }

  .featured-card {
    flex: 0 0 86px;
  }

  .scroll-hint {
    bottom: 34px;
  }

  .content-rail {
    width: calc(100% - 32px);
    padding-top: 30px;
  }

  .drama-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .series-card {
    align-items: flex-start;
  }

  .poster {
    flex-basis: 76px;
    height: 104px;
  }

  .auth-modal {
    padding: 14px;
  }

  .auth-panel {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image,
  .hero-motion,
  .hero-banner::after,
  .featured-card,
  .drama-card,
  .primary-button,
  .ghost-button,
  .account-button {
    animation: none;
    transition: none;
  }
}
