:root {
  --bg: #eef1fb;
  --panel: #ffffff;
  --ink: #1f2338;
  --muted: #7b819d;
  --primary: #6b5cff;
  --primary-dark: #4b3ed1;
  --accent: #27d1b4;
  --line: #e7eaf6;
  --header-a: #1a1436;
  --header-b: #2a1f58;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% -10%, #f7f8ff 0%, var(--bg) 48%, #e8edfb 100%);
}

a {
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 6px 20px rgba(20, 18, 46, 0.18);
}

.site-header .navbar {
  background: linear-gradient(92deg, var(--header-a), var(--header-b));
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #3f77ff);
  position: relative;
  box-shadow: 0 8px 18px rgba(39, 209, 180, 0.35);
}

.brand-mark::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 9px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
}

.brand-text {
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.82);
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box .form-control {
  min-width: 260px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.search-box .form-control::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.search-box .form-control:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.btn-search,
.user-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-search:hover,
.user-btn:hover,
.user-btn:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.mobile-nav {
  background: linear-gradient(180deg, #1d1640, #120f2c);
  color: #fff;
}

.mobile-nav .nav-link {
  color: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 0.58rem 0.72rem;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
}

.mobile-search .form-control {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.filter-box,
.library-box,
.friends-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(30, 38, 80, 0.07);
}

.filter-box {
  padding: 12px 16px;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.filter-label {
  width: 72px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 34px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #f8f9ff;
  color: #4f5678;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.88rem;
  line-height: 1.2;
  transition: 0.2s ease;
}

.filter-chip:hover {
  border-color: rgba(107, 92, 255, 0.4);
  color: var(--primary);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--primary), #8a6dff);
  border-color: transparent;
  color: #fff;
}

.section-title {
  font-size: 1.18rem;
  margin-bottom: 12px;
  font-weight: 700;
  color: #2a2f48;
}

.featured-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(26, 32, 67, 0.1);
}

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

.featured-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  color: #fff;
  background: linear-gradient(180deg, rgba(10, 12, 24, 0), rgba(10, 12, 24, 0.86));
}

.featured-kicker {
  margin-bottom: 5px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #b5f6eb;
}

.featured-overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 3px;
}

.featured-overlay span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.84);
}

.library-box {
  padding: 14px 16px 18px;
}

.sort-toolbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.sort-btn {
  border: 1px solid var(--line);
  background: #f8f9ff;
  color: #4f5678;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.88rem;
  transition: 0.2s ease;
}

.sort-btn:hover {
  border-color: rgba(107, 92, 255, 0.4);
  color: var(--primary);
}

.sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.movie-link {
  display: block;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
}

.poster-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #dce1f2;
}

.poster-frame img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.movie-link:hover .poster-frame img {
  transform: scale(1.05);
}

.badge-hd {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 5px 6px;
}

.movie-body {
  padding-top: 9px;
}

.movie-title {
  margin-bottom: 5px;
  font-size: 0.96rem;
  font-weight: 600;
  color: #262b44;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.77rem;
  color: #8b90ab;
}

.movie-foot .score {
  color: #f39200;
  font-weight: 700;
}

.pagination .page-link {
  border-color: var(--line);
  color: #4c5377;
}

.pagination .page-link:hover {
  color: var(--primary);
  border-color: rgba(107, 92, 255, 0.5);
  background: #f5f3ff;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.friends-box {
  padding: 16px;
}

.friends-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.friends-wrap a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  color: #4f5678;
  background: #fbfcff;
  transition: 0.2s ease;
}

.friends-wrap a:hover {
  color: var(--primary);
  border-color: rgba(107, 92, 255, 0.5);
  transform: translateY(-1px);
}

.site-footer {
  padding: 24px 0;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(100deg, #161130, #20184a);
}

.footer-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.footer-links a,
.site-footer p,
.site-footer p a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

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

.footer-top {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.quick-tools {
  position: fixed;
  right: 18px;
  bottom: 20px;
  gap: 10px;
  z-index: 1035;
}

.tool-btn {
  border: 1px solid #d9ddf0;
  background: #fff;
  color: #4e5578;
  width: 52px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(33, 37, 66, 0.1);
  font-size: 0.8rem;
  transition: 0.2s ease;
}

.tool-btn:hover {
  border-color: rgba(107, 92, 255, 0.5);
  color: var(--primary);
}

#backTop {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

#backTop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.modal-content {
  border-radius: 14px;
  border: 1px solid var(--line);
}

@media (max-width: 991.98px) {
  .filter-row {
    flex-direction: column;
    gap: 6px;
  }

  .filter-label {
    width: auto;
    line-height: 1.3;
  }

  .featured-card img {
    height: 160px;
  }

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

@media (max-width: 767.98px) {
  .section-title {
    font-size: 1.05rem;
  }

  .filter-box,
  .library-box,
  .friends-box {
    border-radius: 12px;
  }

  .featured-card img {
    height: 150px;
  }

  .movie-title {
    font-size: 0.92rem;
  }

  .movie-meta,
  .movie-foot {
    font-size: 0.76rem;
  }

  .friends-wrap {
    grid-template-columns: 1fr;
  }
}