/* ============================================================
   奴隶之剑 (Slave's Sword) — Slave Rebellion Dark Fantasy Theme
   Chain-iron grays + rebellion-reds on light dungeon background
   ============================================================ */

/* --- CSS Variables / Theme Palette --- */
:root {
  /* Colors */
  --bg: #faf8f5;
  --bg-card: #f5f1eb;
  --bg-hero: #f0ebe0;
  --text: #2a2520;
  --text-soft: #5c554c;
  --text-muted: #8a8278;

  /* Chain-iron grays */
  --iron-dark: #3a3530;
  --iron: #55504a;
  --iron-light: #7a746e;
  --iron-pale: #b0aaa4;

  /* Rebellion reds */
  --crimson: #c41e3a;
  --crimson-dark: #8b0000;
  --crimson-flame: #dc143c;
  --crimson-deep: #a01020;
  --crimson-glow: rgba(196, 30, 58, 0.15);

  /* Accents */
  --gold: #c4a44a;
  --gold-light: #d4b85a;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Fonts */
  --font-sans: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', 'KaiTi', serif;

  /* Spacing */
  --max-width: 1100px;
  --header-height: 64px;
}

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

/* Dungeon stone background texture — subtle */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(196,30,58,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(85,80,74,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.01) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Broken-shackle body motif — decorative chain links scattered */
body::after {
  content: '';
  position: fixed;
  top: -120px;
  right: -80px;
  width: 300px;
  height: 300px;
  background:
    radial-gradient(circle 18px, transparent 40%, var(--iron-pale) 41%, transparent 43%) 0 0,
    radial-gradient(circle 18px, transparent 40%, var(--iron-pale) 41%, transparent 43%) 40px 0,
    radial-gradient(circle 18px, transparent 40%, var(--iron-pale) 41%, transparent 43%) 80px 0;
  background-size: 120px 120px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

/* --- Accessibility --- */
.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: linear-gradient(180deg, var(--iron-dark) 0%, #2a2520 100%);
  border-bottom: 3px solid var(--crimson);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  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;
  color: #f0e6d8;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-logo .logo-icon {
  font-size: 1.5rem;
  color: var(--crimson);
}

/* Broken-shackle icon in logo via pseudo */
.site-logo .logo-icon::before {
  content: '⛓';
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  color: #c4bbb0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.header-nav a:hover,
.header-nav a.active {
  color: #f0e6d8;
}

.header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--crimson);
  border-radius: 1px;
}

/* Header CTA button */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(196,30,58,0.35);
  white-space: nowrap;
}

.header-cta:hover {
  background: linear-gradient(135deg, var(--crimson-flame) 0%, var(--crimson) 100%);
  box-shadow: 0 4px 14px rgba(196,30,58,0.5);
  transform: translateY(-1px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  z-index: 1;
  padding: 60px 24px 80px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(42,37,32,0.06) 0%, transparent 40%),
    var(--bg-hero);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
}

/* Broken-shackle decorative overlay in hero */
.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  border: 2px dashed var(--iron-pale);
  border-radius: 50%;
  opacity: 0.25;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border: 2px dashed var(--iron-pale);
  border-radius: 50%;
  opacity: 0.25;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Sub-page hero variant */
.hero-subpage {
  padding: 40px 24px 48px;
}

.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

.hero-img-wrapper {
  max-width: 720px;
  margin: 0 auto 24px;
}

.hero-img-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 2px solid rgba(0,0,0,0.1);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--iron-dark);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 20px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* --- Main Content --- */
main {
  position: relative;
  z-index: 1;
}

.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

/* Section title group */
.section-title-group {
  text-align: center;
  margin-bottom: 36px;
}

.section-title-group-spaced {
  margin-top: 48px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--iron-dark);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

/* Broken-shackle divider under section titles */
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--crimson);
  margin: 10px auto 0;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Content section h2 (sub-page body titles) */
.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* --- Info Cards --- */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.info-card {
  background: var(--bg-card);
  border-left: 3px solid var(--crimson);
  padding: 18px 20px;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.info-card .info-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.info-card .info-value {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--iron-dark);
}

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

.feature-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--crimson);
  transition: box-shadow 0.25s, transform 0.25s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--iron-dark);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
}

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

.gallery-item {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 2px solid rgba(0,0,0,0.08);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Reviews --- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.review-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--crimson);
  opacity: 0.15;
  line-height: 1;
}

.review-card .review-text {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 12px;
  padding-top: 8px;
}

.review-card .review-author {
  font-size: 0.85rem;
  color: var(--iron-light);
  font-weight: 600;
}

.review-card .review-stars {
  color: var(--gold);
  font-size: 0.9rem;
}

