:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #1e293b;
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --muted-deep: #94a3b8;
  --red: #dc2626;
  --red-soft: #ef4444;
  --orange: #f97316;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(220, 38, 38, 0.18), transparent 28rem),
    linear-gradient(180deg, #0f172a 0%, #172033 52%, #0f172a 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.site-nav {
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.site-logo__mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.35);
}

.site-logo__text {
  font-size: 1.45rem;
  background: linear-gradient(90deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav__link {
  position: relative;
  color: #d1d5db;
  font-size: 0.96rem;
  font-weight: 700;
  transition: color 0.25s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, var(--red), var(--orange));
  transition: transform 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: #f87171;
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
  transform: scaleX(1);
}

.site-nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.site-nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
}

.hero {
  position: relative;
  height: min(680px, calc(100vh - 72px));
  min-height: 560px;
  overflow: hidden;
  background: #111827;
}

.hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: scale(1.03);
  background-size: cover;
  background-position: center;
  transition: opacity 0.8s ease, transform 1.1s ease;
  pointer-events: none;
}

.hero__slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero__shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(0deg, #0f172a, transparent);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  max-width: 760px;
  padding-top: 48px;
}

.hero__eyebrow,
.section-heading p,
.inner-hero p {
  margin: 0 0 12px;
  color: #fecaca;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 900;
}

.hero h1 {
  max-width: 840px;
  margin: 0 0 16px;
  font-size: clamp(2.65rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.hero h2 {
  margin: 0 0 18px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  color: #fed7aa;
}

.hero p:not(.hero__eyebrow) {
  max-width: 720px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.9;
}

.hero__tags,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero__tags span,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero__actions,
.inner-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: white;
  box-shadow: 0 18px 38px rgba(220, 38, 38, 0.35);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero__dots {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero__dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero__dot.is-active {
  width: 34px;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

.page-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 70px 0;
}

.page-section--dark {
  width: 100%;
  padding-left: max(16px, calc((100% - 1180px) / 2));
  padding-right: max(16px, calc((100% - 1180px) / 2));
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.74), rgba(15, 23, 42, 0.88));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-section--search {
  padding-top: 56px;
}

.page-section--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading--center {
  display: block;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading h2,
.inner-hero h1,
.detail-content h2,
.detail-side h2,
.side-panel h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.section-heading span,
.inner-hero span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.section-heading a {
  color: #f97316;
  font-weight: 900;
}

.search-panel {
  width: min(720px, 100%);
  margin: 0 auto 28px;
}

.search-panel__label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.search-panel__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.search-panel__bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  font: inherit;
  font-weight: 700;
}

.search-panel__bar input::placeholder {
  color: #94a3b8;
}

.movie-grid {
  display: grid;
  gap: 22px;
}

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

.movie-grid--category {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
}

.movie-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #7f1d1d);
}

.movie-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.movie-card:hover .movie-card__cover img {
  transform: scale(1.08);
}

.movie-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent 58%);
}

.movie-card__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.82);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(220, 38, 38, 0.88);
  color: white;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .movie-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.movie-card__badge {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.88);
  color: white;
  font-size: 0.74rem;
  font-weight: 900;
}

.movie-card__body {
  padding: 18px;
}

.movie-card h2 {
  margin: 0 0 8px;
  font-size: 1.16rem;
  line-height: 1.35;
}

.movie-card h2 a:hover {
  color: #f87171;
}

.movie-card__meta {
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 0.86rem;
}

.movie-card__desc {
  min-height: 3.2em;
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card--compact .movie-card__desc {
  min-height: auto;
}

.category-grid,
.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-tile,
.category-card {
  position: relative;
  min-height: 190px;
  padding: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.category-tile:hover,
.category-card:hover {
  transform: translateY(-6px) scale(1.01);
  filter: saturate(1.12);
}

.category-tile strong,
.category-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 10px;
  font-size: 1.65rem;
  line-height: 1;
}

.category-tile span,
.category-card em,
.category-card span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.86);
  font-style: normal;
  line-height: 1.65;
}

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

.ranking-list,
.list-stack {
  display: grid;
  gap: 14px;
}

