:root {
  --primary-50: #fdf8f3;
  --primary-100: #faeee1;
  --primary-200: #f4dac2;
  --primary-300: #ecbe98;
  --primary-600: #c8643e;
  --primary-700: #a74f35;
  --primary-800: #854132;
  --primary-900: #6c372b;
  --accent-400: #f08444;
  --accent-600: #dd4f16;
  --accent-700: #b73a14;
  --secondary-50: #f7f7f6;
  --secondary-100: #e4e4e2;
  --secondary-200: #c9c8c5;
  --secondary-400: #85847e;
  --secondary-500: #6d6c67;
  --secondary-600: #575651;
  --secondary-700: #474643;
  --secondary-800: #3c3b39;
  --secondary-900: #343332;
  --secondary-950: #1c1c1b;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.16), 0 4px 6px -4px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--secondary-50);
  color: var(--secondary-900);
  font-family: Georgia, Cambria, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--primary-50);
  background: linear-gradient(90deg, var(--primary-900), var(--primary-800), var(--primary-900));
  box-shadow: var(--shadow-lg);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark,
.footer-brand span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-950);
  background: var(--accent-400);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.brand-text strong {
  display: block;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.brand-text small {
  display: block;
  color: var(--primary-300);
  font-size: 0.75rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-weight: 600;
}

.main-nav a,
.nav-dropdown > button {
  border: 0;
  color: var(--primary-50);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.nav-dropdown > button:hover {
  color: var(--accent-400);
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  min-width: 190px;
  padding: 10px;
  border-radius: 14px;
  background: var(--white);
  color: var(--secondary-900);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--secondary-800);
}

.dropdown-menu a:hover {
  color: var(--primary-700);
  background: var(--primary-50);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-search {
  display: flex;
  align-items: center;
  min-width: 310px;
}

.header-search input,
.large-search input,
.filter-bar input {
  width: 100%;
  border: 1px solid rgba(236, 190, 152, 0.28);
  outline: none;
  color: var(--primary-50);
  background: rgba(108, 55, 43, 0.82);
}

.header-search input {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px 0 0 12px;
}

.header-search input::placeholder,
.large-search input::placeholder {
  color: var(--primary-300);
}

.header-search button,
.large-search button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 0 12px 12px 0;
  color: var(--white);
  background: var(--accent-600);
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-search button:hover,
.large-search button:hover {
  background: var(--accent-700);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: rgba(253, 248, 243, 0.12);
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: var(--secondary-950);
}

.hero-slide {
  position: relative;
  min-height: 600px;
  display: none;
  align-items: stretch;
}

.hero-slide.is-active {
  display: block;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 38%, rgba(240, 132, 68, 0.24), transparent 28%),
    linear-gradient(90deg, rgba(28, 28, 27, 0.92), rgba(52, 51, 50, 0.68) 46%, rgba(0, 0, 0, 0.25)),
    linear-gradient(0deg, rgba(28, 28, 27, 0.82), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  min-height: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 52px;
  align-items: center;
  padding: 74px 0;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.hero-kicker {
  margin: 0 0 12px;
  color: var(--accent-400);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.hero-copy p {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--gray-200, #e5e7eb);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  font-weight: 800;
  transition: 0.2s ease;
}

.btn-primary {
  color: var(--white);
  background: var(--primary-600);
  box-shadow: 0 16px 32px rgba(200, 100, 62, 0.3);
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-light {
  color: var(--primary-50);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn.wide {
  width: 100%;
}

.hero-poster {
  overflow: hidden;
  border-radius: 26px;
  background: var(--secondary-900);
  box-shadow: var(--shadow-xl);
  transform: rotate(1.5deg);
}

.hero-poster img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.hero-poster:hover img {
  transform: scale(1.04);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.48);
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

.hero-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 26px;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
}

.hero-dot.is-active {
  width: 30px;
  background: var(--accent-400);
}

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

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 36px;
  align-items: center;
}

.section h1,
.section h2,
.page-hero h1,
.detail-card h1 {
  margin: 0;
  line-height: 1.1;
  color: var(--secondary-900);
}

.section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section p {
  color: var(--secondary-600);
}

.large-search {
  display: flex;
  min-height: 58px;
  box-shadow: var(--shadow-lg);
}

.large-search input {
  height: 58px;
  padding: 0 20px;
  border-radius: 16px 0 0 16px;
}

.large-search button {
  height: 58px;
  padding: 0 26px;
  border-radius: 0 16px 16px 0;
  white-space: nowrap;
}

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

.section-head > a {
  color: var(--primary-700);
  font-weight: 800;
}

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

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 20px;
  color: var(--white);
  background: var(--secondary-900);
  box-shadow: var(--shadow-lg);
}

.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  opacity: 0.56;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-tile span,
.category-tile p {
  position: absolute;
  left: 20px;
  right: 20px;
  z-index: 2;
}

.category-tile span {
  bottom: 58px;
  font-size: 1.35rem;
  font-weight: 900;
}

.category-tile p {
  bottom: 18px;
  margin: 0;
  color: var(--primary-50);
  font-size: 0.92rem;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(28, 28, 27, 0.8), transparent 58%);
}

.category-tile:hover img {
  opacity: 0.72;
  transform: scale(1.06);
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4.05;
  background: var(--secondary-100);
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.36s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.055);
}

.card-badge,
.rank-badge {
  position: absolute;
  top: 14px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
}

.card-badge {
  right: 14px;
  background: var(--accent-600);
}

.rank-badge {
  left: 14px;
  background: rgba(0, 0, 0, 0.64);
}

.movie-card-body {
  padding: 18px;
}

.movie-meta {
  margin: 0 0 8px;
  color: var(--secondary-500);
  font-size: 0.82rem;
}

.movie-card h2 {
  margin: 0 0 10px;
  color: var(--secondary-900);
  font-size: 1.12rem;
  line-height: 1.25;
}

.movie-card h2 a:hover {
  color: var(--primary-700);
}

.movie-line {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--secondary-600);
  font-size: 0.94rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--secondary-700);
  background: var(--secondary-100);
  font-size: 0.76rem;
}

