@import url("https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap");

:root {
  --blackboard: #1a2e1a;
  --blackboard-dark: #0f1a0f;
  --blackboard-light: #2d4a2d;
  --chalk-white: #f5f5dc;
  --chalk-yellow: #fffacd;
  --chalk-blue: #add8e6;
  --chalk-green: #90ee90;
  --chalk-pink: #ffb6c1;
  --vintage-gold: #ffd700;
  --vintage-beige: #d4c5aa;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --line: rgba(255, 250, 205, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk-white);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 250, 205, 0.10), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(173, 216, 230, 0.10), transparent 22rem),
    linear-gradient(135deg, var(--blackboard-dark), var(--blackboard));
  font-family: "Patrick Hand", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0.02em;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 26, 15, 0.92);
  border-bottom: 2px solid rgba(255, 250, 205, 0.26);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 78px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chalk-white);
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blackboard);
  background: var(--chalk-yellow);
  border: 2px solid var(--vintage-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 250, 205, 0.10);
}

.desktop-nav,
.mobile-panel nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.desktop-nav a,
.mobile-panel a {
  color: rgba(245, 245, 220, 0.86);
  font-size: 1.12rem;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-panel a:hover,
.mobile-panel a.is-active {
  color: var(--chalk-yellow);
  transform: translateY(-1px);
}

.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.quick-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  color: var(--chalk-white);
  background: rgba(45, 74, 45, 0.92);
  border: 1px solid rgba(255, 250, 205, 0.28);
  border-radius: 14px;
  outline: 0;
}

.quick-search input {
  width: min(260px, 24vw);
  padding: 10px 14px;
}

.quick-search input::placeholder,
.filter-panel input::placeholder {
  color: rgba(245, 245, 220, 0.56);
}

.quick-search button,
.hero-actions a,
.hero-actions button,
.card-link,
.play-button,
.detail-action,
.category-card > a,
.rank-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  color: var(--blackboard-dark);
  font-weight: 800;
  background: linear-gradient(135deg, var(--chalk-yellow), var(--vintage-gold));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(255, 215, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-search button:hover,
.hero-actions a:hover,
.hero-actions button:hover,
.card-link:hover,
.play-button:hover,
.detail-action:hover,
.category-card > a:hover,
.rank-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(255, 215, 0, 0.24);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  color: var(--chalk-white);
  background: rgba(45, 74, 45, 0.86);
  border: 1px solid rgba(255, 250, 205, 0.28);
  border-radius: 12px;
}

.mobile-panel {
  display: none;
  padding: 0 16px 18px;
  border-top: 1px solid rgba(255, 250, 205, 0.18);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel nav {
  align-items: flex-start;
  flex-direction: column;
  padding: 12px 0;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-bottom: 1px solid rgba(255, 250, 205, 0.14);
}

.hero-slider {
  position: relative;
  min-height: 620px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  background-image:
    linear-gradient(100deg, rgba(15, 26, 15, 0.95) 0%, rgba(15, 26, 15, 0.75) 42%, rgba(15, 26, 15, 0.28) 100%),
    var(--hero-image);
  background-position: center;
  background-size: cover;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

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

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.55fr);
  gap: 34px;
  align-items: center;
  padding: 82px 0 76px;
}

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

.eyebrow,
.section-kicker,
.breadcrumbs {
  color: var(--chalk-blue);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1,
.page-head h1,
.detail-info h1 {
  margin: 10px 0 16px;
  color: var(--chalk-white);
  font-size: clamp(2.8rem, 7vw, 6.2rem);
  line-height: 0.98;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.hero p,
.page-head p,
.detail-info p,
.category-card p,
.movie-card p,
.site-footer p {
  color: rgba(245, 245, 220, 0.78);
  font-size: 1.12rem;
  line-height: 1.72;
}

.hero p {
  max-width: 710px;
  font-size: clamp(1.14rem, 1.6vw, 1.42rem);
}

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

.hero-actions .ghost,
.detail-action.ghost {
  color: var(--chalk-white);
  background: rgba(45, 74, 45, 0.74);
  border: 1px solid rgba(255, 250, 205, 0.25);
  box-shadow: none;
}

.hero-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: rgba(45, 74, 45, 0.72);
  border: 2px solid rgba(255, 250, 205, 0.34);
  border-radius: 28px;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.hero-poster img {
  height: 100%;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 14px;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
  border-radius: 999px;
  font-weight: 800;
}

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

.hero-dots button {
  width: 13px;
  height: 13px;
  padding: 0;
  background: rgba(245, 245, 220, 0.42);
  border: 0;
  border-radius: 50%;
}

.hero-dots button.is-active {
  width: 32px;
  background: var(--chalk-yellow);
  border-radius: 999px;
}

.section {
  padding: 66px 0;
}

.section.alt {
  background: rgba(15, 26, 15, 0.32);
}

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

.section-head h2,
.page-head h1 {
  margin: 4px 0 0;
  color: var(--chalk-white);
  font-size: clamp(2rem, 3vw, 3rem);
}

.page-head {
  display: block;
  padding: 54px 0 22px;
}

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

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

.movie-card {
  overflow: hidden;
  background: rgba(45, 74, 45, 0.68);
  border: 1px solid rgba(255, 250, 205, 0.20);
  border-radius: 22px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  background: rgba(45, 74, 45, 0.90);
  border-color: rgba(255, 250, 205, 0.42);
}

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: rgba(15, 26, 15, 0.66);
}

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

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

.poster em,
.rank-no {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  font-style: normal;
  font-weight: 800;
  border-radius: 999px;
}

.poster em {
  right: 10px;
  bottom: 10px;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
}

.rank-no {
  top: 10px;
  left: 10px;
  color: var(--chalk-white);
  background: rgba(15, 26, 15, 0.74);
  border: 1px solid rgba(255, 250, 205, 0.28);
}

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

.movie-card h3 {
  margin: 0 0 8px;
  color: var(--chalk-white);
  font-size: 1.35rem;
  line-height: 1.18;
}

.movie-card h3 a:hover {
  color: var(--chalk-yellow);
}

.movie-card p {
  min-height: 54px;
  margin: 0 0 12px;
  font-size: 1rem;
}

.movie-meta,
.tag-row,
.detail-meta,
.channel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.movie-meta span,
.tag-row span,
.detail-meta span,
.channel-pills a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: rgba(245, 245, 220, 0.86);
  background: rgba(15, 26, 15, 0.52);
  border: 1px solid rgba(255, 250, 205, 0.16);
  border-radius: 999px;
  font-size: 0.92rem;
}

