/* ============================================================
   异世界旅馆 (Isekai Inn) — Fantasy Inn Tavern Theme
   Hearth-fire ambers · Tavern-wood browns · Welcome-mat motifs
   Light cozy background
   ============================================================ */

/* ========== GOOGLE FONTS ========== */
@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 {
  /* Background */
  --bg: #faf5ed;
  --bg-warm: #fef9f2;
  --bg-card: #fffaf3;
  --bg-alt: #f5ede0;

  /* Text */
  --text: #2c1810;
  --text-soft: #5c4033;
  --text-muted: #8b6f5e;
  --text-light: #c4a88c;

  /* Accent — amber / hearth-fire */
  --accent: #d4843a;
  --accent-dark: #b56a2c;
  --accent-light: #f4a460;
  --accent-glow: #ffc078;
  --accent-gold: #e8a860;

  /* Fire */
  --fire: #e8732a;
  --fire-light: #ff9a56;
  --fire-ember: #c85a1a;

  /* Wood tones */
  --wood-dark: #3b2416;
  --wood: #5c3a21;
  --wood-light: #8b5e3c;
  --wood-pale: #a67c52;

  /* Welcome mat */
  --mat: #c4956a;
  --mat-dark: #a0754d;
  --mat-light: #d4a574;

  /* Danger / Pink (for highlights) */
  --pink-fierce: #d4456a;
  --danger-red: #c0392b;

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

  /* Spacing */
  --section-pad: 80px 0;
  --container-max: 1140px;
  --card-radius: 12px;
  --btn-radius: 6px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(44, 24, 16, 0.08);
  --shadow-md: 0 4px 16px rgba(44, 24, 16, 0.12);
  --shadow-lg: 0 8px 32px rgba(44, 24, 16, 0.16);
  --shadow-glow: 0 0 20px rgba(232, 115, 42, 0.25);
}

/* ========== 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-color: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* Subtle wood-grain background pattern (welcome-mat texture) */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 94, 60, 0.03) 2px,
      rgba(139, 94, 60, 0.03) 4px
    );
}

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

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

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

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.site-logo:hover { color: var(--accent-glow); }

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: var(--btn-radius);
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-glow);
  background: rgba(244, 164, 96, 0.1);
}

/* Header CTA button */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--fire), var(--accent-dark));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--btn-radius);
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(232, 115, 42, 0.4);
}

.header-cta:hover {
  background: linear-gradient(135deg, var(--fire-light), var(--accent));
  box-shadow: 0 4px 16px rgba(232, 115, 42, 0.6);
  transform: translateY(-1px);
}

/* Hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent-light);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(59, 36, 22, 0.85) 0%,
    rgba(59, 36, 22, 0.6) 50%,
    rgba(59, 36, 22, 0.85) 100%
  );
}

.hero-overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px;
  max-width: 720px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-light);
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--accent-glow);
  font-style: italic;
  margin-top: 8px;
}

/* Page-specific hero backgrounds */
.hero-home .hero-bg { background-image: url('../img/header.jpg'); }
.hero-guide .hero-bg { background-image: url('../img/guide-bg.jpg'); }
.hero-story .hero-bg { background-image: url('../img/story-bg.jpg'); }
.hero-characters .hero-bg { background-image: url('../img/header.jpg'); }
.hero-faq .hero-bg { background-image: url('../img/header.jpg'); }

/* Welcome-mat bottom border on hero */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat-dark),
    var(--mat-dark) 8px,
    var(--mat) 8px,
    var(--mat) 16px,
    var(--mat-light) 16px,
    var(--mat-light) 24px,
    var(--mat) 24px,
    var(--mat) 32px
  );
  z-index: 2;
}

/* ========== CONTENT SECTIONS ========== */
.section {
  padding: var(--section-pad);
}

.section-alt {
  background: var(--bg-alt);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--wood-dark);
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 48px;
}

/* ========== CARDS ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  padding: 28px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

/* Welcome-mat border motif on cards */
.card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat),
    var(--mat) 6px,
    var(--mat-light) 6px,
    var(--mat-light) 12px
  );
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin-bottom: 10px;
}

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

/* ========== SCREENSHOT GALLERY ========== */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.screenshot-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
}

.screenshot-grid img:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.03);
  border-color: var(--accent);
}

/* ========== CHARACTER CARDS ========== */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.char-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.char-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.char-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.char-info {
  padding: 20px;
}

.char-info h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin-bottom: 4px;
}

.char-role {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.char-trait {
  background: rgba(212, 132, 58, 0.12);
  color: var(--accent-dark);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
}

.char-desc {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== REVIEWS / QUOTES ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.review-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

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

.review-card p {
  color: var(--text-soft);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.review-author {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 600;
}

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--wood-dark), var(--wood));
  text-align: center;
  padding: 60px 24px;
  position: relative;
  overflow: hidden;
}

