:root {
  --bg: #f4f7ff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #667085;
  --primary: #7b4dff;
  --secondary: #00b8d9;
  --accent: #ff7a59;
  --line: #e8ecff;
  --shadow: 0 12px 35px rgba(34, 50, 84, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(circle at 10% 0%, #eff7ff 0%, transparent 35%), radial-gradient(circle at 90% 15%, #f4eefe 0%, transparent 30%), var(--bg);
}

a {
  text-decoration: none;
}

.site-header .navbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  transition: all 0.28s ease;
}

.site-header.scrolled .navbar {
  box-shadow: 0 8px 26px rgba(22, 34, 66, 0.1);
}

.brand-mark,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 18px rgba(123, 77, 255, 0.35);
}

.brand-name {
  font-size: 1.04rem;
  letter-spacing: 0.2px;
}

.navbar .nav-link {
  color: #344054;
  font-weight: 500;
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--primary);
  background: #f2efff;
}

.dropdown-menu {
  border-radius: 12px;
}

.btn-gradient {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 22px rgba(106, 81, 241, 0.3);
}

.btn-gradient:hover {
  color: #fff;
  filter: brightness(1.03);
}

.hero-section {
  position: relative;
}

.hero-section .carousel-item {
  height: 520px;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 11, 24, 0.78), rgba(5, 11, 24, 0.25));
}

.carousel-caption {
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 20%;
  text-align: left;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  margin-bottom: 0.8rem;
}

.carousel-caption h1,
.carousel-caption h2 {
  max-width: 700px;
  font-size: clamp(1.6rem, 2.8vw, 2.7rem);
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.carousel-caption p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  margin-bottom: 1.15rem;
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
}

.search-wrap {
  position: relative;
  margin-top: -46px;
  z-index: 5;
}

.search-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}

.search-card h2 {
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  margin-bottom: 0.45rem;
}

.search-card p {
  color: var(--muted);
}

.search-form .form-control {
  border-radius: 12px 0 0 12px;
  border-color: #d8defa;
}

.search-form .btn {
  border-radius: 0 12px 12px 0;
}

.hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hot-tags a {
  font-size: 0.82rem;
  color: #4b3fb3;
  background: #f3f0ff;
  border: 1px solid #e5ddff;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
}

.section-block {
  margin-top: 2.9rem;
}

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

.section-sub {
  margin-bottom: 0.28rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--secondary);
  font-weight: 700;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.22rem, 1.9vw, 1.7rem);
}

.more-link {
  color: var(--primary);
  font-weight: 600;
}

.movie-card,
.library-card,
.article-card,
.topic-panel,
.rank-panel,
.friend-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.movie-card,
.library-card {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.library-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(38, 56, 92, 0.14);
}

.poster-wrap {
  position: relative;
}

.movie-card img,
.library-card img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.movie-card img {
  height: 235px;
}

.library-card img {
  height: 205px;
}

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: #fff;
  background: linear-gradient(135deg, #ff914d, #ff5e62);
  padding: 0.22rem 0.48rem;
}

.movie-card h3,
.library-card h3,
.article-card h3,
.topic-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.movie-card p,
.article-card p,
.topic-item p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.meta-line {
  color: #6d6f88;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.tag-row span {
  font-size: 0.76rem;
  color: #3e52a2;
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  background: #ecf1ff;
}

.btn-light-primary {
  border: 1px solid #d9defd;
  color: #5146c0;
  background: #f5f3ff;
  font-weight: 600;
}

.topic-panel {
  padding: 1.25rem;
}

.topic-intro {
  color: var(--muted);
  margin-bottom: 1rem;
}

.topic-item {
  border: 1px solid #e9edff;
  border-radius: 12px;
  padding: 0.8rem;
  height: 100%;
  background: #fbfcff;
}

.topic-item span {
  font-size: 0.8rem;
  color: #5a5fa8;
}

.rank-panel {
  padding: 1.1rem;
}

.rank-panel h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.rank-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.58rem 0;
  border-bottom: 1px dashed #e2e8ff;
}

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

.rank-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.rank-meta a {
  color: var(--text);
  font-weight: 600;
}

.rank-meta small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.rank-list strong {
  color: #ff7a59;
  font-size: 0.95rem;
}

.library-card p {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.library-card span {
  font-size: 0.78rem;
  color: #5258a8;
}

.article-card {
  padding: 0.85rem;
  display: flex;
  gap: 0.85rem;
}

.article-thumb {
  width: 118px;
  min-width: 118px;
  height: 118px;
  border-radius: 12px;
  object-fit: cover;
}

.article-card span {
  font-size: 0.82rem;
  color: #5a66a8;
}

.faq-accordion .accordion-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.faq-accordion .accordion-button {
  font-weight: 600;
}

.faq-accordion .accordion-button:not(.collapsed) {
  color: var(--primary);
  background: #f5f2ff;
  box-shadow: none;
}

.friend-box {
  padding: 1.2rem;
}

.friend-link {
  text-align: center;
  color: #35408f;
  background: #f4f6ff;
  border: 1px solid #e2e8ff;
  border-radius: 12px;
  padding: 0.68rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.friend-link:hover {
  transform: translateY(-2px);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
}

.site-footer {
  background: linear-gradient(180deg, #131a2e, #0d1324);
  color: rgba(255, 255, 255, 0.9);
  padding: 2.2rem 0 1.4rem;
}

.site-footer .footer-brand {
  color: #fff;
  margin-bottom: 0.85rem;
}

.footer-text {
  color: rgba(255, 255, 255, 0.72);
  max-width: 460px;
}

.site-footer h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.footer-links li {
  margin-bottom: 0.42rem;
}

.footer-links a,
.footer-bottom a {
  color: rgba(255, 255, 255, 0.85);
}

.footer-links a:hover,
.footer-bottom a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 20px rgba(58, 70, 130, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 30;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.modal-content {
  border-radius: 16px;
  border: 1px solid #eaecff;
}

@media (max-width: 991.98px) {
  .hero-section .carousel-item {
    height: 430px;
  }

  .carousel-caption {
    bottom: 16%;
  }

  .search-wrap {
    margin-top: -34px;
  }

  .article-card {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
    height: 180px;
    min-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .hero-section .carousel-item {
    height: 360px;
  }

  .carousel-caption p {
    font-size: 0.92rem;
  }

  .search-card {
    border-radius: 16px;
    padding: 1rem;
  }

  .movie-card img,
  .library-card img {
    height: 190px;
  }
}