:root {
  --sand-50: #fdfaf7;
  --sand-100: #f9f3ed;
  --sand-200: #f2e6d9;
  --desert-50: #fef9f3;
  --desert-100: #fdf2e5;
  --desert-400: #f2ad6b;
  --desert-500: #e98f3e;
  --desert-600: #dd6f1f;
  --desert-700: #b75617;
  --earth-100: #ede9e4;
  --earth-300: #c2b4a3;
  --earth-400: #a89380;
  --earth-500: #8f7862;
  --earth-600: #786351;
  --earth-700: #635144;
  --earth-800: #53453a;
  --earth-900: #473c33;
  --white: #ffffff;
  --shadow-md: 0 4px 16px rgba(71, 60, 51, 0.08);
  --shadow-lg: 0 14px 35px rgba(71, 60, 51, 0.14);
  --shadow-xl: 0 24px 70px rgba(71, 60, 51, 0.22);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--earth-900);
  background: var(--sand-50);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--earth-900);
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--white);
  background: linear-gradient(135deg, var(--desert-600), var(--desert-400));
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(221, 111, 31, 0.28);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link,
.mobile-link {
  color: var(--earth-700);
  font-weight: 700;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--desert-600);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--sand-100);
  color: var(--earth-700);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 4px;
}

.mobile-nav {
  display: none;
  padding: 10px 16px 18px;
  border-top: 1px solid var(--sand-200);
  background: var(--white);
}

.mobile-nav.open {
  display: grid;
  gap: 8px;
}

.mobile-link {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sand-50);
}

.hero {
  position: relative;
  height: 80vh;
  min-height: 620px;
  overflow: hidden;
  background: var(--earth-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide > img,
.detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-gradient,
.detail-hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.08)),
    linear-gradient(0deg, rgba(71, 60, 51, 0.9), rgba(71, 60, 51, 0.12));
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  color: var(--white);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--desert-700);
  background: var(--desert-100);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow,
.detail-hero .eyebrow {
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.hero h1,
.detail-hero h1,
.page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero p,
.detail-hero p,
.page-hero p {
  max-width: 760px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(17px, 2vw, 22px);
}

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.tag-row span {
  color: var(--earth-700);
  background: var(--sand-100);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

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

.btn.primary {
  color: var(--white);
  background: var(--desert-600);
  box-shadow: 0 12px 30px rgba(221, 111, 31, 0.32);
}

.btn.primary:hover {
  background: var(--desert-700);
}

.btn.glass {
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.btn.ghost {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.hero-card {
  width: min(330px, 34vw);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
}

.hero-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-card div {
  padding: 18px;
}

.hero-card strong,
.hero-card span {
  display: block;
}

.hero-card strong {
  font-size: 22px;
  margin-bottom: 6px;
}

.hero-card span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
}

.hero-arrow,
.hero-dot {
  border: 0;
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
}

.hero-dot.active {
  width: 30px;
  border-radius: 999px;
  background: var(--desert-400);
}

.quick-search,
.filter-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--sand-200);
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.quick-search h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.quick-search p {
  margin: 0;
  color: var(--earth-600);
}

.search-panel,
.filter-box {
  display: flex;
}

.search-panel input,
.filter-box input,
.filter-box select {
  min-height: 46px;
  border: 1px solid var(--sand-200);
  border-radius: 999px;
  background: var(--sand-50);
  color: var(--earth-900);
  outline: none;
}

.search-panel input {
  width: min(430px, 50vw);
  padding: 0 18px;
}

.filter-box {
  margin-top: 0;
  margin-bottom: 10px;
}

.filter-box input,
.filter-box select {
  padding: 0 16px;
}

.filter-box input {
  flex: 1;
}

.filter-box select {
  min-width: 180px;
}

.page-section {
  padding: 58px 0;
}

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

.section-heading span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--desert-600);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  color: var(--earth-900);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.section-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--earth-600);
}

.section-more,
.text-link {
  display: inline-flex;
  color: var(--desert-600);
  font-weight: 800;
}

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

.category-tile,
.category-card,
.content-card,
.info-card,
.player-card,
.ranking-panel {
  border: 1px solid var(--sand-200);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 22px;
  border-radius: 24px;
  color: var(--white);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover,
.movie-card:hover,
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.58);
  transition: transform 0.45s ease;
}

.category-tile:hover img {
  transform: scale(1.08);
}

.category-tile span,
.category-tile p {
  position: relative;
  z-index: 1;
}

.category-tile span {
  display: block;
  margin-top: 92px;
  font-size: 24px;
  font-weight: 900;
}

.category-tile p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

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

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

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

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--sand-200);
}

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

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

.card-ribbon,
.rank-badge {
  position: absolute;
  z-index: 1;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.card-ribbon {
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
}

.rank-badge {
  left: 12px;
  bottom: 12px;
}

.rank-badge b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--desert-600);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.card-body {
  padding: 18px;
}

.card-title {
  display: block;
  margin-bottom: 8px;
  color: var(--earth-900);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.28;
}

