:root {
  --bg: #f4f7f4;
  --card: #ffffff;
  --ink: #17221d;
  --muted: #66746e;
  --line: #dce5df;
  --green: #0f7b66;
  --coral: #ef6a4d;
  --blue: #315d91;
  --soft: #eaf1ed;
  --shadow: 0 18px 40px rgba(23, 34, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #fbfdfb 0%, var(--bg) 100%);
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 18px 34px;
  background: rgba(251, 253, 251, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a,
.top-link,
.button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  transition: 0.22s ease;
}

.nav a:hover,
.nav a.active,
.top-link:hover,
.button:hover,
.chip:hover,
.chip.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  transform: translateY(-2px);
}

main {
  padding: 30px 34px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 360px;
  gap: 22px;
}

.hero-main,
.panel,
.movie-card,
.library-card,
.detail-card,
.footer section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-main {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  align-items: center;
}

.hero-poster {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 0.72;
}

.hero-poster img,
.movie-thumb img,
.library-thumb img,
.detail-poster img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hero-main:hover .hero-poster img,
.movie-card:hover .movie-thumb img,
.library-card:hover .library-thumb img {
  transform: scale(1.05);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1,
.page-head h1,
.detail-copy h1 {
  margin: 14px 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p,
.page-head p,
.card-text,
.footer p,
.detail-copy p {
  color: var(--muted);
  line-height: 1.72;
}

.meta,
.actions,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.meta span,
.tag {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--soft);
}

.actions {
  margin-top: 20px;
}

.button.primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.hero-side {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.rank-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  transition: 0.22s ease;
}

.rank-link:last-child {
  border-bottom: 0;
}

.rank-link:hover {
  color: var(--green);
  transform: translateX(4px);
}

.rank-no {
  font-weight: 800;
  color: var(--coral);
}

.section-head,
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 30px 0 16px;
}

.section-head h2,
.page-head h1 {
  margin-bottom: 0;
}

.section-head h2 {
  font-size: 28px;
  line-height: 1.25;
}

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

.movie-card {
  overflow: hidden;
  transition: 0.24s ease;
}

.movie-card:hover,
.library-card:hover {
  transform: translateY(-6px);
  border-color: rgba(15, 123, 102, 0.45);
}

.movie-thumb {
  aspect-ratio: 0.72;
  overflow: hidden;
}

.movie-body {
  padding: 13px;
}

.movie-body strong {
  display: block;
  min-height: 44px;
  line-height: 1.38;
}

.muted {
  color: var(--muted);
}

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

.channel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f3f8f5);
  transition: 0.24s ease;
}

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

.library-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 92px;
}

.filter-group {
  margin-top: 17px;
}

.chip-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.search {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}

.library-list {
  display: grid;
  gap: 13px;
}

.library-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 160px;
  gap: 15px;
  align-items: center;
  padding: 12px;
  transition: 0.24s ease;
}

.library-thumb {
  height: 132px;
  overflow: hidden;
  border-radius: 12px;
}

.library-card h3 {
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.3;
}

.side-info {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.detail-card {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 0.72;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.fact {
  padding: 14px;
  border-radius: 14px;
  background: var(--soft);
}

.fact span {
  display: block;
  color: var(--muted);
}

.fact strong {
  display: block;
  margin-top: 7px;
}

.footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0 34px 34px;
}

.footer section {
  padding: 18px;
}

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

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

@media (max-width: 980px) {
  .topbar,
  main,
  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar,
  .hero,
  .hero-main,
  .library-layout,
  .detail-card {
    grid-template-columns: 1fr;
  }

  .filters {
    position: relative;
    top: auto;
  }

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

@media (max-width: 680px) {
  .nav {
    justify-content: flex-start;
  }

  .movie-grid,
  .channel-board,
  .footer,
  .fact-grid {
    grid-template-columns: 1fr;
  }

  .library-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .side-info {
    grid-column: 1 / -1;
    justify-items: start;
  }
}
