:root {
  --toffee-primary: #C87941;
  --toffee-secondary: #E5A76B;
  --toffee-light: #F5E6D3;
  --toffee-cream: #FFF8F0;
  --toffee-caramel: #B8784F;
  --toffee-brown: #8B5A3C;
  --toffee-dark: #6B4423;
  --cloud-white: #FFFFFF;
  --cloud-soft: #F9F9F9;
  --shadow-cloud: 0 8px 32px rgba(200, 121, 65, 0.12);
  --shadow-glow: 0 0 40px rgba(229, 167, 107, 0.3);
  --radius-card: 28px;
  --radius-soft: 18px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--toffee-dark);
  background:
    radial-gradient(circle at 10% 0%, rgba(229, 167, 107, 0.22), transparent 28rem),
    radial-gradient(circle at 90% 8%, rgba(200, 121, 65, 0.18), transparent 22rem),
    linear-gradient(135deg, var(--toffee-cream), var(--cloud-white) 48%, #fff9f2);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(245, 230, 211, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 240, 0.82));
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(139, 90, 60, 0.06);
}

.header-inner {
  max-width: var(--max-width);
  height: 76px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--toffee-primary), var(--toffee-secondary));
  box-shadow: var(--shadow-glow);
  animation: floatY 6s ease-in-out infinite;
}

.brand-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--toffee-primary), var(--toffee-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link,
.mobile-link {
  border-radius: 999px;
  font-weight: 700;
  color: var(--toffee-dark);
  transition: 0.25s ease;
}

.nav-link {
  padding: 10px 15px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--toffee-primary);
  background: var(--toffee-light);
}

.header-search {
  display: flex;
  align-items: center;
  min-width: 260px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.92);
  box-shadow: inset 0 0 0 1px rgba(200, 121, 65, 0.14);
}

.header-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 8px 10px 8px 14px;
  color: var(--toffee-dark);
  background: transparent;
}

.header-search button,
.primary-btn,
.secondary-btn,
.play-action,
.search-panel button {
  border: 0;
  cursor: pointer;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--toffee-primary), var(--toffee-secondary));
  box-shadow: 0 12px 26px rgba(200, 121, 65, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.header-search button {
  padding: 8px 16px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  font-weight: 800;
}

.secondary-btn {
  color: var(--toffee-primary);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px rgba(200, 121, 65, 0.24);
}

.header-search button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.play-action:hover,
.search-panel button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(200, 121, 65, 0.26);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--toffee-light);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--toffee-dark);
}

.mobile-nav {
  display: none;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 18px;
}

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

.mobile-link {
  padding: 12px 14px;
}

main {
  min-height: 70vh;
}

.section,
.hero,
.page-hero,
.detail-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 52px 24px;
}

.hero {
  position: relative;
  min-height: 620px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-shell {
  position: relative;
  min-height: 520px;
  border-radius: 38px;
  overflow: hidden;
  box-shadow: var(--shadow-cloud);
  background: linear-gradient(135deg, rgba(107, 68, 35, 0.95), rgba(200, 121, 65, 0.84));
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.68fr);
  gap: 34px;
  align-items: center;
  padding: 54px;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.012);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.24), transparent 18rem),
    linear-gradient(120deg, rgba(255, 248, 240, 0.18), transparent 62%);
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero h1,
.hero h2 {
  margin: 20px 0 16px;
  color: #fff;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

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

.hero-tags span,
.tag-row span,
.meta-line span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--toffee-primary);
  background: rgba(255, 248, 240, 0.9);
}

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

.hero-poster {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

.hero-poster img {
  width: min(360px, 100%);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(56, 30, 12, 0.42);
}

.hero-dots {
  position: absolute;
  left: 54px;
  bottom: 34px;
  z-index: 2;
  display: flex;
  gap: 10px;
}

.hero-dots button {
  width: 36px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.42);
}

.hero-dots button.is-active {
  background: #fff;
}

.section-head,
.page-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--toffee-primary);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.section h2,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-lead,
.page-hero p,
.detail-title p {
  margin: 12px 0 0;
  color: var(--toffee-brown);
}

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

.category-chip,
.category-panel,
.search-panel,
.content-panel {
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-cloud);
  border: 1px solid rgba(245, 230, 211, 0.85);
}

.category-chip {
  min-height: 132px;
  padding: 20px;
  transition: 0.25s ease;
}

.category-chip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.category-chip span {
  color: var(--toffee-brown);
  font-size: 14px;
}

.category-chip:hover,
.movie-card:hover,
.category-panel:hover {
  transform: translateY(-8px);
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-cloud);
  border: 1px solid rgba(245, 230, 211, 0.92);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  box-shadow: 0 22px 48px rgba(200, 121, 65, 0.18);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, var(--toffee-light), var(--toffee-cream));
}

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

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

