/* ========== FONT IMPORT ========== */
@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 {
  --font-serif: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* 阴阳调和 color palette */
  --vermillion: #D32F2F;
  --vermillion-dark: #B71C1C;
  --vermillion-light: #EF5350;
  --ink-black: #212121;
  --ink-soft: #424242;
  --sandalwood: #F5F0EB;
  --sandalwood-dark: #E8DED4;
  --gold-foil: #FFC107;
  --gold-dark: #FFA000;
  --gold-pale: #FFF3CD;

  /* functional */
  --bg: #F5F0EB;
  --bg-card: #FFFFFF;
  --bg-alt: #EDE7E0;
  --text: #212121;
  --text-soft: #616161;
  --text-muted: #9E9E9E;
  --accent: #D32F2F;
  --accent-hover: #B71C1C;
  --accent-gold: #FFC107;
  --border: #E0D8CF;
  --border-light: #EFE9E2;
  --shadow: 0 2px 12px rgba(33,33,33,0.08);
  --shadow-lg: 0 4px 24px rgba(33,33,33,0.12);

  /* hero */
  --header-bg: #1A1A1A;
  --hero-overlay: rgba(26,26,26,0.65);
  --hero-text: #F5F0EB;

  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-sans); color: var(--text); background: var(--bg); line-height: 1.75; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

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

/* ========== HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg); border-bottom: 3px solid var(--vermillion);
  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 { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.header-logo-img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.header-logo-text { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; color: var(--sandalwood); white-space: nowrap; }
.header-logo:hover .header-logo-text { color: var(--gold-foil); }

/* nav */
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  color: #BDBDBD; padding: 8px 14px; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500; transition: all 0.2s; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-foil); background: rgba(255,255,255,0.08); }

/* header CTA */
.nav-cta {
  margin-left: 12px;
  display: inline-block; background: var(--vermillion); color: #fff !important;
  padding: 8px 20px !important; border-radius: 6px; font-weight: 700 !important;
  font-size: 0.9rem; transition: all 0.2s; text-decoration: none;
}
.nav-cta:hover { background: var(--vermillion-dark); color: #fff !important; }

/* hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; z-index: 1001;
}
.hamburger span { display: block; width: 24px; height: 2px; background: #BDBDBD; border-radius: 2px; transition: all 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ========== HERO ========== */
.hero {
  position: relative; padding: 60px 24px 80px; text-align: center;
  background: linear-gradient(135deg, #1A1A1A 0%, #2D1512 50%, #1A1A1A 100%);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(211,47,47,0.12) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(255,193,7,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(211,47,47,0.03) 2px, rgba(211,47,47,0.03) 4px);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: var(--max-width); margin: 0 auto; }
.hero-tagline {
  font-family: var(--font-serif); color: var(--hero-text); margin-bottom: 8px;
}
.hero-title-main {
  font-family: var(--font-serif); font-size: 2.8rem; font-weight: 900;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); margin-bottom: 12px; line-height: 1.3;
}
.hero-title-main .jp-subtitle {
  display: block; font-size: 1.1rem; font-weight: 400;
  color: #B0A89E; margin-top: 6px; letter-spacing: 0.05em;
}
.hero-subtitle { color: #B0A89E; font-size: 1.05rem; margin-bottom: 24px; }
.hero-tagline-text {
  font-family: var(--font-serif); color: rgba(245,240,235,0.8); font-size: 1rem;
  max-width: 600px; margin: 0 auto 16px; line-height: 1.7; font-style: italic;
}

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

/* decorative符咒 on hero */
.hero-talisman {
  position: absolute; pointer-events: none; opacity: 0.06;
  font-family: var(--font-serif); font-size: 12rem; color: var(--gold-foil);
  user-select: none; z-index: 0;
}
.hero-talisman.left { top: -20px; left: -30px; transform: rotate(-15deg); }
.hero-talisman.right { bottom: -20px; right: -30px; transform: rotate(10deg); }

/* ========== SECTION ========== */
.section { max-width: var(--max-width); margin: 0 auto; padding: 64px 24px; }
.section-alt { background: var(--bg-alt); }
.section-no-padding { padding: 0; }
.section-title {
  font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700;
  color: var(--ink-black); text-align: center; margin-bottom: 8px;
}
.section-subtitle {
  text-align: center; color: var(--text-soft); font-size: 1rem; margin-bottom: 48px;
}
.section-title-group { margin-bottom: 48px; }
.section-title-group-spaced { margin-top: 48px; }

/* decorative divider */
.section-divider {
  width: 60px; height: 3px; background: var(--vermillion);
  margin: 0 auto 20px; border-radius: 2px;
  position: relative;
}
.section-divider::after {
  content: '◆'; position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%); color: var(--vermillion); font-size: 8px;
}

/* ========== GAME INFO CARDS (index) ========== */
.game-info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: var(--max-width); margin: 0 auto 40px; padding: 0 24px;
}
.game-info-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow);
  border-top: 3px solid var(--vermillion);
  transition: transform 0.2s;
}
.game-info-card:hover { transform: translateY(-2px); }
.game-info-card .info-value {
  font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700;
  color: var(--vermillion); line-height: 1;
}
.game-info-card .info-label {
  font-size: 0.82rem; color: var(--text-soft); margin-top: 6px;
}
.game-info-desc {
  text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 0;
}

