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

:root {
  --blackboard-dark: #0f1a0f;
  --blackboard: #1a2e1a;
  --blackboard-light: #2d4a2d;
  --chalk-white: #f5f5dc;
  --chalk-muted: rgba(245, 245, 220, 0.72);
  --chalk-faint: rgba(245, 245, 220, 0.18);
  --chalk-yellow: #fffacd;
  --chalk-blue: #add8e6;
  --chalk-green: #90ee90;
  --chalk-pink: #ffb6c1;
  --vintage-gold: #ffd700;
  --vintage-beige: #d4c5aa;
  --shadow-chalk: 0 18px 45px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 250, 205, 0.09), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(173, 216, 230, 0.09), transparent 26%),
    linear-gradient(135deg, var(--blackboard-dark), var(--blackboard) 54%, #142414);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(245, 245, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 245, 220, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  z-index: -1;
}

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;
  background: rgba(15, 26, 15, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 250, 205, 0.2);
}

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

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

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
  box-shadow: 0 0 0 4px rgba(255, 250, 205, 0.14);
  font-weight: 900;
}

.logo-text,
.footer-logo {
  font-family: "Patrick Hand", "Microsoft YaHei", cursive;
  font-size: 30px;
  letter-spacing: 1px;
  color: var(--chalk-yellow);
  text-shadow: 0 0 18px rgba(255, 250, 205, 0.25);
  white-space: nowrap;
}

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--chalk-muted);
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--chalk-yellow);
  border-color: rgba(255, 250, 205, 0.34);
  background: rgba(255, 250, 205, 0.08);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(330px, 28vw);
}

.header-search input,
.filter-row input,
.filter-row select {
  width: 100%;
  border: 1px solid rgba(255, 250, 205, 0.24);
  border-radius: 999px;
  color: var(--chalk-white);
  background: rgba(45, 74, 45, 0.72);
  padding: 11px 14px;
  outline: none;
}

.header-search input:focus,
.filter-row input:focus,
.filter-row select:focus {
  border-color: rgba(255, 250, 205, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 250, 205, 0.08);
}

.header-search button,
.filter-row button,
.btn,
.rank-action {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.filter-row button:hover,
.btn:hover,
.rank-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 250, 205, 0.22);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 250, 205, 0.24);
  border-radius: 14px;
  background: rgba(45, 74, 45, 0.74);
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--chalk-yellow);
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  margin: 28px auto 58px;
  min-height: 70vh;
  border: 2px solid rgba(255, 250, 205, 0.24);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--blackboard-light);
  box-shadow: var(--shadow-chalk);
}

.hero-frame {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 26, 15, 0.96), rgba(26, 46, 26, 0.76) 45%, rgba(26, 46, 26, 0.25)),
    linear-gradient(0deg, rgba(15, 26, 15, 0.9), transparent 54%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 70vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.44fr);
  align-items: center;
  gap: 42px;
  padding: clamp(30px, 6vw, 78px);
}

.hero-label,
.section-kicker,
.detail-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--chalk-green);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 900;
}

.hero-copy h1 {
  margin: 16px 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.96;
  color: var(--chalk-yellow);
  font-family: "Patrick Hand", "Microsoft YaHei", cursive;
  text-shadow: 0 8px 38px rgba(0, 0, 0, 0.38);
}

.hero-copy p {
  max-width: 760px;
  color: rgba(245, 245, 220, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

.hero-tags,
.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-tags span,
.tag,
.detail-tags span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 250, 205, 0.24);
  background: rgba(255, 250, 205, 0.08);
  color: var(--chalk-yellow);
  font-size: 13px;
}

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

.btn-ghost {
  color: var(--chalk-white);
  border: 1px solid rgba(255, 250, 205, 0.34);
  background: rgba(45, 74, 45, 0.7);
}

.hero-poster {
  position: relative;
  display: block;
  border-radius: 26px;
  overflow: hidden;
  border: 2px solid rgba(255, 250, 205, 0.3);
  transform: rotate(1.5deg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

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

.hero-poster span,
.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blackboard-dark);
  background: rgba(255, 250, 205, 0.92);
  box-shadow: 0 0 0 10px rgba(255, 250, 205, 0.12);
}

.hero-dots {
  position: absolute;
  left: clamp(28px, 6vw, 78px);
  bottom: 28px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 42px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 245, 220, 0.3);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--chalk-yellow);
}

.section {
  margin: 56px 0;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
}

