/* ===========================================
   带我去地下城吧 — Dungeon Torchlight Theme
   Palette: torchlight-orange + dungeon-stone gray
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ——— CSS Variables ——— */
:root {
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* core palette */
  --bg: #faf7f2;
  --bg-card: #fefcf8;
  --bg-alt: #f5efe5;
  --bg-header: #1e1810;
  --bg-footer: #2a2218;
  --bg-hero-overlay: rgba(20,14,6,0.72);

  --text: #3d3226;
  --text-soft: #6b5d4e;
  --text-light: #8c7b68;
  --text-on-dark: #f0e6d8;
  --text-on-dark-soft: #bfae96;

  --accent: #d35400;
  --accent-light: #e67e22;
  --accent-glow: #f39c12;
  --accent-dark: #a04000;

  --stone: #8b7355;
  --stone-light: #b8a590;
  --stone-dark: #5c4a32;
  --cavern: #e8dfd2;

  --border: #ddd0c0;
  --border-card: #e5d8c6;

  --shadow-sm: 0 1px 3px rgba(60,40,20,0.08);
  --shadow-md: 0 4px 12px rgba(60,40,20,0.10);
  --shadow-lg: 0 8px 24px rgba(60,40,20,0.12);

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

/* ——— Reset & Base ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* cavern wall texture on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(210,170,120,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(180,140,100,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(200,160,110,0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* ——— 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 ——— */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
}
header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-on-dark);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}
header .logo img {
  height: 32px;
  width: 32px;
  border-radius: 4px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
header nav a {
  color: var(--text-on-dark-soft);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
header nav a:hover,
header nav a.active {
  color: var(--accent-light);
}
header nav a.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
}
header .btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(211,84,0,0.35);
}
header .btn-cta:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  box-shadow: 0 4px 16px rgba(211,84,0,0.5);
  transform: translateY(-1px);
}

/* ——— Hero Section ——— */
.hero {
  position: relative;
  z-index: 1;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(var(--bg-hero-overlay), rgba(15,10,4,0.85)),
    url('../img/hero-bg.jpg') center/cover no-repeat;
  padding: 80px 24px 96px;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg), transparent);
}
.hero-subpage {
  min-height: 240px;
  padding: 40px 24px 56px;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero-tagline {
  color: var(--accent-light);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hero-title-main {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 18px;
  text-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.hero-subtitle {
  font-size: 1.15rem;
  color: #e0d4c0;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.8;
}
.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* dungeon map decorative line */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,126,34,0.2) 20%, rgba(230,126,34,0.2) 80%, transparent);
  pointer-events: none;
}

/* ——— Main Content ——— */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 60px;
}
main > section { margin-bottom: 56px; }
main > section:last-child { margin-bottom: 0; }

/* section headings */
.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

/* ——— Content Section (subpages) ——— */
.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.35rem;
  font-weight: 600;
  color: var(--stone-dark);
  margin: 32px 0 14px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}
.content-section p {
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.85;
}

/* ——— Game Info Cards (index) ——— */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
}
.info-card .info-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.info-card .info-value {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

/* ——— Feature Cards (index) ——— */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ——— Screenshot Gallery ——— */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 2px solid var(--border-card);
}
.gallery a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.gallery img {
  display: block;
  width: 100%;
  height: auto;
}

/* ——— Review Cards ——— */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.review-card .review-stars {
  color: var(--accent-glow);
  font-size: 1rem;
  margin-bottom: 10px;
}
.review-card .review-text {
  font-style: italic;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.review-card .review-author {
  font-weight: 600;
  color: var(--text);
  font-size: 0.88rem;
}

/* ——— CTA Banner (index only) ——— */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-header), #342920);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(230,126,34,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(243,156,18,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.cta-banner h2 {
  position: relative;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 12px;
}
.cta-banner p {
  position: relative;
  color: var(--text-on-dark-soft);
  margin-bottom: 24px;
  font-size: 1rem;
}
.cta-banner .btn-download {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  padding: 14px 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(211,84,0,0.45);
}
.cta-banner .btn-download:hover {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-light));
  box-shadow: 0 6px 24px rgba(230,126,34,0.55);
  transform: translateY(-2px);
}

/* ——— Chapter / Story Elements ——— */
.chapter-list { list-style: none; }
.chapter-list li {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.chapter-list li strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-dark);
  margin-bottom: 4px;
}
.chapter-list li span {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 28px 0 10px;
}
.chapter-title:first-of-type { margin-top: 8px; }

