:root {
  --deepblue-950: #000b12;
  --deepblue-900: #00151f;
  --deepblue-800: #002a3e;
  --deepblue-700: #003f5d;
  --ocean-900: #00333d;
  --ocean-800: #00444e;
  --ocean-700: #006a7c;
  --ocean-600: #00879c;
  --ocean-100: #cceef3;
  --ocean-50: #e6f7f9;
  --seagreen-700: #10775f;
  --seagreen-600: #2d9b7c;
  --seagreen-50: #e8f5f1;
  --coral-600: #ec5538;
  --coral-500: #ff694b;
  --coral-50: #fff0ed;
  --sand-100: #f5f1e9;
  --sand-50: #faf8f4;
  --white: #ffffff;
  --text: #173241;
  --muted: #5d7580;
  --shadow-ocean: 0 4px 14px 0 rgba(0, 169, 195, 0.15);
  --shadow-ocean-lg: 0 18px 36px rgba(0, 68, 78, 0.20);
  --radius-xl: 22px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, var(--sand-50), var(--ocean-50));
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--deepblue-800), var(--ocean-700), var(--seagreen-700));
  box-shadow: 0 12px 30px rgba(0, 21, 31, 0.22);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand {
  font-size: clamp(18px, 2vw, 24px);
  white-space: nowrap;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: var(--deepblue-900);
  background: linear-gradient(135deg, var(--ocean-100), var(--coral-500));
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

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

.desktop-nav a,
.mobile-panel nav a {
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel nav a:hover,
.mobile-panel nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search-form input,
.catalog-toolbar input,
.catalog-toolbar select {
  border: 1px solid rgba(255, 255, 255, 0.22);
  outline: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  padding: 11px 14px;
  min-width: 210px;
}

.header-search-form input::placeholder {
  color: rgba(230, 247, 249, 0.72);
}

.header-search-form button,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search-form button,
.primary-button {
  color: var(--white);
  background: var(--coral-500);
  box-shadow: 0 12px 24px rgba(255, 105, 75, 0.24);
}

.header-search-form button:hover,
.primary-button:hover {
  background: var(--coral-600);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(255, 105, 75, 0.30);
}

.ghost-button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.ghost-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  font-size: 22px;
}

.mobile-panel {
  display: none;
  padding: 0 16px 16px;
  background: rgba(0, 21, 31, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

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

.mobile-panel .header-search-form,
.mobile-panel nav {
  width: min(1180px, 100%);
  margin: 12px auto 0;
}

.mobile-panel nav {
  display: grid;
  gap: 6px;
}

.hero-section {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  background: var(--deepblue-900);
}

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

.hero-image img,
.detail-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.hero-image div,
.detail-backdrop div {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--deepblue-900), rgba(0, 21, 31, 0.70) 48%, rgba(0, 21, 31, 0.28));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: 70vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: center;
  padding: 72px 0;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-500);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
  margin: 14px 0 16px;
  color: var(--white);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.detail-line {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--ocean-100);
  font-size: clamp(17px, 2vw, 22px);
}

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

.hero-tags a,
.hero-tags span,
.detail-meta span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 135, 156, 0.30);
  border: 1px solid rgba(51, 186, 207, 0.30);
  font-size: 13px;
  font-weight: 700;
}

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

.hero-panel {
  padding: 24px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(0, 21, 31, 0.42);
  box-shadow: var(--shadow-ocean-lg);
  backdrop-filter: blur(10px);
}

.hero-panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.hero-list {
  display: grid;
  gap: 12px;
}

.small-movie {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.10);
  transition: background 0.2s ease, transform 0.2s ease;
}

.small-movie:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(4px);
}

.small-movie img {
  width: 78px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
}

.small-movie span {
  font-weight: 800;
  color: var(--white);
}

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

.accent-shell {
  padding: clamp(24px, 4vw, 48px);
  border-radius: 32px;
  background: linear-gradient(135deg, var(--ocean-50), var(--seagreen-50));
  box-shadow: var(--shadow-ocean);
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading span {
  color: var(--coral-500);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.section-heading h2 {
  margin: 5px 0 0;
  color: var(--deepblue-900);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
}

.section-heading.with-link {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.with-link a {
  color: var(--ocean-600);
  font-weight: 900;
}

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

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

.movie-card {
  min-width: 0;
}

.movie-link,
.movie-card > a {
  height: 100%;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-ocean);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-link:hover,
.movie-card > a:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-ocean-lg);
}

.poster-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--deepblue-900);
}

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

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

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 21, 31, 0.72), transparent);
  transition: opacity 0.25s ease;
}

.movie-link:hover .poster-frame::after {
  opacity: 1;
}

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 21, 31, 0.72);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.play-mark {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 56px;
  height: 56px;
  margin: auto;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--coral-500);
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.76);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-link:hover .play-mark {
  opacity: 1;
  transform: scale(1);
}

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

.tag-row {
  gap: 7px;
  margin-bottom: 11px;
}

