/* ========== CSS VARIABLES ========== */
:root {
  --blue: #1976D2;
  --blue-dark: #1565C0;
  --blue-light: #42A5F5;
  --green: #43A047;
  --green-dark: #2E7D32;
  --gold: #FFCA28;
  --gold-dark: #FFB300;
  --bg: #FDFDFD;
  --bg-warm: #FFF8E1;
  --bg-card: #FFFFFF;
  --text: #212121;
  --text-soft: #616161;
  --text-muted: #9E9E9E;
  --border: #E0E0E0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-serif: 'Georgia', 'Noto Serif SC', 'SimSun', serif;
  --header-height: 64px;
  --max-width: 1200px;
}

/* ========== 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: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-dark); }
ul, ol { list-style: none; }

/* ========== UTILITY CLASSES ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 24px; }
.section-alt { background: var(--bg-warm); padding: 64px 24px; }
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mt-32 { margin-top: 32px; }

/* Prose/content wrappers */
.prose { max-width: 800px; margin: 0 auto; }
.prose p { margin-bottom: 16px; color: var(--text-soft); line-height: 1.9; }
.prose h3 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--blue-dark); margin: 32px 0 12px; }
.prose h4 { font-size: 1.1rem; color: var(--blue); margin: 24px 0 8px; font-weight: 600; }

/* Lists */
.content-list { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.content-list-num { list-style: decimal; padding-left: 24px; margin-bottom: 16px; }
.content-list li, .content-list-num li { margin-bottom: 8px; color: var(--text-soft); line-height: 1.8; }
.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-dark); }
.strong-blue { color: var(--blue); }
.strong-green { color: var(--green-dark); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--blue-dark); }
.strong-red { color: #E53935; }

/* Table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 24px; }
.td-highlight { color: var(--green-dark); font-weight: 700; }

/* Chapter/sub titles */
.chapter-title { font-family: var(--font-serif); font-size: 1.15rem; color: var(--blue); font-weight: 600; margin: 24px 0 8px; }
.route-heading { font-family: var(--font-serif); font-size: 1.25rem; color: var(--blue-dark); margin: 28px 0 10px; font-weight: 700; }
.route-desc { color: var(--text-soft); margin-bottom: 12px; line-height: 1.8; }
.guide-intro { color: var(--text-soft); margin-bottom: 20px; line-height: 1.9; }
.section-subheading { text-align: center; font-family: var(--font-serif); font-size: 1.5rem; color: var(--blue-dark); margin: 40px 0 24px; }
.sys-reqs-h3 { font-family: var(--font-serif); font-size: 1.2rem; color: var(--blue-dark); margin-top: 28px; margin-bottom: 12px; font-weight: 700; }
.sys-reqs-h3:first-of-type { margin-top: 0; }

/* Hero sub-page */
.hero-subpage { padding: 40px 24px 48px; }
.hero-subpage-title { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; }

/* Hero title */
.hero-title-main {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero-tagline { font-size: 1.15rem; color: rgba(255,255,255,0.9); margin-bottom: 8px; }

/* ========== HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--blue-dark);
  border-bottom: 3px solid var(--gold);
  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%;
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}
.header-logo:hover { color: var(--gold); }
.header-logo span { color: var(--gold); }
.header-nav { display: flex; align-items: center; gap: 24px; }
.header-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover,
.header-nav a.active { color: var(--gold); }
.nav-cta {
  background: var(--gold);
  color: var(--blue-dark) !important;
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  transition: background 0.2s, transform 0.2s !important;
}
.nav-cta:hover { background: #FFD54F; transform: scale(1.05); }
.hamburger {
  display: none; background: none; border: none;
  color: #FFFFFF; font-size: 1.6rem; cursor: pointer;
  padding: 4px 8px; line-height: 1;
}

/* ========== HERO ========== */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 24px 100px;
  display: flex; align-items: center; justify-content: center;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(25,118,210,0.85) 0%, rgba(21,101,192,0.9) 100%);
}
.hero-content {
  position: relative; z-index: 1; text-align: center;
  max-width: 700px;
}
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,0.85); margin-bottom: 4px; }

/* Page-specific hero backgrounds */
.hero-index .hero-bg { background-image: url('../img/header.jpg'); }
.hero-guide .hero-bg { background-image: url('../img/screenshot-01.jpg'); }
.hero-story .hero-bg { background-image: url('../img/screenshot-02.jpg'); }
.hero-characters .hero-bg { background-image: url('../img/screenshot-03.jpg'); }
.hero-faq .hero-bg { background-image: url('../img/screenshot-04.jpg'); }

/* ========== CARDS ========== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
  border-left: 4px solid var(--blue);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 20px 24px 24px; }
.card-body h3 { font-family: var(--font-serif); font-size: 1.2rem; color: var(--blue-dark); margin-bottom: 8px; }
.card-body p { color: var(--text-soft); font-size: 0.95rem; line-height: 1.7; }

/* Feature cards (index page) */
.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 28px 24px; box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-family: var(--font-serif); font-size: 1.15rem; color: var(--blue-dark); margin-bottom: 8px; }
.feature-card p { color: var(--text-soft); font-size: 0.93rem; line-height: 1.7; }