/* ——— Character Cards ——— */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.char-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.char-card .char-info {
  padding: 20px 18px;
}
.char-card .char-info h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.char-card .char-role {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.char-card .char-desc {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 12px;
}
.char-grid-spaced { margin-bottom: 24px; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 12px; }
.char-card .char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.char-card .char-trait {
  background: var(--bg-alt);
  color: var(--stone-dark);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

/* ——— Guide Elements ——— */
.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
  padding: 0;
  border: none;
}
.guide-step p {
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 0;
}
.guide-tip {
  background: #fdf3e7;
  border: 1px solid #f0d6b0;
  border-left: 4px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 18px 0;
}
.guide-tip strong {
  color: var(--accent-dark);
}
.guide-intro {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 20px;
}
.route-desc {
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 12px;
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 24px 0 10px;
}
.section-subheading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 24px;
}

/* ——— Content Lists ——— */
.content-list {
  list-style: disc;
  padding-left: 24px;
  margin: 12px 0 18px;
}
.content-list-num {
  list-style: decimal;
  padding-left: 24px;
  margin: 12px 0 18px;
}
.content-li {
  color: var(--text-soft);
  margin-bottom: 5px;
  line-height: 1.75;
}
.content-li-sm { margin-bottom: 4px; }
.content-li-md { margin-bottom: 8px; }
.content-li-lg { margin-bottom: 10px; }

/* ——— Strong Highlights ——— */
.strong-orange { color: var(--accent); font-weight: 700; }
.strong-gold { color: var(--accent-glow); font-weight: 700; }
.strong-stone { color: var(--stone-dark); font-weight: 700; }
.strong-muted { color: var(--text-soft); font-weight: 600; }

/* ——— Table Styles ——— */
.table-scroll { overflow-x: auto; margin: 18px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-card);
  font-size: 0.92rem;
  line-height: 1.6;
}
th {
  background: var(--bg-header);
  color: var(--text-on-dark);
  font-weight: 600;
  font-family: var(--font-serif);
  font-size: 0.9rem;
}
td { color: var(--text-soft); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }
.td-highlight {
  color: var(--accent);
  font-weight: 700;
}
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--stone-dark);
  margin: 28px 0 14px;
  padding: 0;
  border: none;
}
.sys-reqs-h3:first-of-type { margin-top: 8px; }

/* ——— Accordion (FAQ) ——— */
.faq-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  position: relative;
  background: var(--bg-card);
  transition: background 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.25s;
}
.faq-item[open] summary::after {
  content: '−';
  transform: translateY(-50%);
}
.faq-item summary:hover { background: var(--bg-alt); }
.faq-item .faq-body {
  padding: 0 20px 18px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ——— Footer ——— */
footer {
  position: relative;
  z-index: 1;
  background: var(--bg-footer);
  border-top: 3px solid var(--accent);
  padding: 32px 24px;
  text-align: center;
}
footer p {
  color: var(--text-on-dark-soft);
  font-size: 0.88rem;
}

/* ——— Lightbox ——— */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1;
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
  :root { --header-height: 56px; }
  header .header-inner { padding: 0 16px; }
  header nav { gap: 16px; }
  header nav a { font-size: 0.82rem; }
  header .btn-cta { padding: 6px 14px; font-size: 0.8rem; }
  header .logo { font-size: 1rem; }

  .hero { min-height: 360px; padding: 60px 16px 72px; }
  .hero-title-main { font-size: 2.2rem; }
  .hero-tagline { font-size: 0.95rem; }
  .hero-subpage { min-height: 180px; padding: 32px 16px 44px; }
  .hero-subpage-title { font-size: 1.6rem; }

  main { padding: 32px 16px 40px; }
  .section-title { font-size: 1.55rem; }

  .info-cards { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .reviews { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
  .cta-banner { padding: 32px 20px; }
  .cta-banner h2 { font-size: 1.4rem; }

  .content-section h2 { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  header .header-inner { flex-wrap: wrap; gap: 8px; height: auto; padding: 8px 12px; }
  header .logo { font-size: 0.9rem; }
  header nav { flex-wrap: wrap; gap: 10px; }
  header nav a { font-size: 0.75rem; }
  header .btn-cta { font-size: 0.75rem; padding: 5px 10px; }

  .hero { min-height: 280px; padding: 48px 14px 56px; }
  .hero-title-main { font-size: 1.7rem; }
  .hero-tagline { font-size: 0.82rem; }
  .hero-subtitle { font-size: 0.88rem; }

  .info-cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .section-title { font-size: 1.3rem; }
  .content-section h2 { font-size: 1.4rem; }
}