.tag-row span {
  color: var(--ocean-700);
  background: var(--ocean-50);
  border-color: rgba(0, 135, 156, 0.14);
}

.movie-card h3 {
  margin: 0 0 8px;
  color: var(--deepblue-900);
  font-size: 18px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card p {
  min-height: 50px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--ocean-700);
  font-size: 13px;
  font-weight: 700;
}

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

.category-tile {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 24px;
  color: var(--white);
  background: linear-gradient(135deg, var(--deepblue-700), var(--ocean-600), var(--seagreen-600));
  box-shadow: var(--shadow-ocean);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.category-tile span {
  font-size: 22px;
  font-weight: 900;
}

.category-tile em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-style: normal;
}

.page-hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: radial-gradient(circle at 10% 10%, rgba(255, 105, 75, 0.32), transparent 26%), linear-gradient(135deg, var(--deepblue-900), var(--ocean-700), var(--seagreen-700));
}

.slim-hero {
  padding: 76px 0;
}

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

.page-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.catalog-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-ocean);
  backdrop-filter: blur(12px);
}

.catalog-toolbar input,
.catalog-toolbar select {
  min-width: 0;
  color: var(--deepblue-900);
  border-color: rgba(0, 135, 156, 0.20);
  background: var(--white);
}

.catalog-toolbar input {
  flex: 1;
}

.empty-state {
  display: none;
  margin: 36px 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border-radius: 20px;
  background: var(--white);
}

.empty-state.is-visible {
  display: block;
}

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

.rank-card > a {
  display: grid;
  grid-template-columns: 74px 132px 1fr;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 20px;
}

.rank-card img {
  width: 132px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
}

.rank-number {
  color: var(--coral-500);
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.rank-card h3,
.rank-card p {
  margin: 0 0 5px;
}

.rank-card h3 {
  color: var(--deepblue-900);
}

.rank-card p {
  min-height: 0;
  color: var(--muted);
}

.rank-card div span {
  color: var(--ocean-700);
  font-size: 13px;
  font-weight: 800;
}

.detail-hero {
  position: relative;
  color: var(--white);
  background: var(--deepblue-900);
  overflow: hidden;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
}

.detail-wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 28px;
  color: var(--ocean-100);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--coral-500);
}

.detail-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.detail-poster img {
  width: 300px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: var(--shadow-ocean-lg);
}

.detail-info h1 {
  color: var(--white);
  font-size: clamp(34px, 5vw, 58px);
}

.detail-line {
  color: var(--ocean-100);
}

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

.detail-tags {
  margin-bottom: 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: var(--deepblue-950);
  box-shadow: var(--shadow-ocean-lg);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--deepblue-950);
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--white);
  background: radial-gradient(circle, rgba(0, 21, 31, 0.18), rgba(0, 21, 31, 0.68));
  cursor: pointer;
}

.player-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral-500);
  box-shadow: 0 20px 36px rgba(255, 105, 75, 0.35);
  font-size: 32px;
}

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

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

.detail-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.detail-text article {
  padding: 26px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-ocean);
}

.detail-text h2 {
  margin: 0 0 12px;
  color: var(--deepblue-900);
}

.detail-text p {
  margin: 0;
  color: var(--text);
}

.site-footer {
  margin-top: 72px;
  padding: 52px 0 24px;
  color: var(--ocean-100);
  background: linear-gradient(180deg, var(--deepblue-900), var(--deepblue-950));
}

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-grid h2 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 17px;
}

.footer-grid p {
  margin: 0;
  color: rgba(204, 238, 243, 0.78);
}

.footer-grid a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: rgba(204, 238, 243, 0.82);
}

.footer-grid a:hover {
  color: var(--coral-500);
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 0;
  padding-top: 22px;
  color: rgba(204, 238, 243, 0.64);
  border-top: 1px solid rgba(204, 238, 243, 0.14);
  text-align: center;
}

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

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

  .header-search-form input {
    min-width: 160px;
  }
}

@media (max-width: 860px) {
  .desktop-nav,
  .header-inner > .header-search-form {
    display: none;
  }

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

  .hero-content {
    grid-template-columns: 1fr;
    padding: 52px 0;
  }

  .hero-panel {
    max-width: 540px;
  }

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

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

  .detail-poster img {
    width: min(300px, 100%);
  }

  .rank-card > a {
    grid-template-columns: 54px 100px 1fr;
    gap: 12px;
  }

  .rank-card img {
    width: 100px;
    height: 68px;
  }
}

@media (max-width: 560px) {
  .header-inner {
    width: calc(100% - 24px);
  }

  .brand {
    font-size: 16px;
  }

  .hero-section,
  .hero-content {
    min-height: auto;
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 34px;
  }

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

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

  .section-heading.with-link {
    align-items: start;
    flex-direction: column;
  }

  .rank-card > a {
    grid-template-columns: 44px 84px 1fr;
    padding: 10px;
  }

  .rank-card img {
    width: 84px;
    height: 58px;
  }

  .rank-number {
    font-size: 22px;
  }
}
