/* ============================================================
   黄昏酒馆 Dusk Pub — Twilight Tavern Theme
   Sunset amber · Vintage browns · Lantern glow · Light dusk bg
   ============================================================ */

/* ========== CSS VARIABLES ========== */
:root {
  /* Colors — Twilight Tavern palette */
  --bg-dusk:        #faf5ee;      /* light warm parchment */
  --bg-warm:        #faf2e6;      /* slightly warmer variant */
  --bg-card:        #fffbf5;      /* card / section background */
  --bg-lantern:     #fff7e6;      /* lantern glow highlight */
  --bg-footer:      #3a2518;      /* deep vintage brown for footer */

  --primary:        #d4843a;      /* sunset amber */
  --primary-glow:   #e8923a;      /* brighter amber for hover */
  --primary-light:  #f7c78e;      /* soft amber highlight */
  --primary-pale:   #fef5e7;      /* very pale amber tint */

  --secondary:      #5c3d2e;      /* vintage brown */
  --secondary-alt:  #8b5e3c;      /* lighter wood brown */
  --accent:         #f4a442;      /* lantern glow gold */
  --accent-deep:    #c77a1a;      /* deeper amber for emphasis */

  --text-primary:   #3a2518;      /* dark brown for main text */
  --text-secondary: #6b4e3a;      /* medium brown */
  --text-muted:     #9b8170;      /* muted warm gray-brown */
  --text-inverse:   #faf5ee;      /* light on dark */

  --border-warm:    rgba(212, 132, 58, 0.2);
  --border-medium:  rgba(212, 132, 58, 0.35);
  --shadow-sm:      0 2px 8px rgba(58, 37, 24, 0.06);
  --shadow-md:      0 4px 16px rgba(58, 37, 24, 0.1);
  --shadow-lg:      0 8px 32px rgba(58, 37, 24, 0.12);
  --shadow-glow:    0 0 24px rgba(244, 164, 66, 0.25);

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  --font-display:   'Noto Serif SC', 'Source Han Serif SC', 'SimSun', 'STSong', Georgia, serif;
  --font-body:      'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --max-width:      1200px;
  --header-height:  72px;
  --transition:     0.25s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dusk);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--primary-glow);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 245, 238, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-warm);
  height: var(--header-height);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
}
.logo:hover {
  color: var(--primary);
}
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

/* Nav */
.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}
.nav-links a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-pale);
  color: var(--primary);
}

/* Header CTA */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 22px;
  border-radius: 24px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.header-cta:hover {
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(250, 245, 238, 0.25) 0%,
    rgba(250, 245, 238, 0.7) 60%,
    rgba(250, 245, 238, 1) 100%);
  z-index: 1;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px 80px;
  text-align: center;
}
.hero-tag {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 16px;
  line-height: 1.25;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.8;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-meta-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.hero-meta-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
}

/* CTA buttons in hero */
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(212, 132, 58, 0.35);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-pale);
  border-color: var(--primary-glow);
  color: var(--primary-glow);
}

/* ========== SECTIONS ========== */
.section {
  padding: 72px 24px;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-alt {
  padding-top: 0;
}

.section-label {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 16px;
  line-height: 1.3;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: 40px;
  line-height: 1.8;
}
.section-header-center {
  text-align: center;
}
.section-header-center .section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* ========== LANTERN DIVIDER ========== */
.lantern-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 48px;
  max-width: 360px;
}
.lantern-divider::before,
.lantern-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}
.lantern-glow {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(244, 164, 66, 0.6));
}

