/* ========== CSS Variables / 冬日狂想曲 - Winter Fantasy Theme ========== */
:root {
  /* Color Palette */
  --bg: #faf8f5;
  --bg-warm: #f5f0e8;
  --bg-card: #fffdf9;
  --header-bg: #3d2b1f;
  --header-border: #5b8dab;
  --accent: #5b8dab;
  --accent-light: #a3c9dd;
  --accent-pale: #d6e9f3;
  --brown: #6b4226;
  --brown-light: #c4956a;
  --brown-pale: #e8d5c4;
  --text: #2d2418;
  --text-soft: #6e5e4a;
  --text-muted: #9c8b7a;
  --white: #ffffff;
  --gold: #c9a96e;
  --shadow-sm: 0 1px 3px rgba(61, 43, 31, 0.08);
  --shadow-md: 0 4px 16px rgba(61, 43, 31, 0.1);
  --shadow-lg: 0 8px 32px rgba(61, 43, 31, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-serif: 'Noto Serif SC', 'STSong', 'SimSun', 'Songti SC', Georgia, serif;
  --max-width: 1100px;
}

/* ========== 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.75;
  -webkit-font-smoothing: antialiased;
  /* Subtle snowflake pattern overlay */
  background-image:
    radial-gradient(circle at 10% 20%, rgba(91,141,171,0.04) 0%, transparent 50%),
    radial-gradient(circle at 85% 60%, rgba(107,66,38,0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(91,141,171,0.04) 0%, transparent 50%);
}

/* ========== Typography ========== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.35;
}
h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.65rem; margin-bottom: 0.75rem; color: var(--brown); }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--accent); }
p { margin-bottom: 1rem; color: var(--text-soft); }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brown); }

/* ========== Utility Classes ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.prose { max-width: 800px; margin: 0 auto; }
.section-alt { background: var(--bg-warm); padding-top: 0; }
.table-scroll { overflow-x: auto; }

/* ========== Header ========== */
header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.logo::before {
  content: '❄';
  font-size: 1.4rem;
}
nav { display: flex; align-items: center; gap: 1.8rem; }
nav a {
  color: #c4b8a8;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.3rem 0;
  transition: color var(--transition);
}
nav a:hover,
nav a.active { color: var(--white); }
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 0;
  height: 2px;
  background: var(--header-border);
  border-radius: 1px;
}
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--accent), #467a94);
  color: var(--white);
  padding: 0.5rem 1.4rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(91,141,171,0.3);
  white-space: nowrap;
}
.btn-cta:hover {
  background: linear-gradient(135deg, #6a9db8, #558da5);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(91,141,171,0.4);
}
.btn-cta::after { content: '→'; font-size: 1.1rem; }

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ========== Hero Section ========== */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.65);
  z-index: 0;
}
/* Page-specific hero backgrounds */
.hero-home .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.png'); }
.hero-characters .hero-bg { background-image: url('../img/header.jpg'); }
.hero-faq .hero-bg { background-image: url('../img/header.jpg'); }
.hero-overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4.5rem 1.5rem 4rem;
  background: linear-gradient(180deg, rgba(61,43,31,0.55) 0%, rgba(61,43,31,0.35) 60%, rgba(250,248,245,0.95) 100%);
}
.hero-overlay h1 {
  color: var(--white);
  font-size: 2.6rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.hero-subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 1.15rem;
  font-family: var(--font-serif);
  margin-bottom: 0.5rem;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--accent-pale);
  font-weight: 500;
}

/* ========== Content Sections ========== */
section {
  padding: 3.5rem 1.5rem;
}
section:nth-child(even) { background: var(--bg-warm); }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}
.section-title h2 {
  display: inline-block;
  position: relative;
  padding-bottom: 0.5rem;
}
.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent));
  border-radius: 2px;
}
.section-title p { color: var(--text-muted); max-width: 600px; margin: 0.5rem auto 0; }

