:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --emerald: #10b981;
  --emerald-deep: #059669;
  --teal: #0d9488;
  --orange: #f97316;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 44%, #f8fafc 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(14px);
}

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

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.28);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text strong {
  color: #ffffff;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.logo-text em {
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  margin-top: 5px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.desktop-nav a,
.mobile-nav a {
  color: #cbd5e1;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a:hover {
  color: #ffffff;
}

.desktop-nav a:hover {
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  cursor: pointer;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: #ffffff;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

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

.hero-section {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide > img,
.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shadow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.82) 0%, rgba(15, 23, 42, 0.62) 44%, rgba(15, 23, 42, 0.18) 100%);
}

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

.hero-copy {
  max-width: 720px;
  color: #ffffff;
}

.hero-tags,
.tag-row,
.detail-tags-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.hero-tags span:first-child {
  background: var(--emerald);
}

.hero-copy h1 {
  margin: 20px 0 16px;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 650px;
  margin: 0;
  color: #e2e8f0;
  font-size: 19px;
}

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

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

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

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(16, 185, 129, 0.3);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.btn-light {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.56);
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(16, 185, 129, 0.9);
  transform: translateY(-50%) scale(1.05);
}

.hero-prev {
  left: 24px;
  transform: translateY(-50%);
}

.hero-next {
  right: 24px;
  transform: translateY(-50%);
}

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

.hero-dots button {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
  width: 36px;
  background: #ffffff;
}

.quick-search-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
  margin-top: -54px;
  position: relative;
  z-index: 6;
  padding: 28px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--emerald-deep);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quick-search-panel h2,
.section-heading h2,
.ranking-title h2,
.page-hero h1,
.detail-content h2,
.info-card h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.quick-search-panel h2,
.page-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.quick-search-panel p,
.section-heading p,
.page-hero p,
.footer-copy {
  margin: 12px 0 0;
  color: var(--muted);
}

.quick-search {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.quick-search input,
.search-line input,
.filter-line select {
  width: 100%;
  border: 1px solid transparent;
  outline: none;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
}

.quick-search input {
  padding: 0 18px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 34px;
}

.category-pills a,
.filter-chips button,
.tag-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--dark-soft);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: color 0.2s ease, border 0.2s ease, transform 0.2s ease;
}

.category-pills a:hover,
.filter-chips button:hover,
.filter-chips button.is-active,
.tag-card a:hover {
  color: var(--emerald-deep);
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.content-section {
  padding-top: 72px;
}

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

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

.section-more {
  color: var(--emerald-deep);
  font-weight: 900;
  white-space: nowrap;
}

.movie-grid,
.featured-grid,
.category-grid {
  display: grid;
  gap: 24px;
}

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

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

.movie-card,
.category-card,
.info-card,
.ranking-panel,
.search-panel {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

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

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e2e8f0;
}

.movie-card-featured .poster-link {
  aspect-ratio: 16 / 9;
}

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

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

.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.78) 100%);
}

.poster-badge,
.poster-year,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.poster-badge {
  left: 12px;
  bottom: 12px;
  background: var(--emerald);
}

.poster-year {
  right: 12px;
  bottom: 12px;
  background: rgba(15, 23, 42, 0.76);
}

.rank-badge {
  left: 12px;
  top: 12px;
  min-width: 38px;
  background: linear-gradient(135deg, var(--orange), #ef4444);
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--emerald-deep);
  font-size: 12px;
  font-weight: 900;
}

.movie-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.movie-card h3 a:hover {
  color: var(--emerald-deep);
}

.movie-card p {
  min-height: 52px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.tag-row span {
  min-height: 26px;
  padding: 3px 10px;
  background: var(--surface-soft);
  color: var(--muted);
}

.two-column-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
}

.ranking-panel {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px;
}

