/* ============================================================
   夏日传说 (Summertime Saga) — Summer Saga Epic Tale Theme
   Palette: storybook-creams + adventure-map browns on parchment
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  /* Parchment backgrounds */
  --bg: #faf5ed;
  --bg-cream: #fdf5e6;
  --bg-warm: #faf0dc;
  --bg-card: #fefaf3;
  --bg-hero: #f7ecd5;

  /* Adventure-map browns */
  --brown-deep: #3E2723;
  --brown-dark: #5C3A1E;
  --brown-medium: #6B4226;
  --brown-warm: #8B6914;
  --brown-sienna: #A0522D;

  /* Epic tale accents */
  --gold: #C8A951;
  --gold-bright: #D4A843;
  --gold-light: #E8C86A;
  --amber: #E8A840;
  --amber-light: #F0C070;

  /* Text */
  --text: #3E2723;
  --text-soft: #5C4033;
  --text-muted: #8B7355;
  --text-light: #A09080;

  /* Accent colors for highlights */
  --accent-gold: #C8A951;
  --accent-warm: #D4764E;
  --accent-red: #A0522D;
  --accent-navy: #3E2723;

  /* UI */
  --header-bg: #3E2723;
  --header-border: #C8A951;
  --card-border: #D4C4A0;
  --card-shadow: rgba(62, 39, 35, 0.08);
  --card-hover-shadow: rgba(62, 39, 35, 0.15);
  --divider: #D4C4A0;

  /* Typography */
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', serif;
  --font-sans: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
}

/* Parchment body pattern — subtle paper texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 169, 81, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 105, 20, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(160, 82, 45, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ========== SR-ONLY (accessibility) ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========== HEADER / NAVIGATION ========== */
.site-header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.site-logo img {
  height: 36px;
  width: 36px;
  border-radius: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.site-nav a {
  color: #d4c4a0;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  background: rgba(200, 169, 81, 0.2);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: var(--brown-deep) !important;
  padding: 8px 20px !important;
  border-radius: 24px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(200, 169, 81, 0.3);
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 169, 81, 0.5);
  color: var(--brown-deep) !important;
  background: linear-gradient(135deg, var(--gold-bright), var(--amber-light)) !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ========== HERO SECTION ========== */
.hero {
  background: linear-gradient(175deg, #f7ecd5 0%, #faf5ed 40%, #faf0dc 100%);
  padding: 60px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Epic-tale decorative motif on hero */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 15% 30%, rgba(200, 169, 81, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 85% 70%, rgba(160, 82, 45, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%, var(--gold) 20%, var(--amber) 50%, var(--gold) 80%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero-img {
  max-width: 360px;
  height: auto;
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(62, 39, 35, 0.25);
  border: 3px solid var(--gold);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--brown-deep);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--brown-warm);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Sub-page hero (compact) */
.hero-subpage {
  padding: 40px 24px 48px;
}

.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* ========== CONTENT SECTIONS ========== */
.content-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 700px;
}

/* ========== GAME INFO CARDS (index) ========== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--card-hover-shadow);
}

.info-card-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--gold);
}

.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 6px;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
}

/* ========== FEATURE CARDS (index) ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--brown-sienna);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--card-hover-shadow);
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ========== SCREENSHOT GALLERY (index) ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--card-border);
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px var(--card-hover-shadow);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2001;
  background: none;
  border: none;
  font-weight: 300;
}

/* ========== REVIEWS / QUOTES (index) ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--card-shadow);
  position: relative;
}

.review-card::before {
  content: '"';
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--gold);
  position: absolute;
  top: 8px;
  left: 16px;
  line-height: 1;
  opacity: 0.5;
}

.review-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
  font-style: italic;
  padding-left: 16px;
}

.review-author {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 600;
}

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--brown-deep) 0%, var(--brown-dark) 50%, var(--brown-medium) 100%);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 20px rgba(62,39,35,0.3);
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(200,169,81,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.cta-banner h2 {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cta-banner p {
  color: #d4c4a0;
  font-size: 1rem;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: var(--brown-deep);
  padding: 14px 40px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(200,169,81,0.3);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(200,169,81,0.5);
}

/* ========== GUIDE PAGE ========== */
.guide-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px var(--card-shadow);
}

.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 8px;
}

.guide-step p {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}

.guide-tip {
  background: linear-gradient(135deg, #fdf8ee, #faf0dc);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

.guide-tip strong {
  color: var(--brown-warm);
}

.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 20px;
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--divider);
}

.route-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 16px;
}

/* ========== STORY PAGE ========== */
.story-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.story-block {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px var(--card-shadow);
}

.story-block h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}

.story-block p {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown-sienna);
  margin-bottom: 8px;
}

/* ========== CHARACTERS PAGE ========== */
.characters-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.char-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--card-hover-shadow);
}

.char-card-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: top;
  background: #f5ead5;
}

.char-card-body {
  padding: 16px;
}

.char-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 4px;
}

.char-card-role {
  font-size: 0.85rem;
  color: var(--brown-warm);
  font-weight: 600;
  margin-bottom: 8px;
}

.char-card-body p {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.char-tag {
  background: #f7ecd5;
  color: var(--brown-warm);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--divider);
}

.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brown-deep);
}

.char-intro {
  max-width: 800px;
  margin-bottom: 32px;
  font-size: 1.02rem;
  color: var(--text-soft);
  line-height: 1.8;
}

/* ========== FAQ PAGE ========== */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--card-shadow);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 24px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brown-deep);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-question:hover {
  background: #fdf8ee;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--gold);
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '−';
  transform: rotate(0);
}

.faq-answer {
  display: none;
  padding: 0 24px 18px;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}

.faq-item.open .faq-answer {
  display: block;
}

/* System requirements table */
.sys-reqs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.sys-reqs-table th,
.sys-reqs-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

.sys-reqs-table th {
  background: #f7ecd5;
  color: var(--brown-deep);
  font-weight: 700;
  font-family: var(--font-serif);
  width: 30%;
}

.sys-reqs-table td {
  color: var(--text-soft);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-top: 24px;
  margin-bottom: 12px;
}

.sys-reqs-h3:first-of-type {
  margin-top: 8px;
}

/* ========== CONTENT LIST CLASSES (anti-inline) ========== */
.content-list {
  list-style: disc;
  padding-left: 20px;
}

.content-list-num {
  list-style: decimal;
  padding-left: 24px;
}

.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
}

.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
}

.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
}

/* ========== COLORED STRONG TAGS ========== */
.strong-gold { color: var(--gold); }
.strong-red { color: var(--accent-red); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--accent-navy); }
.strong-warm { color: var(--accent-warm); }

/* ========== TABLE HIGHLIGHT ========== */
.td-highlight {
  color: var(--accent-red);
  font-weight: 700;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--header-bg);
  padding: 24px;
  text-align: center;
  border-top: 3px solid var(--header-border);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .header-cta {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
  }

  .site-logo {
    font-size: 1.15rem;
  }

  .hero {
    padding: 40px 20px 50px;
  }

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

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-img {
    max-width: 240px;
  }

  .content-section {
    padding: 32px 20px;
  }

  .content-section h2 {
    font-size: 1.6rem;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

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

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

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

  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .char-card-img {
    height: 200px;
  }

  .cta-banner {
    padding: 28px 20px;
  }

  .cta-banner h2 {
    font-size: 1.3rem;
  }

  .hero-subpage {
    padding: 28px 20px 32px;
  }

  .hero-subpage-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav a {
    text-align: center;
  }

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

  .char-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

  .section-subheading {
    font-size: 1.3rem;
  }
}