.section-heading h2,
.page-title h1,
.detail-title {
  margin: 0;
  color: var(--chalk-yellow);
  font-family: "Patrick Hand", "Microsoft YaHei", cursive;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.section-heading p,
.page-title p,
.card-desc,
.rank-info p,
.detail-summary,
.footer-inner p {
  color: var(--chalk-muted);
  line-height: 1.75;
}

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

.movie-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 250, 205, 0.2);
  background: rgba(45, 74, 45, 0.58);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 250, 205, 0.54);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(15, 26, 15, 0.8);
}

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

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

.poster-play {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
}

.rank-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blackboard-dark);
  background: var(--vintage-gold);
  font-weight: 900;
}

.card-body {
  padding: 15px;
}

.card-title {
  display: block;
  color: var(--chalk-white);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.card-title:hover,
.rank-title:hover {
  color: var(--chalk-yellow);
}

.card-meta,
.rank-meta,
.detail-meta,
.breadcrumb {
  color: rgba(245, 245, 220, 0.62);
  font-size: 13px;
  line-height: 1.6;
}

.card-desc {
  margin: 10px 0 0;
  font-size: 14px;
}

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

.category-tile {
  position: relative;
  min-height: 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 250, 205, 0.22);
  background: var(--blackboard-light);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 26, 15, 0.94), rgba(15, 26, 15, 0.1));
}

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

.category-tile strong,
.category-tile small,
.category-index {
  position: relative;
  z-index: 2;
}

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

.category-tile strong {
  margin-top: 34px;
  color: var(--chalk-yellow);
  font-size: 24px;
}

.category-tile small {
  margin-top: 8px;
  color: var(--chalk-muted);
  line-height: 1.7;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 28px;
}

.pill-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--chalk-muted);
  border: 1px solid rgba(255, 250, 205, 0.22);
  background: rgba(45, 74, 45, 0.48);
}

.pill-link:hover,
.pill-link.is-active {
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
}

.page-title {
  padding: 54px 0 24px;
}

.filter-panel {
  margin: 18px 0 30px;
  padding: 18px;
  border: 1px solid rgba(255, 250, 205, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(15, 26, 15, 0.42);
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 150px auto;
  gap: 12px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 58px 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 250, 205, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(45, 74, 45, 0.55);
}

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

.rank-thumb img {
  width: 92px;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--chalk-white);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
  margin: 42px 0 62px;
}

.detail-main,
.detail-side,
.player-section {
  border: 1px solid rgba(255, 250, 205, 0.18);
  border-radius: var(--radius-xl);
  background: rgba(45, 74, 45, 0.54);
  box-shadow: var(--shadow-chalk);
}

.detail-main {
  overflow: hidden;
}

.player-section {
  padding: 18px;
  margin-bottom: 26px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #050905;
  border: 1px solid rgba(255, 250, 205, 0.24);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--chalk-yellow);
  background: linear-gradient(0deg, rgba(15, 26, 15, 0.64), rgba(15, 26, 15, 0.34));
  border: 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

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

.play-ring {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blackboard-dark);
  background: var(--chalk-yellow);
  box-shadow: 0 0 0 12px rgba(255, 250, 205, 0.12);
}

.detail-content {
  padding: 28px;
}

.breadcrumb {
  margin-bottom: 18px;
}

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

.detail-title {
  margin-bottom: 16px;
}

.detail-summary {
  margin: 18px 0 24px;
  font-size: 17px;
}

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

.info-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 26, 15, 0.46);
  border: 1px solid rgba(255, 250, 205, 0.12);
}

.info-item span {
  display: block;
  color: rgba(245, 245, 220, 0.6);
  font-size: 12px;
}

.info-item strong {
  display: block;
  margin-top: 4px;
  color: var(--chalk-yellow);
}

.text-block {
  margin-top: 26px;
}

.text-block h2 {
  color: var(--chalk-yellow);
}

.text-block p {
  color: var(--chalk-muted);
  line-height: 1.9;
  font-size: 16px;
}

.detail-side {
  padding: 18px;
  position: sticky;
  top: 98px;
}

.side-poster {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 205, 0.22);
}

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

.side-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid rgba(255, 250, 205, 0.18);
  background: rgba(15, 26, 15, 0.72);
}

.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

[hidden] {
  display: none !important;
}

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

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

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

  .detail-side {
    position: static;
  }
}

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

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

  .nav-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-radius: 20px;
    background: rgba(15, 26, 15, 0.96);
    border: 1px solid rgba(255, 250, 205, 0.22);
  }

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

  .header-search {
    display: none;
  }

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

  .hero-content {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero-poster {
    display: none;
  }

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

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

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

  .rank-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
  }
}

@media (max-width: 520px) {
  main,
  .header-inner,
  .footer-inner {
    width: min(100% - 22px, 1240px);
  }

  .logo-text {
    font-size: 24px;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

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

  .detail-content,
  .player-section {
    padding: 14px;
  }
}