.card-title:hover {
  color: var(--desert-600);
}

.card-body p {
  display: -webkit-box;
  min-height: 46px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--earth-600);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  color: var(--earth-500);
  font-size: 12px;
  font-weight: 700;
}

.movie-card.large .poster-link {
  aspect-ratio: 16 / 9;
}

.movie-card.horizontal {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 145px;
}

.movie-card.horizontal .poster-link {
  aspect-ratio: auto;
  height: 100%;
}

.movie-card.horizontal .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.ranking-panel {
  position: sticky;
  top: 88px;
  padding: 24px;
  border-radius: 26px;
}

.rank-list,
.rank-page-list {
  display: grid;
  gap: 14px;
}

.rank-list .movie-card.horizontal {
  grid-template-columns: 112px 1fr;
}

.rank-list .tag-row {
  display: none;
}

.rank-list .card-body p {
  min-height: auto;
  margin-bottom: 8px;
}

.subpage {
  min-height: 70vh;
}

.page-hero {
  margin-top: 34px;
  padding: 54px;
  border-radius: 32px;
  color: var(--earth-900);
  background:
    radial-gradient(circle at 82% 0%, rgba(233, 143, 62, 0.22), transparent 36%),
    linear-gradient(135deg, var(--desert-50), var(--sand-100));
  box-shadow: var(--shadow-md);
}

.page-hero p {
  color: var(--earth-600);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--earth-600);
  font-weight: 700;
}

.crumbs a {
  color: var(--desert-600);
}

.crumbs.light {
  color: rgba(255, 255, 255, 0.82);
}

.crumbs.light a {
  color: var(--desert-400);
}

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

.category-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  padding: 18px;
  border-radius: 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  overflow: hidden;
  border-radius: 18px;
}

.category-covers img {
  width: 100%;
  height: 88px;
  object-fit: cover;
}

.category-card h2 {
  margin: 4px 0 10px;
  font-size: 26px;
}

.category-card p {
  margin: 0 0 14px;
  color: var(--earth-600);
}

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

.empty-state {
  display: none;
  padding: 28px;
  border-radius: 20px;
  text-align: center;
  color: var(--earth-600);
  background: var(--white);
}

.empty-state.show {
  display: block;
}

.detail-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  color: var(--white);
  background: var(--earth-900);
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  padding: 90px 0 80px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  margin-top: -70px;
  position: relative;
  z-index: 3;
}

.main-detail,
.detail-sidebar {
  display: grid;
  gap: 24px;
}

.player-card,
.content-card,
.info-card {
  overflow: hidden;
  border-radius: 26px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
}

.play-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;
  border: 0;
  color: var(--white);
  text-align: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.24));
  cursor: pointer;
}

.play-cover strong {
  max-width: 720px;
  font-size: clamp(20px, 4vw, 34px);
}

.play-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding-left: 5px;
  border-radius: 50%;
  color: var(--desert-600);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  font-size: 30px;
}

.player-shell.is-playing .play-cover {
  display: none;
}

.content-card,
.info-card {
  padding: 26px;
}

.content-card h2,
.info-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.content-card p {
  margin: 0;
  color: var(--earth-700);
  font-size: 17px;
  line-height: 1.9;
}

.info-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px 14px;
  margin: 0;
}

.info-card dt {
  color: var(--earth-500);
  font-weight: 800;
}

.info-card dd {
  margin: 0;
  color: var(--earth-800);
  font-weight: 700;
}

.info-card a {
  color: var(--desert-600);
}

.site-footer {
  margin-top: 40px;
  color: var(--earth-100);
  background: var(--earth-900);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  padding: 48px 0;
}

.footer-brand {
  margin-bottom: 14px;
  color: var(--white);
}

.site-footer p {
  max-width: 460px;
  color: var(--earth-300);
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 20px;
}

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

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

.footer-links a {
  color: var(--earth-300);
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: var(--desert-400);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(16px, calc((100% - 1180px) / 2));
  border-top: 1px solid rgba(237, 233, 228, 0.16);
  color: var(--earth-400);
  font-size: 14px;
}

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

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

  .ranking-panel {
    position: static;
  }

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

@media (max-width: 820px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

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

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 0 110px;
  }

  .hero-card {
    width: 100%;
  }

  .quick-search,
  .filter-box,
  .search-panel,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .search-panel input {
    width: 100%;
  }

  .category-grid,
  .movie-grid,
  .compact-grid,
  .related-grid,
  .category-movie-grid,
  .category-list,
  .footer-grid,
  .detail-sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .category-card {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 36px 24px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .brand {
    font-size: 20px;
  }

  .hero h1,
  .detail-hero h1,
  .page-hero h1 {
    font-size: 38px;
  }

  .hero-actions,
  .btn {
    width: 100%;
  }

  .category-grid,
  .movie-grid,
  .compact-grid,
  .related-grid,
  .category-movie-grid,
  .category-list,
  .footer-grid,
  .detail-sidebar {
    grid-template-columns: 1fr;
  }

  .movie-card.horizontal {
    grid-template-columns: 120px 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
