* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #292524;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.bg-gradient-ruins {
  background: linear-gradient(135deg, #f5f5f4 0%, #fffbeb 52%, #e7e5e4 100%);
}

.container-custom {
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #292524;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.header-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand:hover,
.footer-logo:hover,
.desktop-nav a:hover,
.mobile-nav a:hover {
  color: #fbbf24;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-size: 0.75rem;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 1.25rem;
  font-weight: 600;
  color: #e7e5e4;
}

.menu-toggle {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding: 0.75rem 1rem 1rem;
  background: #1c1917;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav.is-open {
  display: grid;
  gap: 0.75rem;
}

.mobile-nav a {
  color: #e7e5e4;
  font-weight: 600;
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: #1c1917;
}

.hero-track,
.hero-slide,
.hero-slide img,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-shade {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.28));
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-copy {
  max-width: 42rem;
  color: #ffffff;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-copy h1,
.page-hero h1,
.detail-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 1.05;
  font-weight: 900;
}

.hero-copy p,
.page-hero p,
.detail-hero p {
  max-width: 48rem;
  margin: 0 0 1.4rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #e7e5e4;
}

.hero-meta,
.detail-tags,
.tag-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-meta span,
.detail-tags span,
.tag-row span,
.filter-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(217, 119, 6, 0.18);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn-primary,
.btn-ghost,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  border: 0;
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.25);
}

.btn-primary:hover,
.section-link:hover {
  transform: translateY(-1px);
  background: #b45309;
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

.full-width {
  width: 100%;
}

.hero-control {
  position: absolute;
  top: 50%;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 1rem;
}

.hero-next {
  right: 1rem;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}

.hero-dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 2rem;
  background: #f59e0b;
}

.section-space {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.search-panel-section {
  margin-top: -3rem;
  position: relative;
  z-index: 3;
}

.card {
  overflow: hidden;
  border-radius: 0.85rem;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(41, 37, 36, 0.12);
}

.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(41, 37, 36, 0.18);
}

.search-panel,
.list-tools,
.search-page-card {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
}

.search-panel h2,
.list-tools h2,
.search-page-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.search-panel p,
.list-tools p {
  margin: 0.25rem 0 0;
  color: #78716c;
}

.search-fields {
  display: flex;
  gap: 0.75rem;
}

.search-fields input,
.inline-search {
  width: 100%;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  padding: 0.78rem 0.95rem;
  color: #292524;
  background: #fffdf7;
  outline: none;
}