/* --- CTA Banner (index only) --- */
.cta-banner {
  background: linear-gradient(135deg, var(--iron-dark) 0%, #1a1815 100%);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  border: 1px solid rgba(196,30,58,0.3);
  position: relative;
  overflow: hidden;
}

/* Broken-shackle motifs in CTA */
.cta-banner::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border: 2px dashed rgba(196,30,58,0.2);
  border-radius: 50%;
  pointer-events: none;
}

.cta-banner h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #f0e6d8;
  margin-bottom: 8px;
}

.cta-banner p {
  color: #b0a090;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(196,30,58,0.4);
}

.cta-btn:hover {
  background: linear-gradient(135deg, var(--crimson-flame) 0%, var(--crimson) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(196,30,58,0.55);
}

/* --- Guide Page --- */
.guide-steps-wrapper {
  counter-reset: guide-step;
}

.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 24px;
}

.guide-step {
  background: var(--bg-card);
  border-left: 3px solid var(--crimson);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.guide-step h3::before {
  counter-increment: guide-step;
  content: '#' counter(guide-step) ' ';
  color: var(--crimson);
  font-weight: 900;
}

.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--iron-dark);
  margin-bottom: 8px;
}

.guide-step p {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.tip-box {
  background: linear-gradient(135deg, rgba(196,30,58,0.06) 0%, rgba(139,0,0,0.03) 100%);
  border: 1px solid rgba(196,30,58,0.2);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0;
}

.tip-box .tip-label {
  font-weight: 700;
  color: var(--crimson);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.tip-box p {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* Route descriptions */
.route-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--crimson-dark);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(196,30,58,0.15);
}

/* --- Story Page --- */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--iron-dark);
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--crimson);
}

.chapter-block {
  background: var(--bg-card);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.chapter-block p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.chapter-block p:last-child {
  margin-bottom: 0;
}

/* --- Characters Page --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.char-card {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--crimson);
}

.char-card-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: var(--iron-pale);
}

.char-card-body {
  padding: 20px;
}

.char-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--iron-dark);
  margin-bottom: 6px;
}

.char-role {
  font-size: 0.82rem;
  color: var(--crimson);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.char-card-body p {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.char-trait {
  background: rgba(196,30,58,0.08);
  color: var(--crimson);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* Section-subheading for characters page */
.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--iron-dark);
}

/* --- FAQ Page --- */
.faq-list {
  max-width: 800px;
}

.faq-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--iron-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.faq-question:hover {
  background: rgba(0,0,0,0.02);
}

.faq-icon {
  font-size: 1.2rem;
  color: var(--crimson);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 2000px;
}

.faq-answer-inner {
  padding: 0 20px 20px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.faq-note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* System requirements table */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sys-reqs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.sys-reqs-table th,
.sys-reqs-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sys-reqs-table th {
  background: rgba(196,30,58,0.04);
  color: var(--iron);
  font-weight: 700;
  font-size: 0.82rem;
}

.sys-reqs-table td {
  color: var(--text-soft);
}

.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--iron-dark);
  margin-top: 24px;
  margin-bottom: 12px;
}

.sys-reqs-h3:first-of-type {
  margin-top: 8px;
}

/* --- Content List Classes --- */
.content-list {
  list-style: disc;
  padding-left: 20px;
  margin: 12px 0;
}

.content-list-num {
  list-style: decimal;
  padding-left: 24px;
  margin: 12px 0;
}

.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-red { color: var(--crimson); }
.strong-gold { color: var(--gold); }
.strong-muted { color: var(--text-muted); }
.strong-dark { color: var(--iron-dark); }

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

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 24px;
  text-align: center;
  background: rgba(0,0,0,0.02);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: var(--crimson);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .hero {
    padding: 40px 16px 56px;
  }

  .hero-subpage {
    padding: 32px 16px 40px;
  }

  .hero-tagline {
    font-size: 2rem;
  }

  .hero-subpage-title {
    font-size: 1.6rem;
  }

  .content-section {
    padding: 32px 16px;
  }

  .section-title {
    font-size: 1.7rem;
  }

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

  .header-nav {
    gap: 14px;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  .header-cta {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .feature-grid,
  .info-cards,
  .reviews-grid,
  .char-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .cta-banner {
    padding: 28px 20px;
  }

  .cta-banner h3 {
    font-size: 1.3rem;
  }

  .cta-btn {
    padding: 12px 30px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-tagline {
    font-size: 1.6rem;
  }

  .hero-subpage-title {
    font-size: 1.35rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .header-inner {
    padding: 0 12px;
  }

  .header-nav {
    gap: 8px;
  }

  .header-nav a {
    font-size: 0.75rem;
  }

  .site-logo {
    font-size: 1rem;
  }
}
