/* ============================================================
   异族崛起 (Jikage Rising) — Alien Sci-Fi Theme
   Xenobiology greens + spaceship grays on light cosmic background
   ============================================================ */

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

  /* Alien sci-fi palette */
  --bg: #eef3f8;
  --bg-warm: #f2f6fa;
  --bg-card: #ffffff;
  --text: #1e2329;
  --text-secondary: #4a5565;
  --text-muted: #7a8699;

  --alien-green: #3d8c5e;
  --alien-green-light: #56b87a;
  --alien-green-dark: #2a6140;
  --alien-green-glow: rgba(61, 140, 94, 0.25);

  --space-gray: #4a5568;
  --space-gray-light: #6b7d95;
  --space-gray-dark: #2d3340;

  --cosmic-cyan: #3db8c8;
  --cosmic-cyan-glow: rgba(61, 184, 200, 0.3);
  --cosmic-purple: #8b5cf6;
  --cosmic-magenta: #c8508c;

  --header-bg: #111827;
  --header-text: #e5e7eb;
  --header-accent: #3d8c5e;
  --header-accent-border: #56b87a;

  --border: #dce3eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.25s ease;
  --max-width: 1160px;
}

/* ---------- CSS 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: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Cosmic background pattern via pseudo-element on body */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(61, 140, 94, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 25%, rgba(61, 184, 200, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 70%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 10% 60%, rgba(200, 80, 140, 0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Utility Classes ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.prose { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section-alt { background: var(--bg-warm); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--alien-green);
  font-weight: 700;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  margin-bottom: 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-accent-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}
.site-logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f0fdf4;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}
.site-logo::before {
  content: '';
  display: inline-block;
  width: 32px; height: 32px;
  background-image: url('../img/favicon.png');
  background-size: contain;
  border-radius: 4px;
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--header-text);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(61, 140, 94, 0.2);
  color: #56b87a;
}
.nav-cta {
  background: var(--alien-green) !important;
  color: #fff !important;
  font-weight: 600;
  padding: 8px 20px !important;
  margin-left: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-cta:hover {
  background: var(--alien-green-light) !important;
  color: #fff !important;
  box-shadow: 0 0 16px var(--alien-green-glow);
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--header-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}
.hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(
    180deg,
    rgba(17, 24, 39, 0.75) 0%,
    rgba(17, 24, 39, 0.6) 50%,
    rgba(30, 40, 55, 0.85) 100%
  );
}
/* Xenobiology hex grid overlay on hero */
.hero-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    repeating-linear-gradient(
      60deg, rgba(61, 140, 94, 0.08) 0px, rgba(61, 140, 94, 0.08) 1px,
      transparent 1px, transparent 30px
    ),
    repeating-linear-gradient(
      120deg, rgba(61, 184, 200, 0.06) 0px, rgba(61, 184, 200, 0.06) 1px,
      transparent 1px, transparent 30px
    );
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 760px;
  padding: 48px 24px;
}
.hero-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: 0.03em;
}
.hero-content p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  line-height: 1.7;
}
.hero-cta {
  display: inline-block;
  background: var(--alien-green);
  color: #fff;
  padding: 14px 40px;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--alien-green-glow);
}
.hero-cta:hover {
  background: var(--alien-green-light);
  box-shadow: 0 6px 28px rgba(61, 140, 94, 0.4);
  transform: translateY(-2px);
}

/* Page-specific hero backgrounds */
.hero-index .hero-bg  { background-image: url('../img/screenshot-01.jpg'); }
.hero-guide .hero-bg  { background-image: url('../img/screenshot-01.jpg'); }
.hero-story .hero-bg  { background-image: url('../img/screenshot-02.jpg'); }
.hero-chars .hero-bg  { background-image: url('../img/screenshot-01.jpg'); }
.hero-faq .hero-bg    { background-image: url('../img/screenshot-02.jpg'); }

/* ---------- Sections ---------- */
section {
  padding: 60px 24px;
  position: relative; z-index: 1;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--alien-green-dark);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

/* Xenobiology decorative divider */
.section-title::after {
  content: '';
  display: block;
  width: 60px; height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, var(--alien-green), var(--cosmic-cyan));
  border-radius: 2px;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--alien-green);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-left-color: var(--alien-green-light);
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--alien-green-dark);
  margin-bottom: 8px;
}
.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