.hero-tags span {
  color: var(--primary-50);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.ranking-panel {
  position: sticky;
  top: 94px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--secondary-900), var(--secondary-950));
  color: var(--white);
  box-shadow: var(--shadow-xl);
}

.ranking-head h2 {
  margin: 0 0 20px;
  color: var(--primary-50);
}

.ranking-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.ranking-list a {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.ranking-list a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ranking-list span {
  grid-row: span 2;
  color: var(--accent-400);
  font-weight: 900;
}

.ranking-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list small {
  color: var(--secondary-200);
}

.page-hero {
  color: var(--white);
  background: linear-gradient(90deg, var(--primary-900), var(--primary-800), var(--secondary-900));
  padding: 68px max(16px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.page-hero h1 {
  color: var(--primary-50);
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.page-hero p {
  max-width: 780px;
  margin: 16px 0 0;
  color: var(--primary-200);
  font-size: 1.1rem;
}

.compact-hero {
  padding-top: 58px;
  padding-bottom: 58px;
}

.filter-bar {
  margin-bottom: 28px;
}

.filter-bar input {
  height: 52px;
  border-radius: 16px;
  padding: 0 18px;
  color: var(--secondary-900);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.filter-bar-large input {
  height: 60px;
  font-size: 1.08rem;
}

.empty-state {
  display: none;
  text-align: center;
  padding: 40px 0;
  color: var(--secondary-500);
}

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

.detail-wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--secondary-500);
  font-size: 0.96rem;
}

.breadcrumb a {
  color: var(--primary-700);
  font-weight: 700;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000000;
  box-shadow: var(--shadow-xl);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  color: var(--white);
  background: #000000;
  cursor: pointer;
}

.player-cover.is-hidden {
  display: none;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.66;
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--accent-600);
  font-size: 2rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.38);
}

.detail-card,
.side-card {
  margin-top: 24px;
  padding: 28px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-tags a,
.detail-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--white);
  background: var(--accent-600);
  font-size: 0.86rem;
  font-weight: 800;
}

