/* ============================================
   小镇的牧场生活 — Forestia Pastoral Ranch Theme
   Warm earth tones: forest greens, barn reds, hay-bale golds on cream.
   Peaceful countryside charm, unique to this game.
   ZERO inline styles. All styles MUST live here.
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg: #fefcf5;
  --bg-card: #fffaf0;
  --bg-alt: #f3eed8;
  --bg-header: #2e4a1e;
  --bg-hero: linear-gradient(160deg, #2e4a1e 0%, #4a7c3f 35%, #6b8e3a 65%, #2e4a1e 100%);
  --text: #3a2f1f;
  --text-muted: #7a6a52;
  --text-light: #a89878;
  --accent: #c44536;
  --accent-hover: #a8382c;
  --accent-light: rgba(196, 69, 54, 0.08);
  --gold: #c89820;
  --gold-light: #dab440;
  --gold-bg: rgba(200, 152, 32, 0.1);
  --green: #4a7c3f;
  --green-light: #6b9e4a;
  --green-bg: rgba(74, 124, 63, 0.08);
  --brown: #5c3d2e;
  --brown-light: #8b6914;
  --sky-blue: #5b8fa8;
  --pink-fierce: #c44536;
  --navy-blue: #2e4a1e;
  --danger-red: #c44536;
  --border: #e0d5c0;
  --border-light: #f0e8d5;
  --shadow: 0 2px 12px rgba(92, 61, 46, 0.06);
  --shadow-lg: 0 8px 32px rgba(92, 61, 46, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --font-main: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Noto Serif SC', 'SimSun', 'STSong', serif;
  --max-width: 1100px;
  --header-height: 64px;
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--brown); line-height: 1.35; }
h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.8rem; margin: 2.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.3rem; margin: 1.5rem 0 0.75rem; color: var(--accent); }
h4 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }

p { margin-bottom: 1rem; }

/* --- Screen Reader Only (for hidden h1 on index) --- */
.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: 100;
  background: var(--bg-header);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  height: var(--header-height);
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f5e6d3;
  text-decoration: none;
}
.header-logo:hover { color: var(--gold-light); }

.header-logo-img {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold);
}

.header-nav { display: flex; align-items: center; gap: 1.75rem; }

.header-nav a {
  color: #c8d6b0;
  font-size: 0.95rem; font-weight: 500;
  position: relative; padding: 0.25rem 0;
}
.header-nav a:hover, .header-nav a.active { color: var(--gold-light); }
.header-nav a.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--gold); border-radius: 1px;
}

