:root {
  --bg: #0F0F23;
  --surface: #1a1a2e;
  --surface-hover: #22223a;
  --primary: #1E1B4B;
  --secondary: #4338CA;
  --accent: #22C55E;
  --accent-glow: rgba(34, 197, 94, 0.25);
  --cta: #22C55E;
  --text: #F8FAFC;
  --text-secondary: #9a9ab0;
  --text-muted: #6b6b80;
  --border: #2a2a3e;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 200ms ease-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ Navbar ============ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--cta);
}

.logo-text {
  font-family: 'Righteous', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 1px;
}

/* ============ Search ============ */
.search-box {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 2.5rem 0.55rem 2.5rem;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.3);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
  transition: color var(--transition);
}

.search-clear.visible { display: block; }
.search-clear:hover { color: var(--text); }
.search-clear svg { width: 16px; height: 16px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 7rem 1.25rem 3rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(67, 56, 202, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(30, 27, 75, 0.4) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-family: 'Righteous', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
}

/* ============ Section Header ============ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-badge.movie { background: #e94560; color: #fff; }
.section-badge.tv { background: var(--secondary); color: #fff; }
.section-badge.anime { background: #7c3aed; color: #fff; }

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
}

/* ============ Carousel ============ */
.carousel-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.carousel-controls {
  display: flex;
  gap: 0.4rem;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.carousel-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--secondary);
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
}

.carousel-track-wrapper {
  overflow: hidden;
  border-radius: var(--radius-lg);
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 400ms ease-out;
  will-change: transform;
}

/* Carousel Card */
.carousel-card {
  flex-shrink: 0;
  width: 240px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 300ms ease-out, border-color var(--transition), box-shadow 300ms ease-out;
}

.carousel-card:hover {
  transform: translateY(-4px);
  border-color: var(--cta);
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.15);
}

.carousel-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--border);
}

.carousel-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease-out;
}

.carousel-card:hover .carousel-poster { transform: scale(1.05); }

.carousel-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.carousel-poster-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.carousel-drive-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.carousel-drive-badge.baidu { background: rgba(43, 95, 173, 0.9); color: #fff; }
.carousel-drive-badge.quark { background: rgba(139, 92, 246, 0.9); color: #fff; }

/* 多网盘徽章 */
.carousel-drive-badge.multi-drive {
  display: flex;
  gap: 4px;
  padding: 0.2rem 0.4rem;
  background: rgba(0, 0, 0, 0.7);
}

.carousel-drive-badge .drive-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}

.carousel-drive-badge .drive-dot.baidu { background: #2b5fad; color: #fff; }
.carousel-drive-badge .drive-dot.quark { background: #8B5CF6; color: #fff; }

.carousel-card-body { padding: 0.7rem 0.75rem; }

.carousel-card-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Wall Section ============ */
.wall-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.wall-filters {
  display: flex;
  gap: 0.4rem;
}

.wall-filter {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
  font-family: inherit;
}

.wall-filter:hover { color: var(--text); border-color: var(--secondary); }

.wall-filter.active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Wall Card */
.wall-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 300ms ease-out, border-color var(--transition), box-shadow 300ms ease-out;
}

.wall-card:hover {
  transform: translateY(-4px);
  border-color: var(--cta);
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.15);
}

.wall-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--border);
}

.wall-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease-out;
}

.wall-card:hover .wall-poster { transform: scale(1.05); }

.wall-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.wall-poster-placeholder svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.wall-drive-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.wall-drive-badge.baidu { background: rgba(43, 95, 173, 0.9); color: #fff; }
.wall-drive-badge.quark { background: rgba(139, 92, 246, 0.9); color: #fff; }

/* 影视墙多网盘徽章 */
.wall-drive-badge.multi-drive {
  display: flex;
  gap: 3px;
  padding: 0.15rem 0.3rem;
  background: rgba(0, 0, 0, 0.7);
}

.wall-drive-badge .drive-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
}

.wall-drive-badge .drive-dot.baidu { background: #2b5fad; color: #fff; }
.wall-drive-badge .drive-dot.quark { background: #8B5CF6; color: #fff; }

.wall-type-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.wall-card-body { padding: 0.6rem 0.65rem; }

.wall-card-title {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ No Results ============ */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.no-results svg {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.no-results p { font-size: 0.9rem; }

/* ============ Search Overlay ============ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  overflow-y: auto;
  padding: 5rem 1.25rem 2rem;
  display: none;
}

.search-overlay.active { display: block; }

.search-results-header {
  max-width: 1280px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-results-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.search-close-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.search-close-btn:hover { color: var(--text); border-color: var(--secondary); }
.search-close-btn svg { width: 18px; height: 18px; }

/* ============ Footer ============ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .carousel-card { width: 200px; }
}

@media (max-width: 768px) {
  .hero { padding: 6rem 1rem 2rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.85rem; }
  .carousel-card { width: 170px; }
  .wall-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
  .navbar-inner { padding: 0.6rem 1rem; }
  .logo-text { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.4rem; }
  .carousel-card { width: 150px; }
  .carousel-card-body { padding: 0.5rem; }
  .carousel-card-title { font-size: 0.75rem; }
  .wall-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .wall-card-body { padding: 0.45rem; }
  .wall-card-title { font-size: 0.72rem; }
  .search-box { max-width: 200px; }
}

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
