/* ============================================================
   Devastate 中文官网 — 浅色末日废墟风格
   Color Palette:
   --ruin-gray: #9E9E9E    废墟灰
   --rust-red:  #D84315    铁锈红
   --sand-dust: #FFECB3    沙尘黄
   --dawn-white:#FDF5E6    破晓白
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --ruin-gray: #9E9E9E;
  --rust-red: #D84315;
  --sand-dust: #FFECB3;
  --dawn-white: #FDF5E6;
  --bg: #FDF5E6;
  --bg-alt: #FFF8E1;
  --text: #3E2723;
  --text-soft: #6D4C41;
  --text-muted: #8D6E63;
  --header-bg: #3E2723;
  --header-text: #FFECB3;
  --accent: #D84315;
  --accent-hover: #BF360C;
  --card-bg: #FFFFFF;
  --card-border: #D7CCC8;
  --card-accent: #D84315;
  --shadow: rgba(62, 39, 35, 0.12);
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "SimSun", "STSong", serif;
  --max-width: 1200px;
  --header-height: 64px;
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

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

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

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

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 3px solid var(--rust-red);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.header-logo-text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sand-dust);
  letter-spacing: 2px;
}

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

.header-nav a {
  color: var(--dawn-white);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.header-nav a:hover,
.header-nav a.active {
  background: var(--rust-red);
  color: #fff;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rust-red);
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.header-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* --- Hero Section (Index) --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--ruin-gray) 0%, #8D6E63 40%, var(--rust-red) 100%);
  padding: 80px 24px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../img/hero-bg.jpg') center/cover no-repeat;
  opacity: 0.25;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title-main {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--dawn-white);
  text-shadow: 2px 2px 8px rgba(62, 39, 35, 0.5);
  letter-spacing: 6px;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--sand-dust);
  opacity: 0.9;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-tagline {
  font-size: 1rem;
  color: rgba(255, 236, 179, 0.75);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Sub-page Hero (smaller) --- */
.hero-subpage {
  padding: 40px 24px 48px;
}

.hero-subpage .hero-title-main,
.hero-subpage-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--dawn-white);
  text-shadow: 1px 1px 4px rgba(62, 39, 35, 0.4);
  letter-spacing: 4px;
}

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

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  border-left: 4px solid var(--rust-red);
  padding-left: 16px;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}

.content-section p {
  margin-bottom: 16px;
  color: var(--text-soft);
  font-size: 1rem;
}

/* --- Chapter Title (story.html chapter sub-headings) --- */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rust-red);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--sand-dust);
}

/* --- Guide Intro & Route Desc --- */
.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 4px solid var(--rust-red);
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rust-red);
  margin: 24px 0 10px;
}

.route-desc {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--sand-dust);
}

/* --- Content Lists --- */
.content-list {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

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

.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(--rust-red);
  font-weight: 700;
}
.strong-gold {
  color: #E65100;
  font-weight: 700;
}
.strong-muted {
  color: var(--text-muted);
  font-weight: 700;
}
.strong-navy {
  color: #3E2723;
  font-weight: 700;
}

/* --- System Reqs Heading --- */
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
.sys-reqs-h3:first-of-type {
  margin-top: 0;
}

/* --- Table Scroll (for system requirements table overflow) --- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--card-accent);
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow);
}

.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rust-red);
  margin: 0 0 8px;
}

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

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

.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 28px 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
}

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

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

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

/* --- Screenshot Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px var(--shadow);
}

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

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(62, 39, 35, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: var(--dawn-white);
  cursor: pointer;
  background: none;
  border: none;
  z-index: 2001;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: var(--rust-red);
}

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

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

.review-card::before {
  content: "\201C";
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--sand-dust);
  position: absolute;
  top: 8px;
  left: 16px;
  line-height: 1;
}

.review-card p {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
  margin: 16px 0 12px;
}

.review-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

/* --- CTA Banner (Index Only) --- */
.cta-banner {
  background: linear-gradient(135deg, var(--rust-red) 0%, var(--accent-hover) 100%);
  padding: 56px 24px;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 48px;
}

.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--dawn-white);
  margin-bottom: 12px;
  border: none;
  padding: 0;
}

