:root {
  --page-bg: #fff7ed;
  --page-bg-soft: #fffbeb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --line: #fed7aa;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --accent-soft: #ffedd5;
  --card: #ffffff;
  --shadow: 0 18px 42px rgba(124, 45, 18, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, var(--page-bg), var(--page-bg-soft));
}

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

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

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, rgba(255, 251, 235, 0.96), rgba(255, 237, 213, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(194, 65, 12, 0.08);
  backdrop-filter: blur(12px);
}

.header-inner {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
  transition: transform 0.2s ease;
}

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

.brand-text {
  font-size: 21px;
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 430px;
  margin-left: auto;
}

.header-search input,
.mobile-search input,
.quick-search-form input,
.search-page-form input,
.filter-input,
.filter-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  padding: 11px 14px 11px 42px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 22px;
}

.header-search input:focus,
.mobile-search input:focus,
.quick-search-form input:focus,
.search-page-form input:focus,
.filter-input:focus,
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

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

.nav-link,
.mobile-link {
  color: #4b5563;
  font-weight: 700;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--accent-dark);
}

.nav-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 237, 213, 0.75);
  color: #7c2d12;
}

.mobile-panel {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

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

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

.mobile-search input {
  padding: 11px 14px;
}

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

.hero {
  position: relative;
  height: 510px;
  overflow: hidden;
  background: #111827;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-slide.active {
  opacity: 1;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.1));
}

.hero-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #ffffff;
}

.hero-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-label {
  color: #fed7aa;
  margin-bottom: 14px;
}

.hero-content h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.08;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.hero-content p {
  max-width: 650px;
  margin: 0 0 24px;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 11px;
  color: #9a3412;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags .tag {
  color: #ffffff;
  background: rgba(249, 115, 22, 0.78);
  backdrop-filter: blur(10px);
}

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

.primary-button,
.ghost-button,
.quick-search-form button,
.search-page-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 13px 24px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-button,
.quick-search-form button,
.search-page-form button {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.28);
}

.primary-button:hover,
.quick-search-form button:hover,
.search-page-form button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.ghost-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.06);
}

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

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

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

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

.hero-dot.active {
  width: 34px;
  background: var(--accent);
}

.quick-search {
  margin-top: -34px;
  position: relative;
  z-index: 5;
}

.quick-search-inner {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  padding: 24px;
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.quick-search h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.quick-search p {
  margin: 0;
  color: var(--text-muted);
}

.quick-search-form,
.search-page-form {
  display: flex;
  gap: 12px;
}

.quick-search-form input,
.search-page-form input {
  padding: 13px 16px;
}

.page-flow,
.page-main {
  padding-top: 54px;
}

.content-section {
  margin-bottom: 58px;
}

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

.section-head h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 4vw, 32px);
}

.compact-head h2 {
  font-size: 26px;
}

.more-link {
  color: var(--accent-dark);
  font-weight: 800;
  white-space: nowrap;
}

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 12px 28px rgba(124, 45, 18, 0.11);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 44px rgba(124, 45, 18, 0.18);
}

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

.compact .poster-link {
  aspect-ratio: 16 / 11;
}

.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-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.movie-card:hover .poster-shade {
  background: rgba(0, 0, 0, 0.28);
}

.play-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border-radius: 999px;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.year-badge,
.rank-badge {
  position: absolute;
  top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.year-badge {
  right: 10px;
}

.rank-badge {
  left: 10px;
  background: rgba(249, 115, 22, 0.88);
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body h3 a:hover {
  color: var(--accent-dark);
}

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

.card-meta {
  display: flex;
  gap: 10px;
  color: #78716c;
  font-size: 12px;
  margin-bottom: 10px;
}

.movie-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
}

.rail-item {
  flex: 0 0 250px;
  scroll-snap-align: start;
}

.split-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 26px;
  margin-bottom: 58px;
}

