* {
  box-sizing: border-box;
}

:root {
  --bg: #0a1020;
  --bg-soft: #101935;
  --card: #121f3d;
  --text: #e8edff;
  --muted: #9aa7c6;
  --accent: #47e5d8;
  --accent-2: #8f6bff;
  --line: rgba(255, 255, 255, 0.12);
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 15% 15%, #182a52 0%, var(--bg) 45%), var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.55;
}

a {
  text-decoration: none;
}

.topline {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.85);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0;
}

.main-nav {
  background: rgba(10, 16, 32, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(71, 229, 216, 0.55);
}

.brand-text {
  color: #ffffff;
  letter-spacing: 0.3px;
}

.nav-link {
  color: #d9e0f5 !important;
}

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

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.search-form {
  gap: 0.5rem;
}

.search-form .form-control {
  background: #0e1732;
  border: 1px solid #25345f;
  color: #dfe6ff;
}

.search-form .form-control::placeholder {
  color: #7786ad;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #27c6ba);
  border: 0;
  color: #04111f;
  font-weight: 600;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #59efe2, #36d6c9);
  color: #04111f;
}

.hero-carousel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}

.hero-carousel img {
  height: 430px;
  object-fit: cover;
  filter: saturate(1.05);
}

.carousel-caption {
  left: 7%;
  right: 7%;
  bottom: 2.2rem;
}

.carousel-caption h1,
.carousel-caption h2 {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  margin-bottom: 0.6rem;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.carousel-caption p {
  max-width: 85%;
  color: #d5def8;
  margin-bottom: 1rem;
}

.chip {
  display: inline-block;
  background: rgba(71, 229, 216, 0.16);
  color: var(--accent);
  border: 1px solid rgba(71, 229, 216, 0.45);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
}

.rank-panel {
  background: linear-gradient(180deg, #132246, #0f1a35);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
}

.rank-panel small {
  color: var(--muted);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.58rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  gap: 0.75rem;
}

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

.rank-list span {
  color: #dde5ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.genre-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.genre-pill {
  text-align: center;
  color: #d8e0fb;
  background: rgba(20, 35, 70, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.8rem;
  padding: 0.68rem 0.6rem;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.genre-pill:hover {
  border-color: rgba(71, 229, 216, 0.45);
  color: var(--accent);
  transform: translateY(-2px);
}

.content-section {
  padding: 2.75rem 0;
}

.content-section.alt {
  background: rgba(8, 14, 28, 0.42);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-head h2 {
  font-size: 1.28rem;
  margin: 0;
}

.more-link {
  color: var(--accent);
  font-size: 0.92rem;
}

.media-card {
  position: relative;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.media-card:hover {
  transform: translateY(-5px);
  border-color: rgba(71, 229, 216, 0.45);
  box-shadow: 0 12px 24px rgba(5, 11, 23, 0.45);
}

.media-card img {
  width: 100%;
  height: 228px;
  object-fit: cover;
  display: block;
}

.media-card .info {
  padding: 0.62rem 0.68rem 0.72rem;
}

.media-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.media-card .label {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: linear-gradient(135deg, #ff5fa0, #ff7d53);
  color: #fff;
  font-size: 0.68rem;
  padding: 0.18rem 0.45rem;
  border-radius: 0.35rem;
  letter-spacing: 0.2px;
}

.news-card {
  height: 100%;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0.9rem;
  overflow: hidden;
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-body {
  padding: 0.9rem;
}

.news-body h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.55rem;
}

.news-body p {
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.news-body small {
  color: #7fd7cf;
}

.cta-box {
  background: linear-gradient(135deg, rgba(71, 229, 216, 0.14), rgba(143, 107, 255, 0.2));
  border: 1px solid rgba(137, 183, 255, 0.3);
  border-radius: 1rem;
  text-align: center;
  padding: 2rem 1rem;
}

.custom-accordion .accordion-item {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-accordion .accordion-button {
  background: #142446;
  color: #e8edff;
}

.custom-accordion .accordion-button:not(.collapsed) {
  background: #1a2e59;
  color: #ffffff;
  box-shadow: none;
}

.custom-accordion .accordion-body {
  color: #cfd7f4;
}

.friend-section {
  padding-top: 1.8rem;
}

.friend-links-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.friend-links-wrap a {
  display: block;
  text-align: center;
  background: #0f1c39;
  color: #cfe4ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.7rem;
  padding: 0.65rem 0.45rem;
}

.friend-links-wrap a:hover {
  color: var(--accent);
  border-color: rgba(71, 229, 216, 0.42);
}

.site-footer {
  background: #080d19;
  border-top: 1px solid var(--line);
}

.footer-brand {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.55rem;
}

.site-footer p,
.site-footer small {
  color: var(--muted);
}

.footer-link {
  color: #c9d6fd;
  display: inline-block;
  margin-bottom: 0.55rem;
}

.footer-link:hover {
  color: var(--accent);
}

.back-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05111f;
  font-weight: 700;
  display: none;
  z-index: 1100;
}

.back-top.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #121f3d;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.modal-header,
.modal-footer {
  border-color: rgba(255, 255, 255, 0.12);
}

.modal .form-control {
  background: #0d1730;
  border: 1px solid #31477f;
  color: #eef3ff;
}

@media (max-width: 991.98px) {
  .hero-carousel img {
    height: 360px;
  }

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

@media (max-width: 767.98px) {
  .hero-carousel img {
    height: 290px;
  }

  .carousel-caption {
    bottom: 1.2rem;
  }

  .carousel-caption p {
    max-width: 100%;
    font-size: 0.86rem;
  }

  .media-card img {
    height: 200px;
  }

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