/* Character cards */
.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.char-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.char-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.char-card-img { width: 100%; height: 320px; object-fit: cover; }
.char-card-body { padding: 20px; }
.char-card-body h3 { font-family: var(--font-serif); font-size: 1.2rem; color: var(--blue-dark); margin-bottom: 4px; }
.char-role { display: inline-block; background: var(--gold); color: var(--blue-dark); padding: 2px 12px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.char-card-body p { color: var(--text-soft); font-size: 0.9rem; line-height: 1.6; margin-bottom: 8px; }
.char-traits { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.char-tag {
  background: #E3F2FD; color: var(--blue);
  padding: 2px 10px; border-radius: 12px;
  font-size: 0.8rem; font-weight: 500;
}

/* ========== GALLERY ========== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.gallery-item { cursor: pointer; border-radius: var(--radius); overflow: hidden; transition: transform 0.2s; }
.gallery-item:hover { transform: scale(1.03); }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.9); justify-content: center; align-items: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 4px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: #FFF; font-size: 2rem; cursor: pointer; background: none; border: none; }

/* ========== REVIEWS ========== */
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.review-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
  border-left: 3px solid var(--green);
}
.review-text { font-style: italic; color: var(--text-soft); font-size: 0.95rem; margin-bottom: 12px; line-height: 1.7; }
.review-author { font-weight: 600; color: var(--blue-dark); font-size: 0.9rem; }
.review-stars { color: var(--gold); font-size: 1rem; margin-bottom: 8px; }

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  padding: 56px 24px; text-align: center;
}
.cta-banner h2 { color: #FFFFFF; font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 12px; }
.cta-banner p { color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto 24px; }
.cta-btn {
  display: inline-block; background: var(--gold); color: var(--blue-dark);
  padding: 14px 40px; border-radius: 32px; font-size: 1.1rem;
  font-weight: 700; transition: background 0.2s, transform 0.2s;
}
.cta-btn:hover { background: #FFD54F; color: var(--blue-dark); transform: scale(1.05); }

/* ========== FAQ ACCORDION ========== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; background: none; border: none; text-align: left;
  padding: 18px 0; font-size: 1.05rem; font-weight: 600;
  color: var(--text); cursor: pointer; display: flex;
  justify-content: space-between; align-items: center;
  font-family: var(--font-sans); transition: color 0.2s;
}
.faq-question:hover { color: var(--blue); }
.faq-question::after { content: '+'; font-size: 1.4rem; color: var(--blue); font-weight: 400; margin-left: 12px; }
.faq-question.active::after { content: '−'; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-answer.open { max-height: 500px; }
.faq-answer p { padding: 0 0 16px; color: var(--text-soft); line-height: 1.8; }

/* ========== SYSTEM REQUIREMENTS TABLE ========== */
.sys-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.sys-table th, .sys-table td { padding: 12px 16px; border: 1px solid var(--border); text-align: left; font-size: 0.93rem; }
.sys-table th { background: var(--blue); color: #FFFFFF; font-weight: 600; white-space: nowrap; }
.sys-table td { color: var(--text-soft); }
.sys-table tr:nth-child(even) td { background: #F5F5F5; }

/* Guide page tip boxes */
.tip-box {
  background: #E8F5E9; border-left: 4px solid var(--green);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 16px;
}
.tip-box p { color: var(--green-dark); font-size: 0.93rem; line-height: 1.7; margin-bottom: 0; }
.tip-box strong { color: var(--green-dark); }

/* ========== FOOTER ========== */
.site-footer {
  background: var(--blue-dark); padding: 20px 24px;
  text-align: center; border-top: 3px solid var(--gold);
}
.site-footer p { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

/* ========== CONTENT SECTION HEADINGS ========== */
.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem; font-weight: 700;
  color: var(--text); margin-bottom: 12px;
}
.content-section h2::after {
  content: ''; display: block;
  width: 60px; height: 3px;
  background: var(--gold); margin-top: 8px;
}
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 700;
  color: var(--text); margin-bottom: 12px;
}
.section-header h2::after {
  content: ''; display: block;
  width: 60px; height: 3px;
  background: var(--gold); margin: 10px auto 0;
}
.section-header p { color: var(--text-soft); max-width: 600px; margin: 0 auto; }

/* Game info cards (index) */
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.info-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; text-align: center;
  box-shadow: var(--shadow);
  border-bottom: 3px solid var(--blue-light);
}
.info-card-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.info-card-value { font-weight: 600; color: var(--blue-dark); font-size: 1.05rem; }

/* Story timeline */
.story-chapter { margin-bottom: 32px; padding: 24px; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.story-chapter h3 { font-family: var(--font-serif); font-size: 1.2rem; color: var(--blue-dark); margin-bottom: 8px; }
.story-chapter p { color: var(--text-soft); line-height: 1.8; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero-title-main { font-size: 2rem; }
  .hero-subpage-title { font-size: 1.6rem; }
  .hero { padding: 48px 24px 64px; }
  .hero-subpage { padding: 32px 24px 36px; }
  .header-nav { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--blue-dark); flex-direction: column; padding: 16px 24px; gap: 12px; border-bottom: 3px solid var(--gold); }
  .header-nav.open { display: flex; }
  .hamburger { display: block; }
  .card-grid, .char-grid { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-banner h2 { font-size: 1.4rem; }
  .section { padding: 40px 16px; }
  .section-alt { padding: 40px 16px; }
  .content-section h2 { font-size: 1.6rem; }
  .section-header h2 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .hero-title-main { font-size: 1.6rem; }
  .hero-subpage-title { font-size: 1.3rem; }
  .hero { padding: 32px 16px 48px; }
  .hero-subpage { padding: 24px 16px 28px; }
  .container { padding: 0 16px; }
  .section { padding: 32px 16px; }
  .section-alt { padding: 32px 16px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .card-grid, .char-grid, .feature-cards { grid-template-columns: 1fr; }
  .info-cards { grid-template-columns: repeat(2, 1fr); }
  .cta-banner { padding: 40px 16px; }
  .cta-banner h2 { font-size: 1.2rem; }
  .cta-btn { padding: 12px 30px; font-size: 1rem; }
  .prose { padding: 0; }
  .content-section h2 { font-size: 1.4rem; }
  .section-header h2 { font-size: 1.4rem; }
}