/* ========== FEATURE CARDS (index) ========== */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px 64px;
}
.feature-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 28px 24px; box-shadow: var(--shadow); border-left: 4px solid var(--vermillion);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .feature-icon {
  font-size: 2rem; margin-bottom: 12px; display: block;
}
.feature-card h3 {
  font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700;
  color: var(--ink-black); margin-bottom: 8px;
}
.feature-card p { font-size: 0.9rem; color: var(--text-soft); line-height: 1.7; }

/* alternate gold accent cards */
.feature-card.gold { border-left-color: var(--gold-foil); }

/* ========== SCREENSHOT GALLERY ========== */
.screenshot-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px 64px;
}
.screenshot-item { border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.2s; }
.screenshot-item:hover { transform: scale(1.03); }
.screenshot-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }

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

/* ========== REVIEWS / QUOTES ========== */
.review-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px 64px;
}
.review-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow); border-top: 3px solid var(--gold-foil);
}
.review-card .review-stars { color: var(--gold-foil); font-size: 0.9rem; margin-bottom: 10px; }
.review-card .review-text { font-size: 0.9rem; color: var(--text-soft); line-height: 1.8; font-style: italic; margin-bottom: 12px; }
.review-card .review-author { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--vermillion) 0%, #B71C1C 100%);
  text-align: center; padding: 48px 24px;
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,193,7,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.cta-banner h2 {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 700;
  color: #fff; margin-bottom: 10px; position: relative;
}
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 24px; position: relative; font-size: 1rem; }
.cta-btn {
  display: inline-block; background: var(--gold-foil); color: var(--ink-black) !important;
  padding: 14px 40px; border-radius: var(--radius); font-size: 1.1rem;
  font-weight: 700; text-decoration: none; position: relative; transition: all 0.2s;
}
.cta-btn:hover { background: var(--gold-dark); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

/* ========== CONTENT PAGES (sub-pages) ========== */
.content-section { max-width: 800px; margin: 0 auto; padding: 48px 24px 64px; }
.content-section h2 {
  font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.content-section h3 {
  font-family: var(--font-serif); font-size: 1.3rem; font-weight: 700; color: var(--ink-soft); margin: 28px 0 10px;
}
.content-section p {
  color: var(--text-soft); margin-bottom: 16px; line-height: 1.85; font-size: 0.95rem;
}

/* ========== PROSE CLASSES ========== */
.prose-centered {
  text-align: center; max-width: 800px; margin: 0 auto 32px;
  color: var(--text-soft); line-height: 1.85; font-size: 0.95rem;
}
.prose-centered:last-of-type { margin-bottom: 40px; }

/* ========== CONTENT LIST CLASSES ========== */
.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-pink { color: var(--vermillion); }
.strong-red { color: var(--vermillion-dark); }
.strong-gold { color: var(--gold-dark); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--ink-black); }

/* ========== TABLE CLASSES ========== */
.table-scroll { overflow-x: auto; margin-bottom: 24px; }
.td-highlight { color: var(--vermillion); font-weight: 700; }

.content-section table {
  width: 100%; border-collapse: collapse; margin-bottom: 20px;
  font-size: 0.9rem; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden;
}
.content-section thead { background: var(--ink-black); color: #fff; }
.content-section thead th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 0.85rem; }
.content-section tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-soft); }
.content-section tbody tr:nth-child(even) { background: rgba(245,240,235,0.5); }
.content-section tbody tr:last-child td { border-bottom: none; }

/* ========== TIPS BOX ========== */
.tips-box {
  background: var(--gold-pale); border: 1px solid var(--gold-dark);
  border-radius: var(--radius); padding: 16px 20px; margin: 20px 0;
}
.tips-box strong { color: var(--ink-black); }
.tips-box p { margin: 0; }

/* ========== CHAPTER TITLE (story.html) ========== */
.chapter-title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--vermillion); margin-bottom: 8px; }
.guide-intro { color: var(--text-soft); line-height: 1.85; margin-bottom: 24px; font-size: 0.95rem; }
.route-desc { color: var(--text-soft); margin-bottom: 16px; }
.route-heading { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; color: var(--ink-black); margin: 24px 0 10px; }

/* ========== FAQ ========== */
.faq-intro { color: var(--text-soft); margin-bottom: 32px; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.faq-question {
  width: 100%; text-align: left; background: none; border: none;
  padding: 18px 0; font-family: var(--font-serif); font-size: 1.05rem;
  font-weight: 600; color: var(--ink-black); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--vermillion); }