.nav-cta {
  background: var(--accent) !important; color: #fff !important;
  padding: 0.45rem 1.25rem !important; border-radius: var(--radius) !important;
  font-weight: 600 !important; transition: background var(--transition) !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; color: #fff !important; }
.nav-cta::after { display: none !important; }

.menu-toggle { display: none; background: none; border: none; color: #c8d6b0; font-size: 1.5rem; cursor: pointer; padding: 0.25rem; }

/* --- Hero Section (Index) --- */
.hero {
  background: var(--bg-hero);
  color: #f5e6d3; padding: 4.5rem 1.5rem 3.5rem;
  text-align: center; position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(200, 152, 32, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 69, 54, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(74, 124, 63, 0.15) 0%, transparent 60%);
}

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

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px; padding: 0.3rem 1.2rem; font-size: 0.8rem;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 1.25rem;
  color: var(--gold-light);
}

/* Hero visible title — styled identically to h1 but NOT an h1 (sr-only h1 is separate) */
.hero-title-main {
  font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 700;
  color: #f5e6d3; margin-bottom: 1rem; line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-subtitle { font-size: 1.1rem; color: #d4c5b2; max-width: 600px; margin: 0 auto 1rem; line-height: 1.7; }

.hero-tagline { font-size: 0.95rem; color: #b8a088; max-width: 500px; margin: 0 auto 2rem; line-height: 1.6; }

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-visual {
  margin-top: 2.5rem; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
  max-width: 700px; margin-left: auto; margin-right: auto;
}

/* --- Sub-page Hero (guide/story/characters/faq) --- */
.hero-subpage {
  background: linear-gradient(160deg, #2e4a1e 0%, #5c3d2e 50%, #4a7c3f 100%);
  color: #f5e6d3; padding: 2.5rem 1.5rem 2rem;
  text-align: center; position: relative; overflow: hidden;
}
.hero-subpage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(200, 152, 32, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(74, 124, 63, 0.12) 0%, transparent 50%);
}
.hero-subpage .hero-inner { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }

.hero-subpage-title {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700;
  color: #f5e6d3; margin-bottom: 0.6rem; line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3); border: none;
}
.hero-subpage p.hero-subtitle { color: #d4c5b2; font-size: 1rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.75rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none;
  transition: all var(--transition); text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(196, 69, 54, 0.3); }

.btn-secondary { background: transparent; color: #f5e6d3; border: 1.5px solid rgba(245, 230, 211, 0.4); }
.btn-secondary:hover { border-color: var(--gold-light); color: var(--gold-light); }

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); color: #fff; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }

/* --- Info Grid --- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }

.info-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
  transition: all var(--transition);
}
.info-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.info-card-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.25rem; }
.info-card-value { font-weight: 600; color: var(--brown); font-size: 1rem; }

/* --- Feature Cards --- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

.feature-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 1.5rem; transition: all var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-left-color: var(--accent); }

.feature-card-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 0.75rem;
  background: var(--green-bg); color: var(--green);
}

.feature-card h3 { margin-top: 0; font-size: 1.15rem; color: var(--brown); }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0; }

/* --- Screenshot Gallery --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }

.gallery-item {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
  background: var(--bg-card);
}
.gallery-item:hover { border-color: var(--green); box-shadow: var(--shadow-lg); transform: scale(1.02); }
.gallery-item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.gallery-caption { padding: 0.6rem 0.75rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* --- Guide Steps --- */
.guide-steps { list-style: none; }

.guide-step {
  display: flex; gap: 1.25rem;
  padding: 1.5rem; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  margin-bottom: 1rem; transition: all var(--transition);
}
.guide-step:hover { box-shadow: var(--shadow); }

.guide-step-num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}

.guide-step-content h4 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.guide-step-content p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* --- Story Blocks --- */
.story-block {
  background: var(--bg-card); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
  transition: all var(--transition);
}
.story-block:hover { box-shadow: var(--shadow); }
.story-block h3 { margin-top: 0; color: var(--brown); }
.story-block p { color: var(--text-muted); margin-bottom: 0; }

.story-chapter { color: var(--gold); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.25rem; }

/* Chapter title (story.html sub-headings) */
.chapter-title {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--brown);
  margin: 2rem 0 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 2px dashed var(--border);
}

/* --- Character Cards --- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

.char-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition);
}
.char-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.char-card-header {
  background: var(--bg-alt); padding: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.char-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}

.char-name { font-weight: 700; color: var(--brown); font-size: 1.05rem; }
.char-role { font-size: 0.8rem; color: var(--accent); font-weight: 500; }
.char-card-body { padding: 1.25rem; }
.char-card-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0; }

.char-traits { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.char-trait {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 12px;
  font-size: 0.75rem; font-weight: 500;
  background: var(--green-bg); color: var(--green);
}
.char-trait-gold { background: var(--gold-bg); color: var(--gold); }
.char-trait-red { background: var(--accent-light); color: var(--accent); }

/* Section sub-heading (characters page group titles) */
.section-subheading {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--brown);
  margin: 40px 0 24px;
  padding-bottom: 0.4rem;
  border-bottom: 2px dotted var(--border);
}

/* --- Tags --- */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { display: inline-block; padding: 0.25rem 0.8rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; background: var(--accent-light); color: var(--accent); }
.tag-gold { background: var(--gold-bg); color: var(--gold); }
.tag-green { background: var(--green-bg); color: var(--green); }

/* --- FAQ Accordion --- */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden;
}

.faq-question {
  width: 100%; padding: 1rem 1.25rem; text-align: left;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 600; color: var(--brown);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; font-family: var(--font-main); line-height: 1.5;
}
.faq-question:hover { color: var(--accent); }

.faq-icon { flex-shrink: 0; font-size: 1.2rem; transition: transform var(--transition); color: var(--text-muted); }
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--accent); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-answer { max-height: 700px; }

