/* ============================================================
   永恒的欠损 (La Vitalis: Immortal Loss) — Eternal Loss Theme
   Design: faded-memory grays, void-blacks, broken-mirror motifs
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --void: #0a0a0a;
  --void-soft: #1a1a1a;
  --bg: #f4f1ed;
  --bg-warm: #f0ece7;
  --bg-card: #faf8f5;
  --text: #2c2a28;
  --text-soft: #6b6560;
  --text-muted: #9e9892;
  --fade-gray: #8a8580;
  --fade-light: #b0aba5;
  --fade-ghost: #d5d0ca;
  --shatter: #c0b8b0;
  --shatter-dark: #9e948a;
  --accent-dark: #3b3530;
  --accent-ghost: #8c9498;
  --border: #e8e4df;
  --shadow: rgba(10,10,10,0.06);
  --shadow-md: rgba(10,10,10,0.10);
  --font-sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-serif: "Noto Serif SC", "SimSun", "STSong", serif;
  --radius: 6px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
}

/* ---------- 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;
}

/* Subtle void-pattern body background — broken shards */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, transparent 48%, var(--fade-ghost) 48%, var(--fade-ghost) 52%, transparent 52%) 0 0 / 80px 80px,
    linear-gradient(225deg, transparent 48%, var(--fade-ghost) 48%, var(--fade-ghost) 52%, transparent 52%) 40px 0 / 80px 80px;
  opacity: 0.15;
  pointer-events: none;
}

a { color: var(--accent-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--void); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 24px; }
.section-alt { background: var(--bg-warm); }
.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}
.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 40px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--void);
  border-bottom: 3px solid var(--shatter);
  box-shadow: 0 2px 16px var(--shadow);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fade-ghost);
  letter-spacing: 2px;
  white-space: nowrap;
}
.header-logo:hover { color: #fff; text-decoration: none; }
.header-nav { display: flex; gap: 8px; align-items: center; }
.header-nav a {
  color: var(--fade-light);
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}
.header-nav a:hover,
.header-nav a.active { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.header-cta {
  display: inline-block;
  background: var(--shatter);
  color: var(--void) !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 20px !important;
  border-radius: var(--radius);
  letter-spacing: 1px;
  transition: var(--transition);
  white-space: nowrap;
}
.header-cta:hover {
  background: #d4ccc4;
  text-decoration: none !important;
  color: var(--void) !important;
}

/* ---------- Hero (Index — full height) ---------- */
.hero {
  position: relative;
  padding: 80px 24px 100px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 60%, var(--fade-ghost) 100%);
  overflow: hidden;
}
/* Broken mirror shatter overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(30deg, transparent 30%, rgba(192,184,176,0.08) 30%, rgba(192,184,176,0.08) 32%, transparent 32%),
    linear-gradient(-45deg, transparent 55%, rgba(192,184,176,0.06) 55%, rgba(192,184,176,0.06) 57%, transparent 57%),
    linear-gradient(15deg, transparent 70%, rgba(158,148,138,0.05) 70%, rgba(158,148,138,0.05) 73%, transparent 73%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--shatter-dark) 30%, var(--shatter) 50%, var(--shatter-dark) 70%, transparent 100%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--void);
  margin-bottom: 12px;
  letter-spacing: 4px;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin-bottom: 8px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.hero-tagline {
  font-size: 1.05rem;
  color: var(--fade-gray);
  max-width: 580px;
  margin: 0 auto 32px;
  font-style: italic;
}
.hero-image {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow-md);
}

/* ---------- Sub-page Hero (guide, story, characters, faq) ---------- */
.hero-subpage {
  padding: 40px 24px 48px;
}
.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* ---------- Info Cards (index) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px var(--shadow-md);
}
.info-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--shatter-dark), var(--fade-gray), var(--shatter-dark));
}
.info-card-icon { font-size: 2rem; margin-bottom: 10px; }
.info-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--void);
  margin-bottom: 6px;
}
.info-card-desc { font-size: 0.9rem; color: var(--text-soft); }

/* ---------- Feature Cards (index) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border-left: 4px solid var(--shatter-dark);
  box-shadow: 0 2px 12px var(--shadow);
  transition: var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px var(--shadow-md); }
.feature-card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--void);
  margin-bottom: 10px;
}
.feature-card-desc { font-size: 0.95rem; color: var(--text-soft); line-height: 1.8; }

/* ---------- Screenshot Gallery (index) ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.gallery-grid img {
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--shadow);
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.gallery-grid img:hover { transform: scale(1.03); box-shadow: 0 6px 20px var(--shadow-md); }

/* ---------- Reviews (index) ---------- */
.review-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  position: relative;
}
.review-card::before {
  content: "\201C";
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--fade-ghost);
  line-height: 1;
}
.review-text {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 12px;
  padding-top: 24px;
}
.review-author { font-size: 0.85rem; color: var(--fade-gray); font-weight: 600; }