.rank-item {
  display: grid;
  grid-template-columns: 46px 82px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 15px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(30, 41, 59, 0.94);
}

.rank-item__num {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red), var(--orange));
  font-weight: 950;
}

.rank-item img {
  width: 82px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-item strong {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item small {
  display: block;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item__arrow {
  color: #f97316;
  font-size: 1.8rem;
}

.side-panel,
.detail-side {
  position: sticky;
  top: 96px;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.side-panel .movie-card,
.side-card-list .movie-card {
  margin-top: 16px;
}

.inner-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0 34px;
}

.inner-hero--category {
  padding-bottom: 20px;
}

.inner-hero span {
  max-width: 760px;
}

.section-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.section-toolbar .search-panel {
  margin: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.filter-pill {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  cursor: pointer;
  font-weight: 800;
}

.filter-pill.is-active,
.filter-pill:hover {
  color: white;
  background: linear-gradient(135deg, var(--red), var(--orange));
  border-color: transparent;
}

.empty-state {
  display: none;
  margin-top: 28px;
  padding: 36px;
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.72);
  text-align: center;
  color: #cbd5e1;
  border: 1px solid var(--line);
}

.empty-state.is-visible {
  display: block;
}

.is-hidden {
  display: none !important;
}

.movie-detail-hero {
  position: relative;
  min-height: 560px;
  padding: 38px 0 60px;
  background-size: cover;
  background-position: center;
}

.breadcrumb {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.breadcrumb a:hover {
  color: #fca5a5;
}

.movie-detail-hero__content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.movie-detail-hero__content > img {
  width: 250px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.movie-detail-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.movie-detail-hero p:not(.hero__eyebrow) {
  max-width: 820px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  line-height: 1.9;
}

.page-section--detail {
  padding-top: 50px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #020617;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.player-box video,
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-box video {
  object-fit: contain;
  background: #000;
}

.player-cover {
  z-index: 2;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.player-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.player-start {
  width: 94px;
  height: 94px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 24px 64px rgba(220, 38, 38, 0.45);
  cursor: pointer;
  transition: transform 0.22s ease;
}

.player-start:hover {
  transform: scale(1.06);
}

.player-start span {
  padding-left: 5px;
  font-size: 2.6rem;
  line-height: 1;
}

.detail-content {
  margin-top: 26px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid var(--line);
}

.detail-content h2 {
  margin-bottom: 20px;
}

.detail-content p {
  margin: 0 0 18px;
  color: #d1d5db;
  line-height: 2;
  font-size: 1.02rem;
}

.movie-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.movie-info-list div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
}

.movie-info-list dt {
  color: #94a3b8;
  font-size: 0.82rem;
}

.movie-info-list dd {
  margin: 6px 0 0;
  font-weight: 900;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
}

.site-footer__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 36px;
}

.site-logo--footer {
  margin-bottom: 16px;
}

.site-footer p {
  max-width: 380px;
  margin: 0;
  color: #94a3b8;
  line-height: 1.8;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 1rem;
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: #f87171;
}

.site-footer__copy {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: #64748b;
  border-top: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .movie-grid--home,
  .movie-grid--category,
  .category-grid,
  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-section--split,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .detail-side {
    position: static;
  }

  .section-toolbar {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .site-nav__toggle {
    display: block;
  }

  .site-nav__links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    padding: 18px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .site-nav__links.is-open {
    display: grid;
    gap: 14px;
  }

  .hero {
    min-height: 660px;
    height: auto;
  }

  .hero__content {
    padding-top: 78px;
  }

  .hero__actions,
  .inner-hero__actions {
    display: grid;
  }

  .movie-grid--home,
  .movie-grid--category,
  .category-grid,
  .category-card-grid,
  .rank-grid,
  .site-footer__inner,
  .movie-info-list {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 36px 70px minmax(0, 1fr);
  }

  .rank-item__arrow {
    display: none;
  }

  .movie-detail-hero__content {
    grid-template-columns: 1fr;
  }

  .movie-detail-hero__content > img {
    width: min(220px, 70vw);
  }

  .player-start {
    width: 76px;
    height: 76px;
  }
}