.faq-answer-inner { padding: 0 1.25rem 1.25rem; color: var(--text-muted); font-size: 0.92rem; line-height: 1.7; }

/* --- Content Lists (avoid inline style="list-style:...") --- */
.content-list { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.content-list-num { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }

.content-li { margin-bottom: 5px; color: var(--text-muted); }
.content-li-sm { margin-bottom: 4px; color: var(--text-muted); }
.content-li-md { margin-bottom: 8px; color: var(--text-muted); }
.content-li-lg { margin-bottom: 10px; color: var(--text-muted); }

/* --- Colored Strong tags --- */
.strong-red { color: var(--accent); }
.strong-gold { color: var(--gold); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--navy-blue); }

/* --- Highlighted Table Cells --- */
.td-highlight { color: var(--accent); font-weight: 700; }

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

.sys-reqs-h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: var(--brown);
  margin: 1.8rem 0 0.75rem;
}
.sys-reqs-h3:first-of-type { margin-top: 0.5rem; }

/* --- Guide Intro / Route Desc --- */
.guide-intro { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.8; }

.route-heading {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  color: var(--accent);
  margin: 1.8rem 0 0.5rem;
}

.route-desc { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 1rem; line-height: 1.75; }

/* --- CTA Banner (index only) --- */
.cta-banner {
  background: linear-gradient(135deg, #4a7c3f 0%, #5c3d2e 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem; text-align: center; color: #f5e6d3; margin: 2rem 0;
}
.cta-banner h2 { color: #f5e6d3; border: none; margin-top: 0; font-size: 1.6rem; }
.cta-banner p { color: #d4c5b2; max-width: 500px; margin: 0.5rem auto 1.5rem; }

/* --- Breadcrumbs --- */
.breadcrumbs { padding: 1rem 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--brown); font-weight: 500; }

/* --- Blockquote --- */
blockquote {
  background: var(--bg-alt); border-left: 4px solid var(--gold);
  padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted); font-style: italic;
}

/* --- Table --- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { background: var(--bg-alt); color: var(--brown); font-weight: 600; }
tr:hover td { background: var(--bg-card); }

/* --- Tip Box --- */
.tip-box { background: var(--gold-bg); border: 1px solid rgba(200, 152, 32, 0.25); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.tip-box-title { font-weight: 700; color: var(--gold); margin-bottom: 0.25rem; font-size: 0.9rem; }
.tip-box p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* --- Stats Row --- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* --- Lightbox --- */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999; align-items: center; justify-content: center; cursor: pointer; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; color: #fff; font-size: 2rem; background: none; border: none; cursor: pointer; line-height: 1; opacity: 0.7; transition: opacity var(--transition); }
.lightbox-close:hover { opacity: 1; }

/* --- Reviews / Testimonial --- */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }

.review-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: all var(--transition);
}
.review-card:hover { box-shadow: var(--shadow); }
.review-stars { color: var(--gold); font-size: 1rem; margin-bottom: 0.5rem; }
.review-text { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; font-style: italic; line-height: 1.65; }
.review-author { font-size: 0.8rem; color: var(--text-light); font-weight: 500; }

/* --- Footer --- */
.site-footer { background: var(--bg-header); color: #a0b888; padding: 1.5rem 1.5rem; text-align: center; font-size: 0.85rem; margin-top: 3rem; }
.site-footer p { margin-bottom: 0; }

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.justify-center { justify-content: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mx-auto { max-width: 800px; margin-left: auto; margin-right: auto; }
.pb-0 { padding-bottom: 0; }
.pt-0 { padding-top: 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --header-height: 56px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }
  .header-nav { display: none; }
  .header-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-header); padding: 1rem 1.5rem; gap: 0.75rem; box-shadow: 0 4px 8px rgba(0,0,0,0.15); z-index: 99; }
  .menu-toggle { display: block; }
  .hero-title-main { font-size: 2rem; }
  .hero-subpage-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .guide-step { flex-direction: column; gap: 0.75rem; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .char-grid, .gallery-grid, .reviews-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-title-main { font-size: 1.6rem; }
  .hero-subpage-title { font-size: 1.4rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .info-grid { grid-template-columns: 1fr; }
}
