/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e8e8ed;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-warm: #fa5c6b;
  --border: #d2d2d7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
  --nav-height: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background var(--transition), border-color var(--transition);
}

.nav.scrolled {
  background: rgba(255,255,255,0.88);
  border-bottom-color: rgba(0,0,0,0.12);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #fa5c6b, #f098a0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 450;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* ===== Hero Section ===== */
.hero {
  margin-top: var(--nav-height);
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  max-height: 85vh;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 6s ease;
}

.hero:hover img {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 80px 40px 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  text-align: center;
}

.hero-overlay h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.hero-overlay p {
  font-size: 1.15rem;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* ===== Section Common ===== */
.section {
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-warm);
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== Character Cards Grid ===== */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.char-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: block;
  color: inherit;
}

.char-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.char-card-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.char-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.char-card:hover .char-card-img img {
  transform: scale(1.08);
}

.char-card-body {
  padding: 16px 14px;
  text-align: center;
}

.char-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.char-card-body .role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Co-creators Section ===== */
.creators-section {
  background: var(--bg-secondary);
}

.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.creator-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.creator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.creator-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.creator-info .stats {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.creator-info .douyin-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--text-primary);
}

/* ===== Character Detail Page ===== */
.detail-hero {
  margin-top: var(--nav-height);
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50vh;
  min-height: 320px;
  max-height: 500px;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.detail-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 40px 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  text-align: center;
}

.detail-hero-overlay h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.detail-hero-overlay .jp-name {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* ===== Bio Content ===== */
.bio-section {
  padding: 64px 24px;
}

.bio-container {
  max-width: 780px;
  margin: 0 auto;
}

.bio-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.bio-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-secondary);
}

.bio-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-warm);
  margin-top: 32px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.bio-card h3:first-of-type {
  margin-top: 24px;
}

.bio-card p {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.bio-card .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 32px;
  margin: 16px 0;
}

.bio-card .info-item {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.bio-card .info-item .label {
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}

.bio-card .info-item .value {
  color: var(--text-primary);
}

/* ===== Gallery Section ===== */
.gallery-section {
  padding: 0 24px 80px;
}

.gallery-section h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 40px;
}

.gallery {
  max-width: 1100px;
  margin: 0 auto;
  columns: 3;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  transform: scale(0.9);
  transition: transform var(--transition);
}

.lightbox.open img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition);
  backdrop-filter: blur(10px);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ===== Back Button ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
  transition: gap var(--transition), color var(--transition);
}

.back-btn:hover {
  gap: 10px;
  color: var(--accent-hover);
}

.back-btn .arrow {
  font-size: 1.1rem;
  line-height: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero {
    min-height: 40vh;
    max-height: 55vh;
  }

  .detail-hero {
    height: 30vh;
    min-height: 220px;
  }

  .section {
    padding: 48px 16px;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .characters-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
	    max-width: 540px;
  }

  .gallery {
    columns: 2;
    column-gap: 10px;
  }

  .gallery-item {
    margin-bottom: 10px;
  }

  .bio-card {
    padding: 24px 20px;
  }

  .nav-links {
    gap: 18px;
  }

  .creators-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .characters-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
	    max-width: 400px;
  }

  .gallery {
    columns: 1;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.75rem;
  }
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeUp 0.7s ease forwards;
}

.animate-stagger > * {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(9) { animation-delay: 0.45s; }
.animate-stagger > *:nth-child(10) { animation-delay: 0.5s; }

/* ===== Selection ===== */
::selection {
  background: rgba(250, 92, 107, 0.25);
  color: var(--text-primary);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3);
}