/* ========== FEATURE CARDS ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-pale);
  margin-bottom: 16px;
  font-size: 1.5rem;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== SCREENSHOT GALLERY ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-warm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-item:hover {
  transform: scale(1.025);
  box-shadow: var(--shadow-md);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(58, 37, 24, 0);
  transition: background var(--transition);
}
.gallery-item:hover::after {
  background: rgba(58, 37, 24, 0.08);
}

/* ========== REVIEW CARDS ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.review-card::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--primary-light);
  line-height: 0.5;
  display: block;
  margin-bottom: 8px;
}
.review-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}
.review-author {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.review-stars {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* ========== STORY / CONTENT PAGE ========== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 820px;
  margin: 0 auto;
}
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
.content-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-pale);
}
.content-card p {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 14px;
}
.content-card p:last-child {
  margin-bottom: 0;
}

/* ========== CHARACTER CARDS ========== */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.character-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.character-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg-lantern);
}
.character-info {
  padding: 20px 22px;
}
.character-info h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}
.character-role {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}
.character-info p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ========== GUIDE / TABLE SECTION ========== */
.guide-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}
.guide-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.guide-table thead th {
  background: var(--secondary);
  color: var(--text-inverse);
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
}
.guide-table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
.guide-table thead th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}
.guide-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-warm);
  color: var(--text-secondary);
}
.guide-table tbody tr:hover td {
  background: var(--primary-pale);
}
.guide-table tbody tr:last-child td {
  border-bottom: none;
}
.guide-table tbody tr:nth-child(even) td {
  background: var(--bg-warm);
}
.guide-table tbody tr:nth-child(even):hover td {
  background: var(--primary-pale);
}

/* Guide cards */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow var(--transition);
}
.guide-card:hover {
  box-shadow: var(--shadow-md);
}
.guide-card .guide-emoji {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}
.guide-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
}
.guide-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== FAQ ACCORDION ========== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover {
  box-shadow: var(--shadow-sm);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--secondary);
  text-align: left;
  gap: 12px;
}
.faq-question:hover {
  background: var(--primary-pale);
}
.faq-icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  line-height: 1;
  transition: transform var(--transition);
  color: var(--primary);
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-answer-inner {
  padding: 0 24px 18px;
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ========== CTA BANNER ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--secondary), #4a2e1e);
  color: var(--text-inverse);
  padding: 56px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(244, 164, 66, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(212, 132, 58, 0.1) 0%, transparent 50%);
  z-index: 1;
}
.cta-banner-inner {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.cta-banner p {
  font-size: 1rem;
  margin-bottom: 28px;
  opacity: 0.85;
  line-height: 1.7;
}

/* ========== PAGE HERO (non-index pages) ========== */
.page-hero {
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
}
.page-hero .page-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--bg-footer);
  color: rgba(250, 245, 238, 0.65);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}
.site-footer p {
  line-height: 1.6;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(58, 37, 24, 0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  font-size: 2.2rem;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
  z-index: 1001;
}
.lightbox-close:hover {
  opacity: 1;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  z-index: 1001;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev {
  left: 24px;
}
.lightbox-next {
  right: 24px;
}

/* ========== UTILITY CLASSES ========== */
.prose {
  max-width: 800px;
  margin: 0 auto;
}
.section-alt {
  padding-top: 0;
}
.text-center {
  text-align: center;
}

/* ========== HERO PAGE-SPECIFIC BACKGROUNDS ========== */
.hero-home .hero-bg,
.hero-guide .hero-bg,
.hero-characters .hero-bg,
.hero-story .hero-bg,
.hero-faq .hero-bg {
  background-image: url('../img/hero.webp');
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 245, 238, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-warm);
    padding: 12px 0;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 12px 24px;
    border-radius: 0;
    font-size: 1rem;
  }

  .hamburger {
    display: flex;
  }

  .hero-inner {
    padding: 60px 20px 48px;
  }
  .hero-meta {
    gap: 20px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .features-grid,
  .reviews-grid,
  .characters-grid,
  .guide-cards {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 20px;
  }

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

  .lightbox-nav {
    padding: 8px 12px;
    font-size: 1.5rem;
  }
  .lightbox-prev {
    left: 12px;
  }
  .lightbox-next {
    right: 12px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .site-header .header-cta {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.88rem;
  }
}
