:root {
  --bg: #f8fafc;
  --bg-soft: #eef6ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbeafe;
  --dark: #020617;
  --dark-2: #0f172a;
  --cyan: #06b6d4;
  --blue: #2563eb;
  --orange: #f97316;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-strong: 0 28px 70px rgba(8, 47, 73, 0.26);
  --radius: 24px;
}

* {
  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: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 44%, #f8fafc 100%);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 100%);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 12px 25px rgba(6, 182, 212, 0.28);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark,
.footer-brand:hover .brand-mark {
  transform: scale(1.08) rotate(-3deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 19px;
  background: linear-gradient(90deg, #67e8f9, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-copy small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 12px;
}

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

.nav-link {
  padding: 9px 14px;
  color: #cbd5e1;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #67e8f9;
  background: rgba(14, 165, 233, 0.12);
}

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

.header-search input,
.mobile-search input,
.search-panel input,
.filter-panel input,
.filter-panel select {
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: none;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  padding: 11px 14px;
}

.header-search input {
  width: 245px;
}

.header-search input::placeholder,
.mobile-search input::placeholder {
  color: #94a3b8;
}

.header-search button,
.mobile-search button,
.search-panel button,
.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 25px rgba(14, 165, 233, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-panel button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(14, 165, 233, 0.32);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ghost-button {
  color: var(--cyan);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: none;
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-button span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.mobile-menu {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

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

.mobile-search {
  margin: 16px 0;
}

.mobile-search input {
  flex: 1;
}

.mobile-menu nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-menu-link {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #dbeafe;
}

.hero-carousel {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  background: #020617;
  color: #fff;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.05);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 30%, rgba(34, 211, 238, 0.22), transparent 32%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(15, 23, 42, 0.82) 48%, rgba(15, 23, 42, 0.45) 100%),
    linear-gradient(0deg, #f8fafc 0%, transparent 22%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  min-height: 72vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  align-items: center;
  gap: 40px;
  padding: 72px 0 92px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #67e8f9;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(103, 232, 249, 0.22);
  font-weight: 700;
  font-size: 14px;
}

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

.hero-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.hero-copy p {
  margin: 0 0 24px;
  max-width: 690px;
  color: #dbeafe;
  font-size: 18px;
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
}

.hero-meta {
  color: #bfdbfe;
  margin-bottom: 24px;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  position: relative;
  align-self: end;
  padding: 22px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.hero-panel-title {
  margin: 0 0 14px;
  color: #e0f2fe;
  font-weight: 800;
}

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

.hero-thumb {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.hero-thumb.is-active {
  border-color: rgba(103, 232, 249, 0.7);
  background: rgba(14, 165, 233, 0.18);
}

.hero-thumb img {
  width: 86px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

.hero-thumb strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-thumb small {
  display: block;
  color: #94a3b8;
}

.page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #082f49 60%, #0e7490 100%);
  color: #fff;
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: rgba(103, 232, 249, 0.16);
  filter: blur(4px);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

.section {
  padding: 70px 0;
}

.section-tight {
  padding: 40px 0;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.section-link {
  color: var(--cyan);
  font-weight: 800;
}

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

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

.movie-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

.movie-card figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.movie-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.25s ease;
}

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

.type-badge,
.duration-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.type-badge {
  left: 12px;
  top: 12px;
  padding: 7px 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.duration-badge {
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  background: rgba(2, 6, 23, 0.72);
}

.rank-badge {
  left: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.3);
}

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

.movie-card-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.movie-meta {
  gap: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

.movie-meta span:not(:last-child)::after,
.hero-meta span:not(:last-child)::after,
.detail-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 6px;
  color: #94a3b8;
}

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

.tag-row span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #0891b2;
  background: #ecfeff;
  font-size: 12px;
  font-weight: 700;
}

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

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 28px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:nth-child(2n) {
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.category-card:nth-child(3n) {
  background: linear-gradient(135deg, #14b8a6, #2563eb);
}

.category-card:nth-child(4n) {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.category-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-strong);
}

.category-card h2,
.category-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 24px;
}

.category-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.category-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -55px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.ranking-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 46px 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
  transform: translateX(6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.rank-number {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ef4444);
  font-weight: 900;
}

.rank-item img {
  width: 84px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

.rank-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.rank-views {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-card,
.detail-card,
.search-panel,
.filter-panel {
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.sidebar-card h2,
.detail-card h2,
.search-panel h2,
.filter-panel h2 {
  margin: 0 0 16px;
}

.filter-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.filter-panel input,
.filter-panel select,
.search-panel input {
  flex: 1;
  color: var(--text);
  background: #f8fafc;
  border-color: #dbeafe;
}

.search-panel {
  margin-top: -34px;
  position: relative;
  z-index: 2;
}

.search-panel form {
  display: flex;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: #64748b;
  font-size: 14px;
}

.breadcrumb a {
  color: #0891b2;
  font-weight: 700;
}

.player-section {
  background: #020617;
  color: #fff;
  padding: 34px 0 54px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
  aspect-ratio: 16 / 9;
}

.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.22), rgba(2, 6, 23, 0.18) 52%, rgba(2, 6, 23, 0.52));
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-circle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 20px 45px rgba(14, 165, 233, 0.34);
  font-size: 34px;
  padding-left: 6px;
}

.detail-title-card {
  margin-top: 24px;
}

.detail-title-card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.1;
}

.detail-title-card p {
  max-width: 900px;
  margin: 12px 0 0;
  color: #dbeafe;
  font-size: 18px;
}

.detail-main {
  padding: 48px 0 70px;
}

.detail-card {
  margin-bottom: 24px;
}

.detail-card h2 {
  font-size: 26px;
}

.detail-card p {
  color: #334155;
  font-size: 17px;
  line-height: 1.9;
}

.detail-poster {
  overflow: hidden;
  padding: 0;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  background: #0f172a;
}

.detail-poster-content {
  padding: 22px;
}

.detail-poster-content h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.detail-poster-content .primary-button {
  display: inline-flex;
  margin-top: 18px;
}

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

.sitemap-grid a {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-footer {
  background: linear-gradient(180deg, #0f172a, #020617);
  color: #cbd5e1;
  padding-top: 58px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 1fr;
  gap: 34px;
}

.footer-brand {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 14px;
}

.site-footer p {
  margin: 0;
  color: #94a3b8;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
}

.site-footer ul {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  margin-top: 46px;
  padding: 18px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.hidden-by-filter {
  display: none !important;
}

.empty-state {
  padding: 40px 22px;
  text-align: center;
  color: #64748b;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

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

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

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

  .mobile-menu-button {
    display: inline-flex;
    margin-left: auto;
  }

  .hero-content,
  .ranking-layout,
  .detail-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    align-items: end;
    padding-top: 54px;
  }

  .hero-panel {
    align-self: auto;
  }

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

@media (max-width: 640px) {
  .site-header-inner {
    min-height: 64px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .hero-carousel,
  .hero-content {
    min-height: 76vh;
  }

  .hero-copy p,
  .page-hero p,
  .detail-title-card p {
    font-size: 16px;
  }

  .hero-panel {
    display: none;
  }

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

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

  .filter-panel,
  .search-panel form {
    flex-direction: column;
    align-items: stretch;
  }

  .rank-item {
    grid-template-columns: 38px 70px minmax(0, 1fr);
  }

  .rank-views {
    display: none;
  }
}