/* ---------- CTA Banner (index only) ---------- */
.cta-banner {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--void-soft) 0%, var(--void) 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(30deg, transparent 25%, rgba(192,184,176,0.06) 25%, rgba(192,184,176,0.06) 27%, transparent 27%),
    linear-gradient(-60deg, transparent 60%, rgba(192,184,176,0.05) 60%, rgba(192,184,176,0.05) 62%, transparent 62%);
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fade-ghost);
  margin-bottom: 8px;
}
.cta-banner p { color: var(--fade-light); margin-bottom: 24px; font-size: 1rem; }
.cta-btn {
  display: inline-block;
  background: var(--shatter);
  color: var(--void);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 40px;
  border-radius: var(--radius);
  letter-spacing: 2px;
  transition: var(--transition);
  text-decoration: none !important;
}
.cta-btn:hover { background: #d4ccc4; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(192,184,176,0.4); }

/* ---------- Content Section (sub-pages) ---------- */
.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.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.4rem;
  font-weight: 700;
  color: var(--void);
  margin: 36px 0 14px;
}
.content-section p {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 16px;
}

/* ---------- Chapter Title (story.html sub-headings) ---------- */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--void);
  margin-top: 32px;
  margin-bottom: 12px;
}

/* ---------- Guide Intro / Route Desc (guide.html) ---------- */
.guide-intro {
  font-size: 1.02rem;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 20px;
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--void);
  margin-top: 28px;
  margin-bottom: 12px;
}
.route-desc {
  font-size: 0.98rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 16px;
}

/* ---------- Content List Classes ---------- */
.content-list {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}
.content-list-num {
  list-style: decimal;
  padding-left: 24px;
  margin-bottom: 20px;
}
.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-muted { color: var(--text-muted); }
.strong-gold { color: var(--shatter-dark); }
.strong-red { color: #8b4513; }

/* ---------- Table Highlight Cell ---------- */
.td-highlight { color: var(--shatter-dark); font-weight: 700; }

/* ---------- System Requirements H3 ---------- */
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--void);
  margin-top: 24px;
  margin-bottom: 12px;
}
.sys-reqs-h3:first-of-type { margin-top: 8px; }

/* ---------- Section Subheading ---------- */
.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
}

/* ---------- Table Scroll ---------- */
.table-scroll { overflow-x: auto; margin-bottom: 24px; }
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table-scroll th,
.table-scroll td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.table-scroll th {
  background: var(--void-soft);
  color: var(--fade-ghost);
  font-weight: 700;
  font-family: var(--font-sans);
}
.table-scroll tr:nth-child(even) { background: var(--bg-card); }
.table-scroll tr:nth-child(odd) { background: #fff; }

/* ---------- Accordion (faq.html) ---------- */
.accordion-item {
  border-bottom: 1px solid var(--border);
}
.accordion-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 18px 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.accordion-btn:hover { color: var(--void); }
.accordion-icon {
  font-size: 1.2rem;
  color: var(--fade-gray);
  transition: transform var(--transition);
}
.accordion-item.open .accordion-icon { transform: rotate(45deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.accordion-body-inner {
  padding: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}

/* ---------- Character Cards (characters.html) ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.char-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
  transition: var(--transition);
  position: relative;
}
.char-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px var(--shadow-md); }
.char-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--shatter-dark), var(--fade-gray), var(--shatter-dark));
}
.char-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-warm);
}
.char-card-body { padding: 20px; }
.char-card-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--void);
  margin-bottom: 6px;
}
.char-card-role { font-size: 0.85rem; color: var(--fade-gray); margin-bottom: 10px; }
.char-card-desc { font-size: 0.9rem; color: var(--text-soft); line-height: 1.7; }
.char-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.char-tag {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-warm);
  color: var(--fade-gray);
  border: 1px solid var(--border);
}

/* ---------- Content Box (tips, warnings) ---------- */
.content-box {
  background: var(--bg-card);
  border-left: 4px solid var(--shatter-dark);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.content-box-title { font-weight: 700; color: var(--void); margin-bottom: 6px; }
.content-box p { font-size: 0.92rem; color: var(--text-soft); margin-bottom: 0; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,10,10,0.92);
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 2.5rem;
  color: var(--fade-ghost);
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
  transition: var(--transition);
}
.lightbox-close:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  background: var(--void);
  color: var(--fade-gray);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; letter-spacing: 2px; }
  .hero-subtitle { font-size: 1rem; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px; }
  .header-nav { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .header-nav a { font-size: 0.82rem; padding: 4px 10px; }
  .section-title { font-size: 1.6rem; }
  .content-section h2 { font-size: 1.6rem; }
  .content-section { padding: 32px 16px 48px; }
  .feature-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .char-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-subpage-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; }
  .hero { padding: 48px 16px 64px; }
  .info-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .cta-banner h2 { font-size: 1.3rem; }
  .header-logo { font-size: 1.05rem; }
}