.faq-question .faq-icon { font-size: 1.3rem; color: var(--vermillion); transition: transform 0.3s; }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0;
}
.faq-item.active .faq-answer { max-height: 600px; padding-bottom: 18px; }
.faq-answer p { color: var(--text-soft); line-height: 1.85; margin-bottom: 8px; font-size: 0.93rem; }
.faq-note { margin-top: 16px; }
.faq-answer ul { list-style: disc; padding-left: 20px; margin-bottom: 8px; }
.faq-answer li { color: var(--text-soft); margin-bottom: 4px; font-size: 0.93rem; }

/* ========== SYSTEM REQUIREMENTS ========== */
.sys-reqs-h3 {
  font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700;
  color: var(--ink-black); margin-top: 24px; margin-bottom: 12px;
}
.sys-reqs-h3:first-of-type { margin-top: 8px; }
.sys-note { margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; }

/* ========== CHARACTER CARDS ========== */
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.char-card {
  background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); border-top: 4px solid var(--vermillion);
  transition: transform 0.2s;
}
.char-card:hover { transform: translateY(-4px); }
.char-card-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--bg-alt); }
.char-card-body { padding: 20px; }
.char-card-body h3 {
  font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; color: var(--ink-black); margin-bottom: 4px;
}
.char-card-body .char-role {
  font-size: 0.82rem; color: var(--vermillion); font-weight: 600; margin-bottom: 8px;
}
.char-card-body p { font-size: 0.85rem; color: var(--text-soft); line-height: 1.65; }
.char-traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.char-trait {
  display: inline-block; background: var(--sandalwood-dark); color: var(--ink-soft);
  padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}

/* ========== SECTION SUB-HEADING ========== */
.section-subheading { text-align: center; margin: 40px 0 24px; }

/* ========== GHOST TYPE TABLE ========== */
.ghost-table { margin: 24px 0; }

/* ========== FOOTER ========== */
.site-footer {
  background: var(--header-bg); padding: 24px; text-align: center;
  border-top: 3px solid var(--vermillion);
}
.site-footer p { color: #9E9E9E; font-size: 0.85rem; margin: 0; }

/* ========== GUIDE STEPS ========== */
.guide-steps-wrapper { counter-reset: guide-step; }
.guide-step {
  padding: 20px 24px; margin-bottom: 16px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border-left: 4px solid var(--vermillion);
  counter-increment: guide-step; position: relative;
}
.guide-step::before {
  content: '#' counter(guide-step);
  position: absolute; top: 16px; right: 20px;
  font-family: var(--font-serif); font-size: 1.8rem; font-weight: 900;
  color: rgba(211,47,47,0.12);
}
.guide-step h3 { margin-top: 0; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; color: var(--ink-black); }
.guide-step p { color: var(--text-soft); font-size: 0.9rem; line-height: 1.75; margin-bottom: 6px; }

/* ========== RESPONSIVE: 768px ========== */
@media (max-width: 768px) {
  .hero { padding: 48px 20px 60px; }
  .hero-title-main { font-size: 2rem; }
  .hero-subpage-title { font-size: 1.5rem; }
  .hero-subpage { padding: 32px 20px 40px; }

  .section { padding: 48px 20px; }
  .section-title { font-size: 1.7rem; }

  .game-info-grid { grid-template-columns: repeat(2, 1fr); padding: 0 20px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); padding: 0 20px 48px; }
  .screenshot-grid { grid-template-columns: repeat(2, 1fr); padding: 0 20px 48px; }
  .review-grid { grid-template-columns: 1fr 1fr; padding: 0 20px 48px; }
  .char-grid { grid-template-columns: repeat(2, 1fr); }

  .content-section { padding: 40px 20px 56px; }
  .content-section h2 { font-size: 1.7rem; }

  .nav-links { display: none; position: absolute; top: var(--header-height); left: 0; right: 0;
    flex-direction: column; background: var(--header-bg); padding: 16px 24px;
    border-bottom: 3px solid var(--vermillion); gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-cta { margin-left: 0; margin-top: 8px; text-align: center; }
  .hamburger { display: flex; }

  .cta-banner h2 { font-size: 1.5rem; }
  .hero-talisman { font-size: 8rem; }
}

/* ========== RESPONSIVE: 480px ========== */
@media (max-width: 480px) {
  .hero { padding: 36px 16px 48px; }
  .hero-title-main { font-size: 1.6rem; }
  .hero-subpage-title { font-size: 1.3rem; }
  .hero-subpage { padding: 28px 16px 36px; }
  .hero-tagline-text { font-size: 0.9rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .section { padding: 40px 16px; }
  .section-title { font-size: 1.45rem; }

  .game-info-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
  .game-info-card { padding: 14px; }
  .game-info-card .info-value { font-size: 1.3rem; }

  .feature-grid { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 40px; }
  .screenshot-grid { grid-template-columns: 1fr; gap: 12px; padding: 0 16px 40px; }
  .review-grid { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 40px; }
  .char-grid { grid-template-columns: 1fr; gap: 16px; }

  .content-section { padding: 32px 16px 48px; }
  .content-section h2 { font-size: 1.45rem; }

  .cta-btn { padding: 12px 28px; font-size: 1rem; }

  .header-logo-text { font-size: 1rem; }
  .hero-talisman { font-size: 5rem; }
}