.tag-row span:nth-child(2n) {
  color: var(--chalk-blue);
}

.tag-row span:nth-child(3n) {
  color: var(--chalk-pink);
}

.horizontal-strip {
  overflow-x: auto;
  padding-bottom: 12px;
}

.horizontal-strip .strip-inner {
  display: grid;
  grid-auto-columns: minmax(220px, 250px);
  grid-auto-flow: column;
  gap: 18px;
}

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

.category-card,
.filter-panel,
.detail-block,
.rank-panel {
  background: rgba(45, 74, 45, 0.68);
  border: 1px solid rgba(255, 250, 205, 0.22);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.category-card {
  padding: 24px;
}

.category-card h2,
.category-card h3 {
  margin: 0 0 8px;
  color: var(--chalk-white);
  font-size: 2rem;
}

.category-card > a {
  margin-top: 14px;
}

.channel-pills {
  margin-top: 18px;
}

.channel-pills a:hover {
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
}

.filter-panel {
  margin-bottom: 28px;
  padding: 18px;
}

.filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
}

.filter-row label {
  display: grid;
  gap: 6px;
  color: rgba(245, 245, 220, 0.74);
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  min-height: 46px;
  padding: 10px 12px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(105deg, rgba(15, 26, 15, 0.96) 0%, rgba(15, 26, 15, 0.84) 46%, rgba(15, 26, 15, 0.50) 100%),
    var(--detail-image);
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid rgba(255, 250, 205, 0.16);
}

.detail-hero .container {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.9fr);
  gap: 34px;
  align-items: center;
  padding: 60px 0;
}

.detail-cover {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: rgba(45, 74, 45, 0.72);
  border: 2px solid rgba(255, 250, 205, 0.28);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.detail-cover img {
  height: 100%;
  object-fit: cover;
}

.breadcrumbs {
  margin-bottom: 14px;
}

.breadcrumbs a:hover {
  color: var(--chalk-yellow);
}

.detail-meta {
  margin: 16px 0 22px;
}

.detail-info h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
}

.detail-block {
  margin-bottom: 24px;
  padding: 24px;
}

.detail-block h2 {
  margin: 0 0 14px;
  color: var(--chalk-yellow);
  font-size: 2rem;
}

.detail-block p {
  margin: 0 0 14px;
  color: rgba(245, 245, 220, 0.82);
  font-size: 1.12rem;
  line-height: 1.85;
}

.player-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid rgba(255, 250, 205, 0.22);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.player-box video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.34);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-layer img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.play-button {
  min-width: 142px;
  min-height: 54px;
  font-size: 1.2rem;
}

.side-list {
  display: grid;
  gap: 14px;
}

.side-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: rgba(15, 26, 15, 0.42);
  border: 1px solid rgba(255, 250, 205, 0.14);
  border-radius: 18px;
}

.side-item img {
  aspect-ratio: 3 / 4;
  height: 104px;
  object-fit: cover;
  border-radius: 12px;
}

.side-item strong {
  display: block;
  color: var(--chalk-white);
  font-size: 1.1rem;
  line-height: 1.2;
}

.side-item span {
  color: rgba(245, 245, 220, 0.65);
}

.rank-panel {
  padding: 20px;
}

.rank-line {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 250, 205, 0.13);
}

.rank-line:last-child {
  border-bottom: 0;
}

.rank-index {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
  border-radius: 50%;
  font-weight: 900;
}

.rank-line strong {
  color: var(--chalk-white);
  font-size: 1.18rem;
}

.rank-line span {
  color: rgba(245, 245, 220, 0.66);
}

.site-footer {
  margin-top: 46px;
  padding: 44px 0;
  background: rgba(15, 26, 15, 0.92);
  border-top: 2px solid rgba(255, 250, 205, 0.18);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
}

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

.footer-links a {
  padding: 8px 12px;
  color: rgba(245, 245, 220, 0.76);
  background: rgba(45, 74, 45, 0.70);
  border: 1px solid rgba(255, 250, 205, 0.16);
  border-radius: 999px;
}

.footer-links a:hover {
  color: var(--chalk-yellow);
}

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

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

@media (max-width: 820px) {
  .desktop-nav,
  .nav-bar > .quick-search {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .brand {
    font-size: 1.6rem;
  }

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

  .hero-layout,
  .detail-hero .container,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    max-width: 300px;
    margin: 0 auto;
  }

  .section-head {
    display: block;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
  }

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

  .footer-links {
    justify-content: flex-start;
  }
}

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

  .hero,
  .hero-slider,
  .hero-slide {
    min-height: 720px;
  }

  .hero-layout {
    padding-top: 42px;
  }

  .category-grid,
  .grid,
  .grid.compact,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .movie-card p {
    min-height: 0;
  }

  .detail-block {
    padding: 18px;
  }

  .rank-line {
    grid-template-columns: 48px 1fr;
  }

  .rank-link {
    grid-column: 2;
    justify-self: start;
  }
}
