:root {
  --emerald: #059669;
  --teal: #0d9488;
  --cyan: #0891b2;
  --rose: #f43f5e;
  --orange: #f97316;
  --amber: #f59e0b;
  --slate: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.09);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--emerald), var(--teal), var(--cyan));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(8, 145, 178, 0.22);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #0f766e;
  background: #fde047;
  box-shadow: 0 10px 25px rgba(253, 224, 71, 0.35);
  transition: transform 0.25s ease;
}

.logo:hover .logo-mark {
  transform: rotate(12deg) scale(1.05);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  font-size: 15px;
}

.main-nav a {
  opacity: 0.94;
  transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover {
  color: #fef08a;
  transform: translateY(-1px);
}

.top-search,
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-search input,
.search-page-form input,
.catalog-toolbar input {
  border: 0;
  outline: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.top-search input {
  width: 220px;
}

.top-search button,
.mobile-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #0f766e;
  background: #fef08a;
  font-weight: 800;
  cursor: pointer;
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  padding: 14px 16px 20px;
  background: linear-gradient(180deg, #0f766e, #0891b2);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mobile-panel.open {
  display: grid;
  gap: 12px;
}

.mobile-panel a {
  padding: 8px 4px;
}

.hero-carousel {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.52) 48%, rgba(8, 145, 178, 0.18));
}

.hero-copy {
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  right: max(24px, calc((100% - 1180px) / 2));
  bottom: 76px;
  max-width: 780px;
  color: #ffffff;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 14px;
  color: white;
  background: linear-gradient(90deg, var(--rose), var(--orange));
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-copy h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.hero-copy p {
  margin: 0 0 22px;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.7;
}

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

.hero-meta span,
.detail-meta span,
.meta-row span {
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 13px 24px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
  box-shadow: 0 18px 32px rgba(13, 148, 136, 0.32);
}

.ghost-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.48);
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

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

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

.hero-dot.active {
  width: 34px;
  background: #ffffff;
}

.content-section,
.category-band,
.catalog-wrap,
.search-results-section {
  padding: 58px 0;
}

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

.section-heading.centered {
  display: block;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.section-heading span {
  display: block;
  margin-bottom: 8px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  color: #0f172a;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.8;
}

.section-heading > a {
  color: var(--emerald);
  font-weight: 900;
  white-space: nowrap;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.movie-card.minimal .poster-frame {
  aspect-ratio: 3 / 4;
}

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

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

.play-badge,
.horizontal-poster span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: var(--emerald);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-badge,
.horizontal-card:hover .horizontal-poster span {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.year-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 10px;
  padding: 5px 9px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 18px;
}

.card-body h3,
.horizontal-content h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.32;
}

.movie-card.minimal .card-body h3 {
  font-size: 15px;
}

.card-body h3 a:hover,
.horizontal-content h3 a:hover {
  color: var(--emerald);
}

.card-body p,
.horizontal-content p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  color: #475569;
  margin-bottom: 12px;
}

.meta-row span {
  background: #ecfdf5;
  color: #047857;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  border-radius: 999px;
  padding: 5px 9px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
}

.tag-row.large span {
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.14);
}

.horizontal-list {
  display: grid;
  gap: 16px;
}

.horizontal-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.horizontal-poster {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e2e8f0;
}

.horizontal-content {
  position: relative;
  min-width: 0;
  padding: 18px 18px 18px 0;
}

.rank-number {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--rose), var(--orange));
  font-weight: 900;
}

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

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

