:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1e2430;
  --muted: #7a8494;
  --line: #e6e9ef;
  --primary: #ff3d7f;
  --primary-dark: #cb1d5e;
  --blue: #3662ff;
  --green: #14a889;
  --shadow: 0 8px 24px rgba(29, 38, 56, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1220px;
  min-height: 74px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr minmax(240px, 330px) auto;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #256fe8);
  font-size: 24px;
  font-weight: 800;
}
.brand-text {
  display: grid;
  gap: 2px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}
.brand-text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 13px;
  color: #384255;
  font-size: 15px;
}
.top-nav a.active,
.top-nav a:hover {
  color: #fff;
  background: var(--primary);
}
.search {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.search input,
.search button {
  height: 42px;
  border: 0;
}
.header-tools {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.header-tools a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,61,127,.22);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--primary-dark);
  background: #fff5f8;
  font-size: 13px;
  font-weight: 700;
}
.search input {
  min-width: 0;
  padding: 0 13px;
  outline: none;
}
.search button {
  padding: 0 20px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px;
}
.hero-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 250px;
  gap: 14px;
  margin-bottom: 16px;
}
.channel-panel,
.quick-panel,
.section,
.rank-card,
.news-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.channel-panel,
.quick-panel {
  padding: 14px;
}
.channel-panel h2,
.quick-panel h2,
.rank-card h2,
.news-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.channel-panel a {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.channel-panel a:last-child { border-bottom: 0; }
.channel-panel b {
  color: #202838;
  font-size: 15px;
}
.channel-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.hero-card {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #1b2330;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.hero-card img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  display: block;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16,21,30,.92), rgba(16,21,30,.52), rgba(16,21,30,.12));
}
.hero-content {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 1;
  color: #fff;
}
.hero-content p {
  display: inline-flex;
  margin: 0 0 10px;
  border-radius: var(--radius);
  padding: 5px 9px;
  background: rgba(239,63,95,.92);
  font-size: 13px;
}
.hero-content h1 {
  max-width: 680px;
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 0;
}
.hero-content span {
  display: block;
  max-width: 650px;
  color: rgba(255,255,255,.82);
  line-height: 1.7;
}
.hero-content button {
  margin-top: 18px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}
.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-tags button,
.chips span,
.rank-tabs span {
  border: 0;
  border-radius: var(--radius);
  padding: 7px 10px;
  color: #4c596b;
  background: #f0f2f6;
  font-size: 13px;
}
.search-tags button:hover { color: #fff; background: var(--primary); }
.update-box {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 13px;
  border-radius: var(--radius);
  background: #fff6f8;
}
.update-box b { color: var(--primary-dark); }
.update-box span {
  color: #5d6878;
  font-size: 13px;
}

.section {
  margin-bottom: 16px;
  padding: 16px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}
.section-head h2::before,
.rank-card h2::before,
.news-card h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--primary);
  vertical-align: -3px;
}
.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section-head a {
  color: var(--muted);
  font-size: 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.poster-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.poster-grid.large {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.poster-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 150px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.poster-rail::-webkit-scrollbar { height: 6px; }
.poster-rail::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #cfd5df;
}
.poster {
  min-width: 0;
  cursor: pointer;
}
.poster-img {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  background: #dfe4eb;
}
.poster-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .22s ease;
}
.poster:hover .poster-img img { transform: scale(1.045); }
.badge,
.score {
  position: absolute;
  top: 8px;
  border-radius: 6px;
  padding: 3px 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.badge {
  left: 8px;
  background: rgba(37,120,232,.92);
}
.score {
  right: 8px;
  background: rgba(239,63,95,.92);
}
.poster h3 {
  margin: 8px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.35;
}
.poster p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.side-column {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 16px;
}
.rank-card,
.news-card {
  padding: 16px;
}
.rank-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.rank-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rank-card li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.rank-card li:last-child { border-bottom: 0; }
.rank-card b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
}
.rank-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.rank-card li span {
  color: var(--muted);
  font-size: 12px;
}
.news-card {
  display: grid;
  gap: 10px;
}
.news-card a {
  color: #4d596a;
  line-height: 1.55;
  font-size: 14px;
}
.text-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.text-grid a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: #4d596a;
  background: #fafbfe;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(9, 13, 20, .78);
}
.modal.open { display: grid; }
.modal-card {
  position: relative;
  width: min(1080px, 100%);
  overflow: hidden;
  border-radius: var(--radius);
  background: #111722;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.45);
  font-size: 24px;
}
.modal-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  display: block;
  background: #000;
}
.modal-info {
  padding: 16px 18px 18px;
  color: #fff;
}
.modal-info p {
  margin: 0 0 6px;
  color: rgba(255,255,255,.62);
}
.modal-info h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.modal-info span {
  display: block;
  color: rgba(255,255,255,.76);
  line-height: 1.65;
}
.play-again {
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 15px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}
.footer {
  padding: 24px 16px 34px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .channel-panel,
  .quick-panel {
    display: grid;
  }
  .channel-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
  }
  .channel-panel h2 {
    grid-column: 1 / -1;
  }
  .channel-panel a {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
  }
  .content-layout {
    grid-template-columns: 1fr;
  }
  .side-column {
    position: static;
  }
  .poster-grid,
  .poster-grid.large {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .text-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main { padding: 12px; }
  .brand-text { font-size: 20px; }
  .top-nav {
    margin: 0 -16px;
    padding: 0 16px;
  }
  .hero-card,
  .hero-card img {
    min-height: 320px;
  }
  .hero-content {
    left: 18px;
    right: 18px;
    bottom: 20px;
  }
  .hero-content h1 {
    font-size: 28px;
  }
  .channel-panel {
    grid-template-columns: 1fr;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .chips {
    justify-content: flex-start;
  }
  .poster-grid,
  .poster-grid.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .header-tools {
    overflow-x: auto;
  }
  .text-grid {
    grid-template-columns: 1fr;
  }
  .poster-rail {
    grid-auto-columns: 120px;
  }
  .section {
    padding: 12px;
  }
  .poster h3 {
    font-size: 13px;
  }
  .modal {
    padding: 0;
  }
  .modal-card {
    width: 100%;
    border-radius: 0;
  }
}
