/* ============================================================
   忧郁的安娜 — Melancholy Anna
   Design: Rain-window blues + faded-photo sepias
   Tear-drop motifs on light overcast background
   ============================================================ */

/* ========== CSS VARIABLES ========== */
:root {
  /* Background palette — light overcast */
  --bg-overcast: #f2efeb;
  --bg-warm: #ece6de;
  --bg-paper: #f7f4f0;
  --bg-card: #faf8f5;
  --bg-white: #ffffff;

  /* Rain-window blues */
  --blue-rain: #7b9db5;
  --blue-deep: #4a6d8c;
  --blue-mist: #a8c5d6;
  --blue-fog: #c9dce8;
  --blue-dark: #2c4356;

  /* Faded-photo sepias */
  --sepia-light: #d4c4a8;
  --sepia-mid: #c4a882;
  --sepia-warm: #b8956a;
  --sepia-deep: #8b6f4e;
  --sepia-fade: #e0d5c0;

  /* Text */
  --text-primary: #3a3540;
  --text-secondary: #6b6570;
  --text-muted: #938d96;
  --text-soft: #b5afb8;

  /* Borders & accents */
  --border-subtle: #d4cfc7;
  --border-soft: #e0dbd3;
  --shadow-soft: rgba(44, 67, 86, 0.06);
  --shadow-card: rgba(44, 67, 86, 0.10);
  --shadow-hover: rgba(44, 67, 86, 0.15);

  /* Tear-drop accent */
  --tear: #b8ccdb;
  --tear-dark: #8aa8be;

  /* Typography */
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', 'Songti SC', Georgia, serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --max-width: 1100px;
  --header-height: 70px;
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-overcast);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle rain texture overlay on body */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(168, 197, 214, 0.03) 2px,
      rgba(168, 197, 214, 0.03) 4px
    );
  opacity: 0.5;
}

a {
  color: var(--blue-deep);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--blue-dark);
}

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

ul {
  list-style: none;
}

/* ========== HEADER ========== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 12px var(--shadow-soft);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-dark);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Tear-drop accent on logo */
.logo::after {
  content: '💧';
  font-size: 0.9rem;
  opacity: 0.5;
  margin-left: 2px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

nav a {
  display: block;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  position: relative;
  white-space: nowrap;
}

nav a:hover,
nav a.active {
  color: var(--blue-deep);
  background: rgba(168, 197, 214, 0.15);
}

/* Active indicator — tear-drop shape */
nav a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--tear-dark);
  border-radius: 50% 50% 50% 50% / 0% 0% 100% 100%;
}

/* Header CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--blue-deep);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(74, 109, 140, 0.25);
}

.btn-cta:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 109, 140, 0.35);
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.5) saturate(0.7);
  z-index: 0;
}

/* Rain overlay on hero */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(44, 67, 86, 0.55) 0%,
      rgba(44, 67, 86, 0.35) 50%,
      rgba(44, 67, 86, 0.55) 100%
    );
}

/* Rain streak effect */
.hero-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      10deg,
      transparent,
      transparent 1px,
      rgba(168, 197, 214, 0.06) 1px,
      rgba(168, 197, 214, 0.06) 3px
    );
}

/* Tear-drop decorations on hero edges */
.hero-overlay::after {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 50px;
  background: var(--tear);
  opacity: 0.15;
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 60px 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 28px;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.hero-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hero-badge span {
  display: inline-block;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

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

/* ========== MAIN LAYOUT ========== */
main {
  position: relative;
  z-index: 1;
}

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

.section-alt {
  background: var(--bg-warm);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, var(--sepia-mid), var(--blue-rain));
  border-radius: 2px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 1rem;
}

/* ========== GAME INTRO ========== */
.game-intro {
  max-width: 800px;
  margin: 0 auto;
}

.game-intro p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
}

/* ========== FEATURE CARDS ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 32px 24px 28px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-card);
  border-color: var(--blue-mist);
}

/* Tear-drop icon */
.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--blue-fog), var(--blue-mist));
  border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  font-size: 1.5rem;
  color: var(--blue-deep);
}

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

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ========== SCREENSHOT GALLERY ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--border-soft);
  background: var(--bg-card);
  aspect-ratio: 16 / 9;
}