.ranking-panel,
.category-panel,
.detail-card,
.side-card,
.filter-panel,
.search-state {
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.ranking-panel,
.category-panel {
  padding: 24px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 38px 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #fff7ed;
  transition: transform 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
  transform: translateX(4px);
  background: #ffedd5;
}

.rank-index {
  color: var(--accent-dark);
  font-weight: 900;
}

.rank-row img {
  width: 58px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

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

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

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

.rank-score {
  color: var(--accent-dark);
  font-weight: 900;
}

.category-mini-grid,
.category-grid-large {
  display: grid;
  gap: 16px;
}

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

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

.category-tile {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 150px;
  padding: 22px;
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #fff7ed);
  box-shadow: 0 12px 30px rgba(124, 45, 18, 0.11);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 42px rgba(124, 45, 18, 0.17);
}

.category-glow {
  position: absolute;
  right: -44px;
  top: -44px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.24), transparent 65%);
}

.category-tile strong {
  position: relative;
  display: block;
  margin-bottom: 10px;
  font-size: 21px;
}

.category-tile p {
  position: relative;
  margin: 0 0 18px;
  color: var(--text-muted);
  line-height: 1.7;
}

.tile-link {
  position: relative;
  color: var(--accent-dark);
  font-weight: 800;
}

.page-hero {
  background: radial-gradient(circle at 18% 20%, rgba(249, 115, 22, 0.22), transparent 26%), linear-gradient(135deg, #fffbeb, #ffedd5);
  border-bottom: 1px solid var(--line);
}

.small-hero .container {
  padding: 54px 0 48px;
}

.page-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.12;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: #7c2d12;
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--accent-dark);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  margin-bottom: 22px;
  padding: 18px;
}

.filter-search span,
.filter-select-wrap span {
  display: block;
  margin-bottom: 8px;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
}

.filter-input,
.filter-select {
  padding: 12px 14px;
}

.search-page-form {
  max-width: 650px;
  margin-top: 22px;
}

.search-state {
  margin-bottom: 22px;
  padding: 18px;
  color: var(--text-muted);
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000000;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  aspect-ratio: 16 / 9;
}

.main-video {
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: #000000;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

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

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-cover-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.big-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 20px 38px rgba(249, 115, 22, 0.34);
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 44px 1fr auto 44px 44px;
  gap: 10px;
  align-items: center;
  padding: 14px;
  color: #ffffff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.player-controls button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.player-controls input {
  accent-color: var(--accent);
}

#time-display {
  font-size: 13px;
  white-space: nowrap;
}

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

.detail-card h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.18;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  color: #7c2d12;
  font-weight: 700;
}

.detail-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffedd5;
}

.large-tags {
  margin-bottom: 26px;
}

.detail-card section {
  margin-top: 26px;
}

.detail-card h2,
.side-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.detail-card p {
  margin: 0;
  color: #374151;
  line-height: 1.9;
  white-space: pre-wrap;
}

.detail-side {
  display: grid;
  gap: 20px;
  align-content: start;
  position: sticky;
  top: 88px;
}

.side-card {
  padding: 18px;
}

.cover-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
}

.full-button {
  width: 100%;
}

.small-rank-list .rank-row {
  grid-template-columns: 28px 48px 1fr;
}

.small-rank-list .rank-score {
  display: none;
}

.related-section {
  margin-top: 34px;
}

.site-footer {
  margin-top: 64px;
  color: #d1d5db;
  background: linear-gradient(90deg, #1f2937, #111827);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 44px 0;
}

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

.site-footer p,
.site-footer li {
  color: #9ca3af;
  line-height: 1.8;
}

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

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

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

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

  .split-section,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

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

@media (max-width: 760px) {
  .header-inner {
    gap: 12px;
  }

  .header-search,
  .desktop-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand-text {
    font-size: 18px;
  }

  .hero {
    height: 540px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.88));
  }

  .hero-content {
    justify-content: flex-end;
    padding-bottom: 82px;
  }

  .hero-arrow {
    display: none;
  }

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

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

  .movie-grid,
  .compact-grid,
  .category-mini-grid,
  .category-grid-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .player-controls {
    grid-template-columns: 40px 1fr 40px 40px;
  }

  #time-display {
    display: none;
  }

  .detail-card {
    padding: 20px;
  }

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

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

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

  .rail-item {
    flex-basis: 82vw;
  }

  .hero-content h1 {
    font-size: 32px;
  }
}