/* Welcome-mat top border */
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat-dark),
    var(--mat-dark) 8px,
    var(--mat) 8px,
    var(--mat) 16px,
    var(--mat-light) 16px,
    var(--mat-light) 24px,
    var(--mat) 24px,
    var(--mat) 32px
  );
}

/* Ember-glow overlay */
.cta-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(232, 115, 42, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--accent-glow);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.cta-banner p {
  color: var(--text-light);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--fire), var(--accent-dark));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: var(--btn-radius);
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(232, 115, 42, 0.5);
  position: relative;
  z-index: 1;
}

.cta-btn:hover {
  background: linear-gradient(135deg, var(--fire-light), var(--accent));
  box-shadow: 0 6px 24px rgba(232, 115, 42, 0.7);
  transform: translateY(-2px);
}

/* ========== GUIDE PAGE ========== */
.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 32px;
  line-height: 1.9;
}

.guide-step {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  counter-increment: step-counter;
  position: relative;
}

.guide-step::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat),
    var(--mat) 6px,
    var(--mat-light) 6px,
    var(--mat-light) 12px
  );
}

.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin-bottom: 10px;
}

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

.tip-box {
  background: rgba(244, 164, 96, 0.08);
  border: 1px solid rgba(244, 164, 96, 0.2);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

.tip-box strong {
  color: var(--accent-dark);
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mat-light);
}

.route-desc {
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 1.9;
}

/* ========== STORY PAGE ========== */
.story-block {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.story-block::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat),
    var(--mat) 6px,
    var(--mat-light) 6px,
    var(--mat-light) 12px
  );
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.story-block p {
  color: var(--text-soft);
  line-height: 1.9;
}

/* ========== FAQ PAGE ========== */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
}

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

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 24px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--wood-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.faq-question:hover {
  color: var(--accent-dark);
}

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

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
  max-height: 800px;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--text-soft);
  line-height: 1.9;
  font-size: 0.95rem;
}

/* System Requirements Table */
.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}

.sys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.sys-table th {
  background: var(--wood-dark);
  color: var(--accent-light);
  font-weight: 600;
  font-family: var(--font-serif);
}

.sys-table td {
  background: var(--bg-card);
  color: var(--text-soft);
}

.sys-table tr:nth-child(even) td {
  background: var(--bg-warm);
}

.td-highlight {
  color: var(--pink-fierce);
  font-weight: 700;
}

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

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

/* ========== STORY / ENDING SECTIONS ========== */
.ending-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
  position: relative;
}

.ending-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat),
    var(--mat) 6px,
    var(--mat-light) 6px,
    var(--mat-light) 12px
  );
}

.ending-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.ending-card p {
  color: var(--text-soft);
}

/* ========== SECTION-SUBHEADING ========== */
.section-subheading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wood-dark);
  margin: 40px 0 24px;
}

/* ========== 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-gold { color: var(--accent-gold); }
.strong-red { color: var(--danger-red); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--wood-dark); }

/* ========== GAME INFO SECTION (index) ========== */
.game-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.game-info-text p {
  color: var(--text-soft);
  line-height: 1.9;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.info-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.info-badge {
  background: var(--bg-alt);
  color: var(--wood);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--mat-light);
}

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

.lightbox.active {
  display: flex;
}

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

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 1;
}

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

/* Welcome-mat top border for footer */
.site-footer::before {
  content: '';
  display: block;
  height: 8px;
  margin: -24px -24px 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--mat-dark),
    var(--mat-dark) 6px,
    var(--mat) 6px,
    var(--mat) 12px,
    var(--mat-light) 12px,
    var(--mat-light) 18px,
    var(--mat) 18px,
    var(--mat) 24px
  );
}

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .header-inner { height: 56px; }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--wood-dark);
    flex-direction: column;
    padding: 12px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 12px 24px;
    border-radius: 0;
  }

  .hamburger { display: flex; }

  .hero { min-height: 360px; }
  .hero-title { font-size: 2.2rem; }
  .hero-overlay { padding: 60px 20px; }

  .section { padding: 48px 0; }
  .section-title { font-size: 1.8rem; }
  .card-grid { grid-template-columns: 1fr; }

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

  .character-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .char-card img { height: 240px; }

  .screenshot-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

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

  .container, .container-narrow { padding: 0 16px; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .hero-title { font-size: 1.8rem; }
  .hero { min-height: 300px; }
  .header-cta { padding: 6px 14px; font-size: 0.8rem; }
  .character-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .char-card img { height: 200px; }
  .cta-btn { padding: 12px 28px; font-size: 1rem; }
}
