:root {
  --bg: #0d1420;
  --panel: #121a2a;
  --panel-deep: #080c14;
  --text: #c8d4e0;
  --muted: #8898b8;
  --blue: #4da8f8;
  --blue-soft: #80c8ff;
  --line: #1a2a3a;
  --gold: #ffd54f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
input,
textarea {
  font: inherit;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 22px;
  padding: 9px clamp(18px, 4vw, 42px);
  background: rgba(13, 20, 32, .97);
  border-bottom: 2px solid var(--blue);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .65);
  backdrop-filter: blur(18px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 50px;
  height: 50px;
  border: 2px solid var(--blue);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 22px rgba(77, 168, 248, .38);
}

.logo-text {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  margin-left: 4px;
}

.top-search {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 64px;
  height: 38px;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid #2a3a50;
  border-radius: 999px;
  background: rgba(8, 12, 20, .82);
}

.top-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 13px;
  color: var(--text);
  background: transparent;
}

.top-search button {
  border: 0;
  color: #07111f;
  background: var(--blue-soft);
  font-weight: 800;
  cursor: pointer;
}

.nav-links a {
  color: var(--blue-soft);
  font-weight: 600;
  border: 1.6px solid var(--blue);
  border-radius: 24px;
  padding: 7px 22px;
  font-size: 16px;
}

.nav-links a:hover {
  color: var(--bg);
  background: var(--blue);
}

.hamburger {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

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

.hero {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: 42px;
  padding: 48px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: radial-gradient(ellipse at 30% 40%, #152030 5%, var(--bg) 85%);
  box-shadow: 0 22px 45px rgba(0, 0, 0, .6);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/img/hero-space.jpg") center/cover;
  opacity: .16;
}

.hero::after {
  content: "";
  position: absolute;
  left: -35px;
  bottom: -35px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 168, 248, .22), transparent 70%);
}

.hero h1,
.hero p,
.search-box {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  color: var(--blue-soft);
  font-size: clamp(38px, 6vw, 58px);
  letter-spacing: 3px;
  text-shadow: 0 0 35px rgba(77, 168, 248, .4);
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  width: min(560px, 100%);
  height: 48px;
  overflow: hidden;
  border: 1px solid #2a3a50;
  border-radius: 24px;
  background: rgba(13, 20, 32, .84);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 18px;
  color: var(--text);
  background: transparent;
}

.search-box button,
.submit-btn,
.card-btn {
  cursor: pointer;
}

.search-box button {
  border: 0;
  color: #07111f;
  background: var(--blue-soft);
  font-weight: 800;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 10px;
  padding-left: 0;
  border-left: 0;
  color: var(--blue-soft);
  font-size: 30px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.more-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.more-link:hover {
  color: var(--blue-soft);
}

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

.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 34px -10px rgba(0, 0, 0, .6);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  z-index: 2;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--blue);
  box-shadow: 0 24px 46px -12px rgba(77, 168, 248, .35);
}

.card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  display: block;
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 4px 11px;
  border-radius: 16px;
  color: var(--gold);
  background: rgba(0, 0, 0, .78);
  font-size: 13px;
  font-weight: 800;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 13px 12px 15px;
}

.card-body h3 {
  margin: 0 0 7px;
  color: #d0ddf0;
  width: 100%;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body p {
  flex: 1;
  width: 100%;
  margin: 0 0 12px;
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.6px solid var(--blue);
  border-radius: 24px;
  padding: 8px 24px;
  color: var(--blue-soft);
  background: transparent;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.home-intro {
  margin: -14px 0 -4px;
}

.home-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabs button,
.pager button,
.primary-btn {
  border: 1px solid #2a3a50;
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--text);
  background: rgba(18, 26, 42, .9);
  cursor: pointer;
}

.tabs button.active,
.pager button:hover,
.primary-btn {
  border-color: var(--blue);
  color: #07111f;
  background: var(--blue-soft);
  font-weight: 800;
}

.update-time {
  color: var(--muted);
  font-size: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
}

.detail {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: var(--panel);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
}

.detail-info h1,
.player-page h1 {
  margin: 0 0 14px;
  color: var(--blue-soft);
  font-size: 30px;
  line-height: 1.25;
}

.detail-info p {
  margin: 8px 0;
  color: var(--muted);
}

.detail-info .desc {
  max-width: 900px;
  color: var(--text);
}

.primary-btn {
  display: inline-flex;
  margin-top: 16px;
}

.player-page {
  display: grid;
  gap: 18px;
}

.player-page h1 span {
  color: var(--muted);
  font-size: 18px;
}

.player-page video {
  width: 100%;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #000;
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.episode-list a {
  border: 1px solid #2a3a50;
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--text);
  background: var(--panel);
}

.episode-list a.active {
  border-color: var(--blue);
  color: #07111f;
  background: var(--blue-soft);
  font-weight: 800;
}

.source-line {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.card-btn:hover {
  color: var(--bg);
  background: var(--blue);
}

.comment-section {
  margin-top: 54px;
  padding: 34px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

.comment-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--blue-soft);
}

.comment-form {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.form-row input,
.form-row textarea {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid #2a3a50;
  border-radius: 22px;
  outline: 0;
  padding: 13px 18px;
  color: var(--text);
  background: var(--bg);
}

.form-row textarea {
  min-height: 86px;
  resize: vertical;
}

.submit-btn {
  justify-self: start;
  border: 0;
  border-radius: 26px;
  padding: 12px 28px;
  color: #fff;
  background: #3080d0;
  font-weight: 800;
}

.comments-list {
  display: grid;
  gap: 18px;
}

.comment-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}

.comment-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid #2a4060;
  border-radius: 50%;
  object-fit: cover;
}

.comment-name {
  margin-bottom: 3px;
  color: var(--blue-soft);
  font-weight: 800;
}

.comment-text {
  color: var(--muted);
  font-size: 15px;
}

.footer {
  display: grid;
  gap: 6px;
  text-align: center;
  padding: 28px 16px;
  border-top: 2px solid var(--blue);
  color: #6878a0;
  background: var(--panel-deep);
}

.footer p {
  margin: 0;
}

@media (max-width: 768px) {
  .navbar {
    gap: 8px 10px;
    padding: 6px 12px;
  }

  .logo-area {
    flex: 0 0 auto;
    gap: 8px;
  }

  .logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .logo-text {
    font-size: 19px;
    letter-spacing: 0;
  }

  .nav-links {
    order: 3;
    display: flex;
    width: 100%;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    margin-left: 0;
    padding-top: 2px;
  }

  .nav-links a {
    padding: 5px 14px;
    font-size: 15px;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .top-search {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    height: 34px;
    grid-template-columns: minmax(0, 1fr) 54px;
    margin-left: auto;
  }

  .top-search input {
    padding: 0 10px;
    font-size: 13px;
  }

  .top-search button {
    font-size: 13px;
    white-space: nowrap;
  }

  .hero {
    border-radius: 18px;
  }

  .search-box {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    gap: 10px;
    border: 0;
    background: transparent;
  }

  .search-box input,
  .search-box button {
    height: 46px;
    border-radius: 23px;
  }

  .search-box input {
    border: 1px solid #2a3a50;
    background: rgba(13, 20, 32, .84);
  }

  .section-title {
    font-size: 25px;
  }

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

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .detail {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .detail-poster {
    max-width: 260px;
  }

  .detail-info h1,
  .player-page h1 {
    font-size: 24px;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