.play-dot {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: rgba(200, 121, 65, 0.92);
  box-shadow: 0 10px 24px rgba(107, 68, 35, 0.3);
}

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

.card-meta,
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--toffee-brown);
  font-size: 13px;
}

.movie-card h3 {
  margin: 9px 0 8px;
  font-size: 19px;
  line-height: 1.28;
}

.movie-card p {
  display: -webkit-box;
  min-height: 50px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--toffee-brown);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-foot {
  margin-top: 14px;
}

.card-foot a {
  color: var(--toffee-primary);
  font-weight: 800;
}

.rank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 48px 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(245, 230, 211, 0.86);
  box-shadow: 0 8px 20px rgba(139, 90, 60, 0.06);
  transition: 0.25s ease;
}

.rank-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-cloud);
}

.rank-no {
  color: var(--toffee-primary);
  font-size: 22px;
  font-weight: 900;
}

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

.rank-info strong,
.rank-info em {
  display: block;
}

.rank-info em {
  color: var(--toffee-brown);
  font-style: normal;
  font-size: 13px;
}

.rank-score {
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--toffee-primary);
  font-weight: 900;
}

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

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px auto;
  gap: 12px;
  padding: 18px;
  margin-bottom: 26px;
}

.search-panel input,
.search-panel select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(200, 121, 65, 0.18);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--toffee-dark);
  background: rgba(255, 248, 240, 0.78);
  outline: 0;
}

.search-panel button {
  min-height: 46px;
  padding: 0 22px;
}

.category-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
}

.category-panel h2 {
  margin: 0 0 10px;
}

.category-panel p {
  margin: 0 0 18px;
  color: var(--toffee-brown);
}

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

.mini-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(139, 90, 60, 0.12);
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--toffee-brown);
  font-size: 14px;
}

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

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

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  background: #100c08;
  box-shadow: 0 26px 66px rgba(56, 30, 12, 0.32);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(20, 12, 6, 0.72), rgba(107, 68, 35, 0.48));
  cursor: pointer;
  z-index: 2;
}

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

.play-action {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  font-size: 32px;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 30px;
  box-shadow: var(--shadow-cloud);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  margin-top: 34px;
}

.content-panel {
  padding: 28px;
}

.content-panel h2,
.sidebar h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.content-panel p {
  margin: 0 0 18px;
  color: var(--toffee-brown);
  font-size: 16px;
}

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

.info-list div {
  padding: 13px 14px;
  border-radius: 16px;
  color: var(--toffee-brown);
  background: rgba(255, 248, 240, 0.78);
}

.info-list strong {
  display: block;
  color: var(--toffee-dark);
}

.sidebar {
  display: grid;
  gap: 18px;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.pagination a {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--toffee-primary);
  background: #fff;
  box-shadow: var(--shadow-cloud);
  font-weight: 800;
}

.pagination a.current {
  color: #fff;
  background: var(--toffee-primary);
}

.site-footer {
  margin-top: 42px;
  padding: 46px 24px 24px;
  border-top: 1px solid rgba(245, 230, 211, 0.84);
  background: linear-gradient(135deg, rgba(245, 230, 211, 0.8), rgba(255, 248, 240, 0.92));
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.8fr;
  gap: 34px;
}

.footer-brand {
  margin-bottom: 12px;
}

.site-footer p,
.footer-bottom {
  color: var(--toffee-brown);
}

.site-footer h3 {
  margin: 0 0 14px;
}

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

.footer-links a:hover {
  color: var(--toffee-primary);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(200, 121, 65, 0.16);
  text-align: center;
}

.empty-result {
  display: none;
  padding: 28px;
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--toffee-brown);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-cloud);
}

@keyframes floatY {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 1100px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .hero-slide,
  .detail-hero,
  .detail-grid,
  .rank-layout,
  .category-panel {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 760px) {
  .header-inner {
    height: 66px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 18px;
  }

  .section,
  .hero,
  .page-hero,
  .detail-main {
    padding: 34px 16px;
  }

  .hero {
    min-height: auto;
  }

  .hero-shell {
    min-height: 720px;
    border-radius: 28px;
  }

  .hero-slide {
    padding: 30px;
    align-content: start;
  }

  .hero-dots {
    left: 30px;
    bottom: 24px;
  }

  .movie-grid,
  .movie-grid.compact,
  .category-grid,
  .footer-grid,
  .search-panel,
  .info-list,
  .category-panel .mini-grid {
    grid-template-columns: 1fr;
  }

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

  .rank-score {
    grid-column: 3;
    justify-self: start;
  }
}
