/* ============================================
   洛娜的世界 — Dark Pixel Fantasy Theme
   Torchlight oranges + dungeon blacks
   Light stone background with pixel-art motifs
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg: #faf6f0;
  --bg-alt: #f0ebe3;
  --surface: #ffffff;
  --text: #2a2018;
  --text-secondary: #5c4a3a;
  --text-muted: #8a7560;

  --accent: #f4a460;
  --accent-dark: #d4893a;
  --accent-light: #fcd5b0;
  --torch: #ff6347;
  --torch-glow: #ff8c69;
  --dungeon: #1a1410;
  --dungeon-light: #2a2018;
  --stone: #d4a574;
  --stone-dark: #8c6a4a;
  --border: #d5cfc5;
  --border-light: #e8e3dc;
  --pixel-green: #6cb46c;
  --pixel-red: #c84848;

  --header-height: 64px;
  --max-width: 1100px;
  --radius: 4px;
  --shadow: 0 2px 8px rgba(26, 20, 16, 0.10);
  --shadow-lg: 0 4px 16px rgba(26, 20, 16, 0.12);
  --font-heading: 'Noto Serif SC', 'SimSun', 'STSong', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --font-pixel: 'Courier New', 'Consolas', monospace;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Pixel-art stone grid background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(180, 160, 140, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 160, 140, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

a {
  color: var(--torch);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--torch-glow);
  text-decoration: underline;
}

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

/* --- Accessibility --- */
.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(--dungeon);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 12px rgba(26, 20, 16, 0.3);
}
header::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg,
    var(--dungeon) 0%,
    var(--torch) 20%,
    var(--accent) 50%,
    var(--torch) 80%,
    var(--dungeon) 100%
  );
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.site-logo span {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.site-logo:hover span {
  color: var(--torch-glow);
}
.site-logo:hover {
  text-decoration: none;
}

/* Nav */
nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}
nav a {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--stone);
  font-family: var(--font-heading);
  border-radius: var(--radius);
  transition: all 0.2s;
  position: relative;
}
nav a:hover {
  color: var(--accent);
  background: rgba(244, 164, 96, 0.08);
  text-decoration: none;
}
nav a.active {
  color: var(--torch);
  background: rgba(255, 99, 71, 0.1);
}
nav a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--torch);
  transition: width 0.2s;
}
nav a:hover::after,
nav a.active::after {
  width: 50%;
}

/* Header CTA button */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--torch);
  color: #fff !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none !important;
}
.header-cta:hover {
  background: var(--torch-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 99, 71, 0.4);
}
.header-cta::before {
  content: '⬇';
  font-size: 0.8rem;
}

/* --- Main Content --- */
main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  margin: 0 calc(-1 * (100vw - 100%) / 2 - 20px);
  width: 100vw;
  max-width: 100vw;
  height: 480px;
  overflow: hidden;
  background: var(--dungeon);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 20, 16, 0.7) 0%,
    rgba(26, 20, 16, 0.5) 60%,
    rgba(26, 20, 16, 0.85) 100%
  );
  z-index: 1;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(rgba(244, 164, 96, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 164, 96, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 700px;
  padding: 0 20px;
}
.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 40px rgba(244, 164, 96, 0.3);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.hero-content .hero-subtitle {
  font-size: 1.15rem;
  color: var(--stone);
  margin-bottom: 24px;
  opacity: 0.9;
}
.hero-content .hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-family: var(--font-pixel);
  color: var(--accent-light);
  border: 1px solid var(--accent);
  background: rgba(244, 164, 96, 0.08);
  border-radius: 2px;
  letter-spacing: 0.05em;
}

/* --- Section --- */
.section {
  padding: 60px 0;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--dungeon);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 60px; height: 2px;
  background: var(--torch);
}
.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--dungeon);
  margin-bottom: 8px;
}
.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Feature cards (index page) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--torch);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.feature-card .feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--dungeon);
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Screenshot Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s;
}
.gallery-item:hover {
  border-color: var(--accent);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img {
  transform: scale(1.05);
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 20, 16, 0.92);
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: var(--accent);
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: var(--torch);
}