/* ---------- Info Card (index intro) ---------- */
.info-card {
  max-width: var(--max-width);
  margin: 0 auto 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cosmic-cyan);
}
.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--space-gray-dark);
  margin-bottom: 12px;
}
.info-card p {
  color: var(--text-secondary);
  line-height: 1.8;
}
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}
.game-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-warm);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---------- Screenshot Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}
.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery-item::after {
  content: '🔍 点击放大';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0;
  transition: var(--transition);
}
.gallery-item:hover::after { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(61, 140, 94, 0.2);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none; border: none;
  z-index: 1;
}

/* ---------- Player Reviews ---------- */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cosmic-purple);
}
.review-card .reviewer {
  font-weight: 700;
  color: var(--space-gray-dark);
  margin-bottom: 6px;
}
.review-card .stars {
  color: #f0b028;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.review-card p {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.93rem;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--alien-green-dark), var(--space-gray-dark));
  color: #fff;
  text-align: center;
  padding: 56px 24px;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(61, 184, 200, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%);
  pointer-events: none;
}
.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.cta-banner p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
  position: relative; z-index: 1;
}
.cta-banner .btn {
  display: inline-block;
  background: #fff;
  color: var(--alien-green-dark);
  padding: 14px 44px;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  position: relative; z-index: 1;
}
.cta-banner .btn:hover {
  background: #f0fdf4;
  box-shadow: 0 4px 24px rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* ---------- Guide Page ---------- */
.guide-steps {
  max-width: 760px;
  margin: 0 auto;
  counter-reset: step;
}
.guide-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 28px 28px 64px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
  border-left: 4px solid var(--alien-green);
}
.guide-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px; top: 24px;
  width: 36px; height: 36px;
  background: var(--alien-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.guide-step h3 {
  font-family: var(--font-serif);
  color: var(--alien-green-dark);
  margin-bottom: 6px;
}
.guide-step p {
  color: var(--text-secondary);
  line-height: 1.8;
}
.tip-box {
  background: rgba(61, 140, 94, 0.06);
  border-left: 4px solid var(--cosmic-cyan);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-size: 0.93rem;
  color: var(--space-gray);
}

/* ---------- Story Page ---------- */
.story-section {
  max-width: 760px;
  margin: 0 auto;
}
.story-section p {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 18px;
}
.story-arc {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cosmic-purple);
}
.story-arc h3 {
  font-family: var(--font-serif);
  color: var(--cosmic-purple);
  margin-bottom: 8px;
  font-size: 1.15rem;
}

/* ---------- Character Cards ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.char-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.char-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.char-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--space-gray-light), var(--space-gray-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.3);
}
.char-card-body { padding: 20px; }
.char-card-body h3 {
  font-family: var(--font-serif);
  color: var(--alien-green-dark);
  margin-bottom: 6px;
}
.char-card-body .char-title {
  font-size: 0.85rem;
  color: var(--cosmic-purple);
  font-weight: 600;
  margin-bottom: 10px;
}
.char-card-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.char-traits span {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(61, 140, 94, 0.08);
  color: var(--alien-green-dark);
  border: 1px solid rgba(61, 140, 94, 0.15);
}

/* ---------- FAQ Page ---------- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 18px 24px;
  text-align: left;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.faq-question:hover { color: var(--alien-green); }
.faq-question .faq-icon {
  font-size: 1.2rem;
  transition: var(--transition);
  color: var(--alien-green);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-answer-inner {
  padding: 0 24px 18px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* System Requirements Table */
.sys-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.93rem;
}
.sys-table th, .sys-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.sys-table th {
  background: var(--bg-warm);
  font-weight: 700;
  color: var(--space-gray-dark);
}
.sys-table td { color: var(--text-secondary); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg);
  color: var(--text-muted);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.88rem;
  border-top: 3px solid var(--header-accent-border);
}
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .main-nav.mobile-open { display: flex; }
  .main-nav a { width: 100%; padding: 12px 16px; }
  .nav-cta { margin-left: 0; margin-top: 4px; }
  .hero { min-height: 300px; }
  .card-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
  section { padding: 40px 16px; }
  .guide-step { padding: 24px 20px 24px 56px; }
}

@media (max-width: 480px) {
  .hero-content h2 { font-size: 1.5rem; }
  .hero-content p { font-size: 0.95rem; }
  .section-title { font-size: 1.3rem; }
  .hero-cta { padding: 12px 28px; font-size: 1rem; }
}