.ranking-panel ol,
.ranking-list-wide {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ranking-title {
  margin-bottom: 18px;
}

.ranking-item + .ranking-item {
  margin-top: 14px;
}

.ranking-item a {
  display: grid;
  grid-template-columns: 34px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.ranking-number {
  color: var(--emerald-deep);
  font-weight: 950;
}

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

.ranking-info {
  min-width: 0;
}

.ranking-info strong,
.ranking-info em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-info strong {
  font-size: 15px;
}

.ranking-info em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.page-main {
  padding-bottom: 80px;
}

.page-hero {
  margin-top: 36px;
  padding: 52px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 34%), linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: var(--shadow-soft);
}

.small-hero p,
.category-hero p {
  max-width: 780px;
  font-size: 18px;
}

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

.category-card a {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 220px;
}

.category-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 12px;
  background: var(--dark);
}

.category-thumbs img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
}

.category-card-body {
  padding: 28px;
}

.category-card-body h2 {
  margin: 0;
  font-size: 28px;
}

.category-card-body p {
  color: var(--muted);
}

.search-panel {
  margin-top: 28px;
  padding: 24px;
}

.search-line,
.filter-line {
  display: grid;
  gap: 12px;
}

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

.filter-line {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.search-line input,
.filter-line select {
  min-height: 48px;
  padding: 0 16px;
  border-color: var(--line);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.ranking-wide .ranking-list-wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}

.ranking-list-wide .ranking-item {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.detail-main {
  padding-bottom: 90px;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: var(--dark);
}

.detail-bg-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.9) 0%, rgba(15, 23, 42, 0.72) 50%, rgba(15, 23, 42, 0.36) 100%);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 34px;
  padding-bottom: 56px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #cbd5e1;
  font-size: 14px;
}

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

.detail-intro {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
  margin-top: 56px;
  color: #ffffff;
}

.detail-poster {
  width: 250px;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.detail-intro h1 {
  margin: 18px 0;
  max-width: 840px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.detail-one-line {
  max-width: 760px;
  color: #e2e8f0;
  font-size: 19px;
}

.player-section {
  margin-top: -72px;
  position: relative;
  z-index: 4;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 28px;
  background: #020617;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
  aspect-ratio: 16 / 9;
}

.movie-video {
  width: 100%;
  height: 100%;
  background: #000000;
  object-fit: contain;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 16px;
  border: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.16), rgba(2, 6, 23, 0.64));
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  box-shadow: 0 18px 44px rgba(16, 185, 129, 0.38);
  font-size: 34px;
  text-indent: 5px;
}

.play-overlay strong {
  font-size: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding-top: 48px;
}

.detail-content,
.info-card {
  padding: 30px;
}

.detail-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.detail-content h2 + p {
  margin-top: 12px;
}

.detail-content p {
  color: #334155;
  font-size: 17px;
}

.detail-sidebar {
  display: grid;
  align-content: start;
  gap: 20px;
}

.info-card dl {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 20px 0 0;
}

.info-card dt {
  color: var(--muted);
  font-weight: 800;
}

.info-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.tag-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-card h2 {
  width: 100%;
}

.related-section {
  padding-top: 56px;
}

.site-footer {
  margin-top: 80px;
  background: var(--dark);
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 0.75fr 1fr;
  gap: 34px;
  padding: 54px 0;
}

.footer-logo .logo-text strong {
  color: #ffffff;
}

.site-footer h3 {
  margin: 0 0 16px;
  color: #ffffff;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 10px;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  font-size: 14px;
}

.footer-bottom p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

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

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

  .ranking-panel {
    position: static;
  }

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

@media (max-width: 780px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-section {
    height: 72vh;
    min-height: 560px;
  }

  .hero-control {
    display: none;
  }

  .quick-search-panel,
  .category-card a,
  .detail-intro {
    grid-template-columns: 1fr;
  }

  .quick-search,
  .search-line,
  .filter-line {
    grid-template-columns: 1fr;
  }

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

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

  .detail-poster {
    width: 190px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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

  .logo-text strong {
    font-size: 18px;
  }

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

  .hero-copy p,
  .detail-one-line {
    font-size: 16px;
  }

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

  .quick-search-panel {
    padding: 22px;
  }

  .detail-layout {
    padding-top: 28px;
  }

  .detail-content,
  .info-card {
    padding: 22px;
  }

  .play-icon {
    width: 68px;
    height: 68px;
    font-size: 28px;
  }
}