.gallery-item:hover {
  border-color: var(--blue-rain);
  box-shadow: 0 6px 20px var(--shadow-hover);
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ========== REVIEWS / TESTIMONIALS ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
}

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

.review-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-top: 14px;
  margin-bottom: 16px;
}

.review-author {
  font-size: 0.85rem;
  color: var(--blue-deep);
  font-weight: 600;
}

/* ========== CTA BANNER ========== */
.cta-banner {
  text-align: center;
  padding: 48px 24px;
}

.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.cta-banner p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--blue-deep);
  color: #fff !important;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(74, 109, 140, 0.3);
}

.btn-large:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 109, 140, 0.4);
}

/* ========== CONTENT SECTION (story, characters, guide) ========== */
.content-section {
  padding: 64px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 24px;
  position: relative;
}

.content-section h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--sepia-mid), var(--blue-rain));
  border-radius: 2px;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 14px;
  padding-left: 16px;
  border-left: 3px solid var(--blue-rain);
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.9;
  font-size: 1.02rem;
}

.content-section ul,
.content-section ol {
  color: var(--text-secondary);
  margin-bottom: 18px;
  padding-left: 28px;
  line-height: 1.9;
}

.content-section ul li,
.content-section ol li {
  list-style: disc;
  margin-bottom: 8px;
}

.content-section ol li {
  list-style: decimal;
}

.prose {
  max-width: 800px;
  margin: 0 auto;
}

/* ========== CHARACTER CARDS ========== */
.char-card {
  display: flex;
  gap: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 28px;
  transition: all 0.3s ease;
}

.char-card:hover {
  box-shadow: 0 6px 20px var(--shadow-card);
  border-color: var(--blue-mist);
}

.char-card .char-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-soft);
}

.char-card .char-info h3 {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  font-size: 1.25rem;
}

.char-card .char-info .char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.char-card .char-info .char-traits span {
  display: inline-block;
  padding: 3px 12px;
  background: var(--blue-fog);
  color: var(--blue-deep);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ========== GUIDE TABLE ========== */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.guide-table th {
  background: var(--blue-dark);
  color: #fff;
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.guide-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

.guide-table tr:nth-child(even) td {
  background: var(--bg-card);
}

.guide-table tr:hover td {
  background: rgba(168, 197, 214, 0.08);
}

/* ========== FAQ ACCORDION ========== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

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

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.25s ease;
}

.faq-question:hover {
  background: rgba(168, 197, 214, 0.08);
}

.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-fog);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--blue-deep);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  background: var(--blue-rain);
  color: #fff;
}

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

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 15, 25, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

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

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1001;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ========== FOOTER ========== */
footer {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.85rem;
  border-top: 4px solid var(--sepia-mid);
  position: relative;
  z-index: 1;
}

/* Tear-drop divider in footer */
footer::before {
  content: '';
  display: block;
  width: 30px;
  height: 14px;
  margin: 0 auto 16px;
  background: var(--sepia-mid);
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  opacity: 0.6;
}

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

  .hamburger {
    display: flex;
  }

  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(247, 244, 240, 0.98);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 8px 24px var(--shadow-soft);
    transform: translateY(-110%);
    transition: transform 0.35s ease;
    z-index: 99;
  }

  nav.active {
    transform: translateY(0);
  }

  nav a {
    width: 100%;
    padding: 12px 18px;
  }

  .btn-cta {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .hero {
    min-height: 340px;
  }

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

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

  .section {
    padding: 48px 20px;
  }

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

  .char-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .char-card .char-info .char-traits {
    justify-content: center;
  }

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

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

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

  .hero-badge {
    gap: 4px;
  }

  .hero-badge span {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .section {
    padding: 36px 16px;
  }

  .feature-card {
    padding: 24px 18px;
  }
}

/* ========== UTILITY CLASSES ========== */
.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;
}