/* --- Testimonials / Reviews --- */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.review-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--stone-dark);
  border-radius: var(--radius);
  padding: 20px;
}
.review-card blockquote {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.review-card cite {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--stone-dark);
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--dungeon) 0%, var(--dungeon-light) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 164, 96, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 164, 96, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}
.cta-banner h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 10px;
  position: relative;
}
.cta-banner p {
  color: var(--stone);
  margin-bottom: 24px;
  position: relative;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--torch);
  color: #fff !important;
  border-radius: var(--radius);
  transition: all 0.2s;
  position: relative;
  text-decoration: none !important;
}
.cta-btn:hover {
  background: var(--torch-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 99, 71, 0.5);
  text-decoration: none;
}

/* --- Accordion (FAQ) --- */
.accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.accordion-item {
  border-bottom: 1px solid var(--border-light);
}
.accordion-item:last-child {
  border-bottom: none;
}
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--dungeon);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.accordion-header:hover {
  background: var(--bg-alt);
}
.accordion-header .icon {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s;
}
.accordion-item.active .accordion-header .icon {
  transform: rotate(45deg);
  color: var(--torch);
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.accordion-item.active .accordion-body {
  max-height: 500px;
}
.accordion-body-inner {
  padding: 0 20px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Guide Steps --- */
.guide-steps {
  counter-reset: step;
}
.guide-step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  counter-increment: step;
}
.guide-step-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: var(--dungeon);
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.guide-step-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--dungeon);
  margin-bottom: 6px;
}
.guide-step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Tip boxes */
.tip-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--dungeon-light);
}
.tip-box strong {
  color: var(--torch);
}

/* --- Story Page --- */
.story-chapter {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--torch);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.chapter-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--torch);
  margin-bottom: 8px;
}
.story-chapter p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* --- Character Cards --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.char-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.char-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.char-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg-alt);
}
.char-card-body {
  padding: 16px;
}
.char-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--dungeon);
  margin-bottom: 4px;
}
.char-role {
  font-size: 0.8rem;
  color: var(--torch);
  font-family: var(--font-pixel);
  margin-bottom: 8px;
}
.char-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.char-trait {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--font-pixel);
  color: var(--text-muted);
}

/* --- System Requirements Table --- */
.sysreq-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}
.sysreq-table th,
.sysreq-table td {
  padding: 10px 16px;
  border: 1px solid var(--border-light);
  text-align: left;
}
.sysreq-table th {
  background: var(--dungeon);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 700;
}
.sysreq-table td {
  background: var(--surface);
}
.sysreq-table tr:nth-child(even) td {
  background: var(--bg-alt);
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Breadcrumbs --- */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--accent-dark);
}
.breadcrumb span {
  margin: 0 6px;
}

/* --- Footer --- */
footer {
  background: var(--dungeon);
  border-top: 3px solid var(--accent);
  padding: 24px 20px;
  text-align: center;
  margin-top: 60px;
}
footer p {
  color: var(--stone);
  font-size: 0.85rem;
}

/* --- Page Header (inner pages) --- */
.page-header {
  padding: 48px 0 24px;
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--dungeon);
  margin-bottom: 8px;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 16px;
    gap: 8px;
  }
  nav ul {
    flex-wrap: wrap;
    gap: 2px;
  }
  nav a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .hero {
    height: 320px;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content .hero-subtitle {
    font-size: 1rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid,
  .feature-grid,
  .reviews {
    grid-template-columns: 1fr;
  }
  .char-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section {
    padding: 40px 0;
  }
  .guide-step {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-cta {
    width: 100%;
    justify-content: center;
  }
  .hero {
    height: 240px;
  }
  .hero-content h1 {
    font-size: 1.6rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .char-grid {
    grid-template-columns: 1fr;
  }
  .cta-banner {
    padding: 32px 20px;
  }
}