.cta-banner p {
  font-size: 1.05rem;
  color: var(--sand-dust);
  margin-bottom: 24px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dawn-white);
  color: var(--rust-red);
  padding: 14px 40px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.15s;
}
.cta-btn:hover {
  background: #fff;
  color: var(--rust-red);
  transform: translateY(-2px);
}

/* --- Character Cards --- */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.character-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s;
}
.character-card:hover {
  transform: translateY(-3px);
}

.character-card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

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

.character-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.character-role {
  display: inline-block;
  background: var(--sand-dust);
  color: var(--rust-red);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.character-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.trait-tag {
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  border: 1px solid var(--card-border);
}

/* --- Customization Dimensions Table --- */
.dimensions-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.dimensions-table th,
.dimensions-table td {
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  text-align: left;
  font-size: 0.95rem;
}

.dimensions-table th {
  background: var(--header-bg);
  color: var(--sand-dust);
  font-weight: 700;
}

.dimensions-table tr:nth-child(even) {
  background: var(--bg-alt);
}

.td-highlight {
  color: var(--rust-red);
  font-weight: 700;
}

/* --- FAQ Accordion --- */
.faq-list {
  margin-bottom: 48px;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

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

.faq-question::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--rust-red);
  font-weight: 700;
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
  content: "\2212";
  transform: rotate(180deg);
}

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

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

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

/* --- System Requirements Table --- */
.sys-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.sys-table th,
.sys-table td {
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  text-align: left;
  font-size: 0.95rem;
}

.sys-table th {
  background: var(--header-bg);
  color: var(--sand-dust);
  font-weight: 700;
  white-space: nowrap;
}

.sys-table tr:nth-child(even) {
  background: var(--bg-alt);
}

/* --- Tips Box --- */
.tips-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--rust-red);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
}

.tips-box strong {
  color: var(--rust-red);
}

/* --- Guide Step Number --- */
.guide-step {
  background: var(--rust-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 10px;
  flex-shrink: 0;
}

.guide-step-heading {
  display: flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--rust-red);
}
.breadcrumb span {
  margin: 0 6px;
}

/* --- Footer --- */
.site-footer {
  background: var(--header-bg);
  padding: 20px 24px;
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  color: var(--sand-dust);
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 0;
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 32px 0;
}

/* --- Decorative body pattern --- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 236, 179, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(216, 67, 21, 0.06) 0%, transparent 50%);
}

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

  html {
    font-size: 15px;
  }

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

  .header-nav {
    gap: 4px;
  }
  .header-nav a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .header-cta {
    padding: 6px 14px !important;
    font-size: 0.85rem;
  }

  .hero {
    padding: 56px 16px;
  }
  .hero-title-main {
    font-size: 2.2rem;
    letter-spacing: 3px;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-subpage {
    padding: 32px 16px 40px;
  }
  .hero-subpage .hero-title-main,
  .hero-subpage-title {
    font-size: 1.6rem;
    letter-spacing: 2px;
  }

  .content-section {
    padding: 32px 16px;
  }
  .content-section h2 {
    font-size: 1.7rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .info-cards,
  .feature-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    padding: 40px 16px;
  }
  .cta-banner h2 {
    font-size: 1.5rem;
  }

  .site-footer {
    padding: 16px;
  }
}

/* ============================================================
   RESPONSIVE: 480px
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --header-height: 52px;
  }

  html {
    font-size: 14px;
  }

  .header-inner {
    padding: 0 10px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header-logo-text {
    font-size: 1rem;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .header-nav a {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  .header-cta {
    padding: 5px 12px !important;
    font-size: 0.8rem;
  }

  .hero {
    padding: 40px 12px;
  }
  .hero-title-main {
    font-size: 1.7rem;
    letter-spacing: 2px;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-subpage {
    padding: 28px 12px 32px;
  }
  .hero-subpage .hero-title-main,
  .hero-subpage-title {
    font-size: 1.3rem;
    letter-spacing: 1px;
  }

  .content-section {
    padding: 24px 12px;
  }
  .content-section h2 {
    font-size: 1.4rem;
    padding-left: 12px;
    border-left-width: 3px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .character-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .cta-banner {
    padding: 32px 12px;
  }
  .cta-banner h2 {
    font-size: 1.3rem;
  }
  .cta-btn {
    padding: 12px 28px;
    font-size: 1rem;
  }
}
