/* ==========================================================================
   苍穹之境 · 蓝调动漫与漫画展映馆 - 主题样式表 (Blue Horizon Anime CSS)
   基调：深海蓝 (Midnight Navy)、星环钴蓝 (Cobalt Blue)、电光青 (Electric Cyan)
   ========================================================================== */

:root {
  --bg-deep: #070d19;
  --bg-surface: #0c1628;
  --bg-surface-elevated: #11203b;
  --bg-card: rgba(15, 27, 49, 0.85);
  --bg-card-hover: rgba(21, 38, 70, 0.95);
  --border-subtle: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.45);
  --blue-primary: #0284c7;
  --blue-light: #38bdf8;
  --blue-glow: #00f0ff;
  --blue-accent: #2563eb;
  --cyan-accent: #06b6d4;
  --text-primary: #f0f6fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;
  --gold-star: #38bdf8;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "SF Pro Display", -apple-system, "PingFang SC", "Hiragino Sans GB", sans-serif;
}

/* Global Reset & Base */
body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(2, 132, 199, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 65%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #070d19 0%, #0a1324 50%, #070d19 100%);
  background-attachment: fixed;
}

/* Stardust Background Particles */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, .brand-font {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

a {
  color: var(--blue-light);
  text-decoration: none;
  transition: all 0.25s ease;
}

a:hover {
  color: var(--blue-glow);
}

/* Glassmorphism Header & Navigation */
.anime-navbar {
  background: rgba(7, 13, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.anime-navbar.scrolled {
  background: rgba(5, 10, 20, 0.96);
  border-bottom-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(2, 132, 199, 0.15);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.5);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}

.nav-link-anime {
  color: var(--text-secondary) !important;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color 0.25s ease;
}

.nav-link-anime:hover,
.nav-link-anime.active {
  color: #ffffff !important;
}

.nav-link-anime::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #00f0ff);
  transition: all 0.25s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-link-anime.active::after,
.nav-link-anime:hover::after {
  width: 60%;
}

/* Ambient Audio Synthesizer Button */
.btn-ambient-sound {
  background: rgba(15, 27, 49, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--blue-light);
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.btn-ambient-sound:hover,
.btn-ambient-sound.active {
  background: rgba(2, 132, 199, 0.2);
  border-color: var(--blue-light);
  color: #fff;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.sound-waves {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-waves span {
  width: 2px;
  height: 4px;
  background-color: currentColor;
  border-radius: 1px;
}

.btn-ambient-sound.active .sound-waves span:nth-child(1) {
  animation: wave 1s infinite ease-in-out;
}
.btn-ambient-sound.active .sound-waves span:nth-child(2) {
  animation: wave 1.2s infinite ease-in-out 0.2s;
}
.btn-ambient-sound.active .sound-waves span:nth-child(3) {
  animation: wave 0.8s infinite ease-in-out 0.4s;
}

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* Section Header Badges */
.section-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--blue-light);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-tag::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--blue-light);
}

/* Hero Cinema Showcase (Index) */
.hero-cinema {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.hero-backdrop-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: brightness(0.7) contrast(1.1) saturate(1.2);
  transform: scale(1.05);
  transition: transform 8s ease, opacity 0.8s ease;
  z-index: 1;
}

.hero-cinema:hover .hero-backdrop-img {
  transform: scale(1.08);
}

.hero-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #070d19 0%, rgba(7, 13, 25, 0.85) 45%, rgba(7, 13, 25, 0.4) 100%),
              linear-gradient(0deg, #070d19 0%, transparent 60%);
  z-index: 2;
}

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

/* Anime Visual Cards */
.anime-card-3d {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.anime-card-3d:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.2), 0 0 25px rgba(56, 189, 248, 0.15);
}

.anime-cover-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.anime-cover-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.anime-card-3d:hover .anime-cover-wrapper img {
  transform: scale(1.06);
}

.anime-cover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 22, 40, 0.95) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}

.score-badge {
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Custom Anime Buttons */
.btn-anime-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-anime-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.5);
  border-color: #38bdf8;
}

.btn-anime-outline {
  background: rgba(15, 27, 49, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-anime-outline:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--blue-light);
  color: var(--blue-light);
}

/* Dual Feature Section (Dual Pillars on Index) */
.dual-pillar-card {
  background: linear-gradient(160deg, rgba(17, 32, 59, 0.7) 0%, rgba(10, 20, 37, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

.dual-pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  opacity: 0.7;
}

.dual-pillar-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px rgba(2, 132, 199, 0.18);
  transform: translateY(-4px);
}

/* Detail Page Dossier Styling */
.dossier-cover-container {
  position: sticky;
  top: 90px;
}

.dossier-cover-img {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(2, 132, 199, 0.2);
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.character-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.character-card:hover,
.character-card.active {
  border-color: var(--blue-light);
  background: var(--bg-surface-elevated);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.18);
  transform: translateY(-4px);
}

.character-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.character-card.active .character-avatar {
  border-color: var(--blue-light);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Chapter List Grid */
.chapter-badge {
  background: rgba(15, 27, 49, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.chapter-badge:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: var(--blue-light);
  transform: translateX(4px);
  color: #fff;
}

/* Manga / Comic Reader & Gallery Specific */
.reader-toolbar {
  background: rgba(12, 22, 40, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 75px;
  z-index: 1020;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #00f0ff);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
}

.comic-panel-container {
  max-width: 900px;
  margin: 0 auto;
}

.comic-page-item {
  background: #000;
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 6px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: all 0.3s ease;
}

.comic-page-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.comic-page-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.comic-caption-bar {
  background: rgba(10, 19, 34, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
}

/* Single Page / Flip Mode Viewer */
.single-page-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
}

.single-page-img-wrapper {
  max-width: 820px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  background: #000;
}

.single-page-img-wrapper img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Dark Room / Paper Mode Filters */
.reader-filter-normal { filter: none; }
.reader-filter-high-contrast { filter: contrast(120%) brightness(95%); }
.reader-filter-sepia { filter: sepia(0.3) brightness(95%); }
.reader-filter-darkroom { filter: brightness(80%) contrast(110%); }

/* Lightbox Modal for Art Inspection */
.anime-lightbox {
  background: rgba(5, 10, 20, 0.95);
}

/* Footer Styling */
.anime-footer {
  background: #050a14;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
  position: relative;
  z-index: 10;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .hero-cinema {
    min-height: 65vh;
  }
  .dossier-cover-container {
    position: static;
    margin-bottom: 2rem;
  }
  .reader-toolbar {
    top: 65px;
    padding: 0.5rem 0.75rem;
  }
}