.detail-tags span {
  background: var(--primary-600);
}

.detail-card h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--secondary-200);
  color: var(--secondary-600);
}

.detail-one-line {
  margin: 0 0 24px;
  color: var(--secondary-800);
  font-size: 1.2rem;
  font-weight: 700;
}

.detail-card h2,
.side-card h2 {
  margin: 24px 0 10px;
  color: var(--secondary-900);
  font-size: 1.35rem;
}

.detail-card p {
  color: var(--secondary-700);
}

.review-box {
  margin-top: 24px;
  padding: 22px;
  border-left: 4px solid var(--primary-600);
  border-radius: 16px;
  background: var(--primary-50);
}

.detail-tag-row {
  margin-top: 22px;
}

.detail-side {
  position: sticky;
  top: 94px;
}

.side-poster {
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: var(--secondary-100);
  box-shadow: var(--shadow-lg);
}

.side-poster img {
  width: 100%;
  aspect-ratio: 3 / 4.05;
  object-fit: cover;
}

.related-list {
  display: grid;
  gap: 16px;
}

.movie-card-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border-radius: 14px;
  box-shadow: none;
  background: transparent;
}

.movie-card-list:hover {
  transform: none;
  box-shadow: none;
}

.movie-card-list .poster-link {
  border-radius: 12px;
  aspect-ratio: 1 / 1;
}

.movie-card-list .card-badge,
.movie-card-list .rank-badge,
.movie-card-list .tag-row {
  display: none;
}

.movie-card-list .movie-card-body {
  padding: 0 0 0 12px;
}

.movie-card-list h2 {
  font-size: 0.98rem;
}

.movie-card-list .movie-line {
  min-height: 0;
  font-size: 0.82rem;
  -webkit-line-clamp: 2;
}

.site-footer {
  margin-top: 64px;
  color: var(--secondary-200);
  background: linear-gradient(180deg, var(--secondary-900), var(--secondary-950));
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 36px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--primary-50);
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--primary-50);
  font-size: 1rem;
}

.site-footer p,
.site-footer a {
  color: var(--secondary-400);
}

.site-footer a {
  display: block;
  margin: 8px 0;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent-400);
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid var(--secondary-800);
  color: var(--secondary-500);
  font-size: 0.92rem;
}

@media (max-width: 1120px) {
  .header-search {
    display: none;
  }

  .main-nav {
    gap: 18px;
  }

  .hero-content,
  .home-layout,
  .detail-grid,
  .section-intro {
    grid-template-columns: 1fr;
  }

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

  .hero-poster {
    max-width: 420px;
  }

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

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

@media (max-width: 780px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 16px 18px;
    background: var(--primary-800);
    box-shadow: var(--shadow-lg);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a,
  .nav-dropdown > button {
    padding: 12px 0;
    text-align: left;
  }

  .nav-dropdown {
    display: none;
  }

  .brand-text small {
    display: none;
  }

  .hero-slide,
  .hero-content {
    min-height: 680px;
  }

  .hero-content {
    padding: 52px 0 96px;
    gap: 26px;
  }

  .hero-poster img {
    height: 340px;
  }

  .hero-arrow {
    top: auto;
    bottom: 22px;
  }

  .hero-prev {
    left: 16px;
  }

  .hero-next {
    right: 16px;
  }

  .section,
  .detail-wrap {
    width: min(100% - 24px, 1280px);
  }

  .section-head,
  .page-hero {
    display: block;
  }

  .page-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-hero .btn {
    margin-top: 22px;
  }

  .movie-grid,
  .category-grid,
  .category-grid-large,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .large-search {
    display: block;
  }

  .large-search input,
  .large-search button {
    width: 100%;
    border-radius: 16px;
  }

  .large-search button {
    margin-top: 10px;
  }

  .detail-card,
  .side-card {
    padding: 20px;
  }
}

@media (min-width: 781px) and (max-width: 1120px) {
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