.search-fields input:focus,
.inline-search:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.search-large {
  min-height: 3.25rem;
  font-size: 1.05rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-title {
  margin: 0;
  color: #292524;
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  line-height: 1.1;
  font-weight: 900;
}

.section-head p {
  max-width: 46rem;
  margin: 0.6rem 0 0;
  color: #78716c;
}

.section-link {
  background: #292524;
  color: #ffffff;
  white-space: nowrap;
}

.movie-grid,
.category-grid,
.category-overview-grid,
.ranking-grid,
.compact-grid {
  display: grid;
  gap: 1.35rem;
}

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

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

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

.movie-card-link {
  display: block;
  height: 100%;
}

.poster-frame {
  position: relative;
  height: 13rem;
  overflow: hidden;
  background: #1c1917;
}

.poster-frame img,
.category-card img,
.category-overview-card img,
.ranking-movie-card img,
.rank-row img,
.poster-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-card:hover .poster-frame img,
.category-card:hover img,
.category-overview-card:hover img {
  transform: scale(1.08);
}

.poster-frame img,
.category-card img,
.category-overview-card img {
  transition: transform 0.45s ease;
}

.poster-year {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border-radius: 0.45rem;
  padding: 0.18rem 0.5rem;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.movie-card-body {
  padding: 1rem;
}

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  color: #d97706;
  font-size: 0.84rem;
  font-weight: 800;
}

.movie-meta-line span:not(:last-child)::after {
  content: "·";
  margin-left: 0.45rem;
  color: #a8a29e;
}

.movie-card h3,
.ranking-movie-card h2,
.category-card h3,
.category-overview-card h2,
.poster-info h2 {
  margin: 0 0 0.55rem;
  color: #292524;
  font-weight: 900;
  line-height: 1.25;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 2.9rem;
  overflow: hidden;
  font-size: 1.05rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card p,
.ranking-movie-card p,
.category-card p,
.category-overview-card p {
  display: -webkit-box;
  margin: 0 0 0.9rem;
  overflow: hidden;
  color: #57534e;
  font-size: 0.92rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card-featured {
  height: 100%;
}

.movie-card-featured .poster-frame {
  height: 24rem;
}

.movie-card-featured h3 {
  font-size: 1.45rem;
}

.category-card {
  position: relative;
  min-height: 12rem;
  display: grid;
  align-items: end;
  isolation: isolate;
  color: #ffffff;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.18));
}

.category-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.category-card div {
  padding: 1rem;
}

.category-card h3,
.category-card p {
  color: #ffffff;
}

.featured-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.ranking-card {
  padding: 0.5rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2.5rem 4rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.7rem;
}

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

.rank-num,
.ranking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-weight: 900;
}

.rank-num {
  width: 2rem;
  height: 2rem;
}

.rank-row img {
  width: 4rem;
  height: 4rem;
  border-radius: 0.55rem;
}

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

.rank-type {
  display: none;
  color: #78716c;
  font-size: 0.9rem;
}

.page-hero,
.detail-hero {
  padding: 4.5rem 0;
}

.page-hero-dark {
  background: #292524;
  color: #ffffff;
}

.breadcrumb {
  margin-bottom: 1.25rem;
  color: #d6d3d1;
  font-size: 0.95rem;
}

.breadcrumb a:hover {
  color: #fbbf24;
}

.category-overview-card a {
  display: grid;
  height: 100%;
}

.category-overview-card img {
  height: 13rem;
}

.category-overview-body {
  padding: 1.25rem;
}

.category-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.category-preview span {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: #f5f5f4;
  color: #57534e;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.ranking-movie-card a {
  position: relative;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  min-height: 10rem;
}

.ranking-movie-card img {
  min-height: 10rem;
}

.ranking-movie-card div {
  padding: 1rem 1rem 1rem 0;
}

.ranking-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.filter-row {
  margin-top: 1rem;
}

.filter-chip {
  border: 0;
  background: #f5f5f4;
  color: #57534e;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  background: #d97706;
  color: #ffffff;
}

.detail-hero {
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.detail-hero-inner {
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-section {
  margin-top: -3rem;
  position: relative;
  z-index: 2;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.detail-main,
.detail-side {
  display: grid;
  align-content: start;
  gap: 1.35rem;
}

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

.video-shell video {
  width: 100%;
  height: 100%;
  background: #000000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.35));
  color: #ffffff;
  cursor: pointer;
  z-index: 3;
}

.play-overlay.is-hidden {
  display: none;
}

.play-circle {
  width: 4.5rem;
  height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-size: 1.8rem;
  box-shadow: 0 15px 30px rgba(217, 119, 6, 0.32);
}

.player-status {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  color: #ffffff;
  text-align: center;
  pointer-events: none;
}

.content-card {
  padding: 1.5rem;
}

.content-card h2 {
  margin: 0 0 1rem;
  color: #292524;
  font-size: 1.5rem;
  font-weight: 900;
}

.content-card p {
  margin: 0 0 1rem;
  color: #44403c;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.poster-card > img {
  height: 24rem;
}

.poster-info {
  padding: 1.25rem;
}

.info-list {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 1.25rem;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #f5f5f4;
  padding-bottom: 0.65rem;
}

.info-list span {
  color: #78716c;
}

.info-list strong {
  color: #292524;
  text-align: right;
}

.site-footer {
  margin-top: 4rem;
  background: #1c1917;
  color: #d6d3d1;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.footer-logo {
  color: #ffffff;
}

.footer-grid p {
  max-width: 42rem;
  color: #a8a29e;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.footer-links a:hover {
  color: #fbbf24;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  text-align: center;
  color: #a8a29e;
}

.is-hidden-card {
  display: none !important;
}

@media (min-width: 640px) {
  .movie-grid,
  .compact-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-panel,
  .list-tools {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.85fr);
  }
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-nav,
  .mobile-nav.is-open {
    display: none;
  }

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

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

  .rank-row {
    grid-template-columns: 2.5rem 4rem minmax(0, 1fr) 16rem;
  }

  .rank-type {
    display: block;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

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

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

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

  .featured-layout {
    grid-template-columns: 0.95fr 2fr;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 0.85fr);
  }

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

@media (max-width: 639px) {
  .hero {
    height: 560px;
  }

  .hero-control {
    display: none;
  }

  .hero-content {
    align-items: flex-end;
    padding-bottom: 5rem;
  }

  .search-fields {
    flex-direction: column;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ranking-movie-card a {
    grid-template-columns: 7rem minmax(0, 1fr);
  }
}