.category-chip {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 20px;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, #059669, #0891b2);
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-chip:nth-child(2n) {
  background: linear-gradient(135deg, #0d9488, #2563eb);
}

.category-chip:nth-child(3n) {
  background: linear-gradient(135deg, #f43f5e, #f97316);
}

.category-chip:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.category-chip strong {
  font-size: 20px;
}

.category-chip span {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
  font-size: 14px;
}

.rank-entry {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  margin-bottom: 70px;
  padding: 34px;
  border-radius: 30px;
  color: #ffffff;
  background: linear-gradient(135deg, #059669, #0d9488 48%, #0891b2);
  box-shadow: var(--shadow);
}

.rank-copy span {
  display: inline-block;
  margin-bottom: 12px;
  color: #fef08a;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.rank-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

.rank-copy p {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.8;
}

.rank-entry .horizontal-card {
  background: rgba(255, 255, 255, 0.96);
}

.page-hero,
.detail-hero {
  padding: 70px 0;
  color: #ffffff;
  background: radial-gradient(circle at 12% 10%, rgba(254, 240, 138, 0.28), transparent 24%), linear-gradient(120deg, #047857, #0d9488 50%, #0e7490);
}

.small-hero,
.search-hero {
  padding: 72px 0 86px;
}

.page-hero h1,
.detail-intro h1 {
  margin: 18px 0 16px;
  max-width: 860px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

.page-hero p,
.detail-intro p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

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

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

.category-card-large {
  border-radius: 26px;
  padding: 28px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.category-card-large > a span {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
  font-size: 13px;
  font-weight: 900;
}

.category-card-large h2 {
  margin: 18px 0 10px;
  font-size: 30px;
}

.category-card-large p {
  color: var(--muted);
  line-height: 1.8;
}

.sample-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.sample-links a {
  border-radius: 999px;
  padding: 7px 11px;
  background: #f1f5f9;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 20px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.catalog-toolbar label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-weight: 800;
}

.catalog-toolbar input {
  min-width: min(360px, 70vw);
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--line);
}

.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sort-buttons button,
#search-sort {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}

.sort-buttons button.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--emerald), var(--teal));
}

.ranking-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 32px;
  padding: 58px 0;
}

.ranking-side {
  position: sticky;
  top: 96px;
  align-self: start;
  border-radius: 26px;
  padding: 24px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.ranking-side h2 {
  margin: 0 0 18px;
}

.side-categories {
  display: grid;
  gap: 12px;
}

.side-categories .category-chip {
  min-height: auto;
}

.search-page-form {
  display: flex;
  max-width: 660px;
  gap: 10px;
  margin-top: 28px;
}

.search-page-form input {
  flex: 1;
  padding: 15px 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.player-section {
  margin-top: -42px;
  position: relative;
  z-index: 2;
}

.movie-player {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #020617;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.28);
}

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

.play-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.55));
  cursor: pointer;
  z-index: 3;
}

.play-trigger span {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #047857;
  background: rgba(255, 255, 255, 0.94);
  font-size: 32px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.play-trigger:hover span {
  transform: scale(1.07);
}

.movie-player.playing .play-trigger {
  display: none;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 48px 0 12px;
}

.detail-panel {
  border-radius: 24px;
  padding: 28px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.detail-panel h2 {
  margin: 0 0 16px;
  font-size: 26px;
}

.detail-panel p {
  margin: 0;
  color: #475569;
  line-height: 2;
  font-size: 16px;
}

.site-footer {
  margin-top: 36px;
  color: #cbd5e1;
  background: linear-gradient(180deg, #1e293b, #0f172a);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 32px;
  padding: 48px 0;
}

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

.site-footer p {
  margin: 0;
  line-height: 1.8;
}

.site-footer a {
  display: block;
  margin: 8px 0;
  color: #cbd5e1;
}

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

.footer-bottom {
  padding: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
  color: #94a3b8;
}

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

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

  .top-search {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .top-search {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-carousel {
    min-height: 560px;
  }

  .movie-grid,
  .movie-grid.compact,
  .category-grid,
  .category-grid.slim,
  .category-page-grid,
  .rank-entry,
  .ranking-layout,
  .detail-grid,
  .detail-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .ranking-side {
    position: static;
  }

  .horizontal-card {
    grid-template-columns: 140px 1fr;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .nav-inner {
    height: 62px;
  }

  .logo {
    font-size: 20px;
  }

  .hero-copy {
    left: 20px;
    right: 20px;
    bottom: 70px;
  }

  .hero-arrow {
    display: none;
  }

  .content-section,
  .category-band,
  .catalog-wrap,
  .search-results-section {
    padding: 42px 0;
  }

  .section-heading {
    display: block;
  }

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

  .horizontal-card {
    grid-template-columns: 116px 1fr;
    gap: 12px;
  }

  .horizontal-content {
    padding: 14px 14px 14px 0;
  }

  .detail-poster {
    max-width: 260px;
  }

  .search-page-form {
    flex-direction: column;
  }
}