/* ========== Game Info Cards (Index) ========== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  transition: all var(--transition);
}
.info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.info-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0; }

/* ========== Feature Cards ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--brown-light);
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--accent);
}
.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.feature-card p { font-size: 0.95rem; color: var(--text-soft); margin-bottom: 0; }

/* ========== Screenshot Gallery ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  aspect-ratio: 16/9;
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========== Reviews / Quotes ========== */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.review-card::before {
  content: '"';
  position: absolute;
  top: 0.3rem;
  left: 1rem;
  font-size: 2.5rem;
  color: var(--accent-light);
  font-family: var(--font-serif);
  line-height: 1;
  opacity: 0.5;
}
.review-card p { font-style: italic; color: var(--text-soft); margin-bottom: 0.8rem; }
.review-author { font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* ========== CTA Banner (Index Only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--brown), #55371f);
  color: var(--white);
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 3px solid var(--gold);
}
.cta-banner h2 { color: var(--white); margin-bottom: 0.5rem; }
.cta-banner p { color: #d4c5b3; margin-bottom: 1.5rem; }
.btn-cta-large {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #467a94);
  color: var(--white);
  padding: 0.85rem 2.5rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.15rem;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(91,141,171,0.35);
}
.btn-cta-large:hover {
  background: linear-gradient(135deg, #6a9db8, #558da5);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(91,141,171,0.45);
}
.btn-cta-large::after { content: '→'; font-size: 1.3rem; }

/* ========== Guide Page ========== */
.guide-intro { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 1.8rem; }
.guide-toc {
  background: var(--bg-warm);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent);
}
.guide-toc h3 { margin-bottom: 0.8rem; }
.guide-toc ol { padding-left: 1.5rem; }
.guide-toc li { margin-bottom: 0.3rem; color: var(--text-soft); }
.guide-section { margin-bottom: 2.5rem; }
.tip-box {
  background: var(--accent-pale);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid var(--accent);
}
.tip-box strong { color: var(--accent); }
.tip-box p { margin-bottom: 0; }
.route-heading {
  font-family: var(--font-serif);
  color: var(--accent);
  margin: 1.5rem 0 0.6rem;
  font-size: 1.2rem;
}
.route-desc { color: var(--text-soft); margin-bottom: 1rem; }
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--brown);
  margin: 1rem 0 0.4rem;
}

/* ========== Story Page ========== */
.story-section { margin-bottom: 2.5rem; }
.story-section h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-pale);
  margin-bottom: 1rem;
}

/* ========== Characters Page ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
}
.char-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border-bottom: 4px solid var(--accent-pale);
}
.char-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.char-card-img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
  background: var(--bg-warm);
}
.char-card-body { padding: 1.3rem; }
.char-card-body h3 { font-size: 1.15rem; }
.char-card-body .char-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.char-card-body p { font-size: 0.93rem; color: var(--text-soft); }
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}
.char-trait {
  background: var(--accent-pale);
  color: var(--accent);
  padding: 0.2rem 0.7rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}
.char-relation { margin-top: 0.8rem; }
.char-relation h4 { font-size: 0.95rem; color: var(--brown); margin-bottom: 0.3rem; }
.char-relation ul { list-style: none; }
.char-relation li { font-size: 0.9rem; color: var(--text-soft); padding: 0.15rem 0; }
.char-relation li::before { content: '❄ '; color: var(--accent-light); }

/* ========== FAQ Page ========== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--brown-pale);
  margin-bottom: 0;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.15rem 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  gap: 1rem;
}
.faq-question:hover { color: var(--accent); }
.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.faq-item.open .faq-question::after { content: '−'; transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 1rem;
}
.faq-answer p { color: var(--text-soft); margin-bottom: 0.6rem; }
.system-req {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.system-req th, .system-req td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--brown-pale);
}
.system-req th {
  background: var(--bg-warm);
  color: var(--brown);
  font-weight: 600;
  font-family: var(--font-serif);
}
.system-req td { color: var(--text-soft); font-size: 0.95rem; }

/* ========== Lightbox ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0,0,0,0.4);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  line-height: 1;
}
.lightbox-close:hover { color: var(--white); }

/* ========== Footer ========== */
footer {
  background: var(--header-bg);
  color: #a89888;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}
footer p { color: #a89888; margin-bottom: 0; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .hamburger { display: flex; }
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    gap: 0;
    border-bottom: 2px solid var(--header-border);
  }
  nav.open {
    max-height: 350px;
    padding: 1rem 1.5rem;
  }
  nav a { padding: 0.7rem 0; }
  .header-inner { padding: 0.5rem 1rem; }
  .hero-overlay { padding: 3rem 1rem 2.5rem; }
  .hero-overlay h1 { font-size: 2rem; }
  section { padding: 2.5rem 1rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .info-cards { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .btn-cta { font-size: 0.9rem; padding: 0.45rem 1.1rem; }
}

@media (max-width: 480px) {
  .hero-overlay h1 { font-size: 1.6rem; }
  .hero-overlay { padding: 2.5rem 1rem 2rem; }
  .section-title h2 { font-size: 1.35rem; }
  .btn-cta-large { padding: 0.7rem 1.8rem; font-size: 1rem; }
}
