:root {
  --bg: #fff7ed;
  --surface: #ffffff;
  --surface-soft: #fffbeb;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: rgba(120, 53, 15, 0.14);
  --brand: #d97706;
  --brand-dark: #92400e;
  --brand-soft: #fef3c7;
  --shadow: 0 24px 60px rgba(120, 53, 15, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.26), transparent 34rem),
    linear-gradient(180deg, #fffbeb 0%, #fff7ed 42%, #ffffff 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(120, 53, 15, 0.12);
  background: rgba(255, 251, 235, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--brand-dark);
  font-size: 20px;
}

.logo-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 10px 24px rgba(180, 83, 9, 0.28);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #7c2d12;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: var(--brand);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--brand);
}

.hero {
  position: relative;
  min-height: clamp(620px, 82vh, 820px);
  overflow: hidden;
  background: #111827;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.68), rgba(17, 24, 39, 0.38)),
    var(--hero-image) center / cover no-repeat;
  filter: saturate(1.08);
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.36), transparent 34rem),
    linear-gradient(180deg, transparent, rgba(17, 24, 39, 0.92));
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  align-items: center;
  gap: clamp(30px, 6vw, 78px);
  color: #fff;
  padding-top: 60px;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 12px 0 20px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2vw, 22px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d97706;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #fbbf24;
}

.hero-tags,
.tag-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.tag-row span,
.detail-meta span {
  color: #7c2d12;
  background: var(--brand-soft);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 14px 28px rgba(180, 83, 9, 0.28);
}

.button-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.hero-poster {
  position: relative;
  display: block;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
}

.hero-poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 24px;
  background: linear-gradient(135deg, #fef3c7, #92400e);
}

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

.hero-controls button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

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

.hero-dot {
  width: 10px !important;
  height: 10px !important;
  background: rgba(255, 255, 255, 0.42) !important;
}

.hero-dot.is-active {
  width: 28px !important;
  border-radius: 999px !important;
  background: #fbbf24 !important;
}

.search-band {
  margin-top: -44px;
  position: relative;
  z-index: 4;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 480px);
  gap: 24px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-panel h2,
.section-heading h2,
.rank-panel-head h2,
.sub-hero h1,
.detail-copy h1 {
  margin: 4px 0 0;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.global-search,
.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.global-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  outline: none;
}

.global-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.global-search button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

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

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

.section-heading h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.section-heading p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
}

.section-more {
  color: var(--brand-dark);
  font-weight: 900;
}

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

.category-card,
.category-large-card {
  position: relative;
  min-height: 160px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff, #fef3c7);
  box-shadow: 0 14px 34px rgba(120, 53, 15, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.category-large-card:hover,
.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(120, 53, 15, 0.16);
}

.category-card strong,
.category-large-card strong {
  display: block;
  font-size: 22px;
  color: #7c2d12;
}

.category-card span,
.category-large-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
}

.category-card em,
.category-large-card span {
  display: inline-flex;
  margin-top: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #92400e;
  background: #ffedd5;
  font-style: normal;
  font-weight: 900;
}

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

.category-large-card {
  min-height: 260px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.82), rgba(146, 64, 14, 0.72)),
    var(--category-cover) center / cover no-repeat;
}

.category-large-card strong,
.category-large-card em,
.category-large-card span {
  color: #fff;
}

.category-large-card span {
  background: rgba(255, 255, 255, 0.18);
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(120, 53, 15, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #fef3c7, #92400e);
}

.poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.poster-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #7c2d12;
  background: rgba(255, 251, 235, 0.9);
  font-size: 12px;
  font-weight: 900;
}

.play-hover {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.56);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-hover {
  opacity: 1;
  transform: translateY(0);
}

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

.movie-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.movie-card h3 {
  margin: 7px 0;
  font-size: 17px;
  line-height: 1.35;
}

.movie-card p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card .tag-row {
  margin-top: 12px;
}

.movie-card .tag-row span {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.rank-panel,
.rank-table,
.content-card,
.player-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(120, 53, 15, 0.1);
}

.rank-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
}

.rank-list,
.rank-table {
  display: grid;
  gap: 8px;
}

.rank-table {
  padding: 16px;
}

.rank-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 42px;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 10px;
  border-radius: 15px;
  transition: background 0.2s ease;
}

.rank-item:hover {
  background: #fffbeb;
}

.rank-no {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

.rank-score {
  color: var(--brand-dark);
  font-weight: 900;
}

.sub-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0;
  color: #fff;
  background:
    radial-gradient(circle at 25% 15%, rgba(245, 158, 11, 0.38), transparent 30rem),
    linear-gradient(135deg, #111827 0%, #78350f 100%);
}

.sub-hero h1,
.detail-copy h1 {
  font-size: clamp(38px, 7vw, 72px);
}

.sub-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.76);
}

.filter-panel {
  grid-template-columns: minmax(240px, 1fr) 180px 180px;
  margin-bottom: 24px;
}

.empty-state {
  padding: 32px;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.top-rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.top-rank-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: #111827;
}

.top-rank-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.54;
}

.top-rank-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(17, 24, 39, 0.92));
}

.top-rank-card h2,
.top-rank-card p,
.top-rank-card .rank-no {
  position: relative;
  z-index: 1;
}

.top-rank-card h2 {
  margin-top: 250px;
}

.rank-no.big {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.detail-hero {
  min-height: 600px;
}

.detail-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(17, 24, 39, 0.76)),
    var(--detail-bg) center / cover no-repeat;
  filter: blur(0) saturate(1.05);
}

.detail-head {
  position: relative;
  z-index: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: clamp(26px, 5vw, 60px);
  align-items: center;
}

.detail-poster {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.detail-poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 22px;
  background: linear-gradient(135deg, #fef3c7, #92400e);
}

.detail-one-line {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
}

.large-tags span {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.player-shell {
  overflow: hidden;
  background: #111827;
}

.player-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px;
  color: #fff;
}

.player-toolbar h2 {
  margin: 4px 0 0;
}

.movie-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-note {
  margin: 0;
  padding: 14px 22px 22px;
  color: rgba(255, 255, 255, 0.72);
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.content-card {
  padding: 28px;
}

.content-card h2 {
  margin-top: 0;
  color: #7c2d12;
}

.site-footer {
  margin-top: 40px;
  padding: 48px 0;
  color: #7c2d12;
  background: #ffedd5;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-grid p {
  max-width: 560px;
  color: #92400e;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: start;
  justify-content: flex-end;
}

.footer-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 30px rgba(120, 53, 15, 0.25);
  cursor: pointer;
}

.back-top.is-visible {
  display: grid;
  place-items: center;
}

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

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

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

  .rank-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
  }

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

  .hero-content,
  .search-panel,
  .detail-grid,
  .detail-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 90px 0 120px;
  }

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

  .filter-panel,
  .global-search {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .category-large-grid,
  .top-rank-grid {
    grid-template-columns: 1fr;
  }

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

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

  .rank-meta {
    display: none;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .movie-grid,
  .compact-grid,
  .latest-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .player-toolbar {
    align-items: start;
    flex-direction: column;
  }

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