/* ========================================
   除灵阴阳师 Lustful Spirit Hunt
   Spirit Exorcism / Ofuda Onmyoji Theme
   Paper-Talisman Whites + Spiritual-Purification Blues
   Ofuda Seal Motifs · Japanese Onmyoji Mystical Aesthetic
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Spiritual-purification blues */
  --accent: #3a5ba8;
  --accent-hover: #4b6fc0;
  --accent-dark: #2a4a8a;
  --accent-light: #d8e2f4;
  --accent-pale: #edf2fa;

  /* Ofuda / talisman paper whites */
  --bg: #f7f4ee;
  --bg-card: #fcfaf5;
  --bg-alt: #efe9dc;
  --ofuda-white: #faf7f0;
  --paper-stain: #f0ebe0;

  /* Sacred seal gold */
  --gold: #b8962c;
  --gold-light: #d4b84a;
  --gold-pale: #f5ecd0;

  /* Sumi ink blacks */
  --ink: #1a1410;
  --ink-light: #3d3430;
  --ink-muted: #6d6058;

  /* Dark sacred navy */
  --header-bg: #161e30;
  --header-border: #2a3a5c;

  /* Text */
  --text: #2a2420;
  --text-light: #5a5048;
  --text-muted: #8a8078;
  --text-on-dark: #e8e4dc;
  --text-on-dark-muted: #a0a0b0;

  /* Functional */
  --white: #ffffff;
  --border: #d8d0c4;
  --border-light: #e8e2d8;
  --shadow: 0 2px 12px rgba(26, 20, 16, 0.06);
  --shadow-lg: 0 8px 32px rgba(26, 20, 16, 0.10);
  --radius: 4px;
  --radius-sm: 2px;
  --radius-lg: 6px;
  --max-width: 1200px;

  /* Typography */
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Noto Serif SC', 'STSong', 'Songti SC', 'SimSun', 'KaiTi', serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
}

/* Sacred ambient glow — subtle blue+gold paper radiance */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(58, 91, 168, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 25%, rgba(58, 91, 168, 0.03) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 70%, rgba(184, 150, 44, 0.04) 0%, transparent 50%);
}

/* ---- Sticky Header ---- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 16px rgba(26, 20, 16, 0.15);
}

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

/* Logo — ofuda-strip style */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 48px;
  background: linear-gradient(180deg, var(--ofuda-white) 0%, var(--paper-stain) 100%);
  border: 2px solid var(--gold);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
  position: relative;
}

/* Ofuda top seal mark */
.logo-icon::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  border-radius: 2px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-on-dark);
  letter-spacing: 0.05em;
}

/* Nav */
nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  text-decoration: none;
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  font-weight: 400;
}

nav a:hover,
nav a.active {
  color: var(--text-on-dark);
  background: rgba(58, 91, 168, 0.15);
}

/* Nav CTA — ofuda talisman button */
.nav-cta {
  background: var(--accent);
  color: var(--white) !important;
  font-weight: 500;
  padding: 8px 20px !important;
  border-radius: var(--radius-sm) !important;
  margin-left: 8px;
  border: 1px solid var(--accent-hover);
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 12px rgba(58, 91, 168, 0.4);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-on-dark);
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Main Content ---- */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(58, 91, 168, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(184, 150, 44, 0.06) 0%, transparent 50%);
}

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

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 40%, var(--ink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .ofuda-mark {
  display: inline-block;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  margin: 0 4px;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 20px;
  font-weight: 300;
}

.hero .hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.hero .hero-tags span {
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: 2px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  border: 1px solid var(--accent-light);
  font-weight: 500;
}

.hero .hero-visual {
  margin: 28px auto 0;
  max-width: 560px;
  border: 3px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero .hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Hero Buttons (for index page) ---- */
.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px rgba(58, 91, 168, 0.4);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  padding: 11px 30px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  border: 2px solid var(--accent);
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  font-family: var(--font);
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--white);
}

/* ---- Page Hero (sub-pages) ---- */
.page-hero {
  text-align: center;
  padding: 48px 24px 36px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(58, 91, 168, 0.06) 0%, transparent 50%);
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}

.page-hero p {
  color: var(--text-light);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

/* ---- Section Titles ---- */
h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  position: relative;
}

/* Ofuda-strip underline effect */
h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
}

h2.center-title {
  text-align: center;
}

h2.center-title::after {
  left: 50%;
  transform: translateX(-50%);
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 12px;
}

/* ---- Info Cards Grid ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.info-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}

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

.info-card .info-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-dark);
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-left-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-left-color: var(--accent-hover);
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

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

/* ---- Story Blocks ---- */
.story-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin: 20px 0;
}

.story-block .story-chapter {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.story-block h3 {
  margin-top: 0;
}

.story-block p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ---- Character Cards ---- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.char-card:hover {
  box-shadow: var(--shadow-lg);
}

.char-card .char-header {
  background: var(--header-bg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.char-card .char-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

.char-avatar.avatar-blue {
  background: linear-gradient(135deg, #5b7dc5 0%, #3a5ba8 100%);
}

.char-avatar.avatar-gold {
  background: linear-gradient(135deg, #c9a030 0%, #8a6a20 100%);
}

.char-avatar.avatar-green {
  background: linear-gradient(135deg, #4a7c59 0%, #2a5c39 100%);
}

.char-avatar.avatar-light-blue {
  background: linear-gradient(135deg, #6b8fd4 0%, #4a6fb8 100%);
}

.char-avatar.avatar-amber {
  background: linear-gradient(135deg, #b8962c 0%, #7a5a18 100%);
}

.char-card .char-info h3 {
  color: var(--text-on-dark);
  margin: 0;
  font-size: 1.1rem;
}

.char-card .char-info .char-role {
  color: var(--text-on-dark-muted);
  font-size: 0.85rem;
}

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

.char-card .char-body p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.7;
}

.char-card .char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ---- Guide Steps ---- */
.guide-steps {
  margin: 24px 0;
}

.guide-step {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
}

.guide-step:last-child {
  border-bottom: none;
}

.guide-step .step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(58, 91, 168, 0.3);
}

.guide-step .step-content h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

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

/* ---- FAQ Accordion ---- */
.faq-list {
  margin: 24px 0;
}

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

.faq-question {
  padding: 16px 44px 16px 18px;
  cursor: pointer;
  position: relative;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  user-select: none;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--accent-pale);
}

.faq-question::after {
  content: '＋';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 300;
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '－';
  transform: translateY(-50%) rotate(0deg);
}

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

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

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

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

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s, transform 0.2s;
  background: var(--bg-card);
}

.gallery-item:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

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

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-sm);
  padding: 40px 24px;
  text-align: center;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(58, 91, 168, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(184, 150, 44, 0.15) 0%, transparent 60%);
}

.cta-banner h2 {
  color: var(--text-on-dark);
  font-size: 1.6rem;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.cta-banner h2::after {
  display: none;
}

.cta-banner p {
  color: var(--text-on-dark-muted);
  font-size: 1rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.cta-banner .btn-primary {
  position: relative;
  z-index: 1;
}

/* ---- Ofuda Divider ---- */
.ofuda-divider {
  text-align: center;
  margin: 32px 0;
  font-size: 1.4rem;
  color: var(--accent-light);
  letter-spacing: 0.2em;
  position: relative;
}

.ofuda-divider::before,
.ofuda-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 80px;
  height: 1px;
  background: var(--accent-light);
}

.ofuda-divider::before { right: calc(50% + 30px); }
.ofuda-divider::after { left: calc(50% + 30px); }

/* ---- Tags ---- */
.tag-accent {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 2px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  border: 1px solid var(--accent-light);
  font-weight: 500;
}

.tag-gold {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 2px;
  background: var(--gold-pale);
  color: #7a6320;
  border: 1px solid var(--gold-light);
  font-weight: 500;
}

.tag-dark {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 2px;
  background: #e8e4dc;
  color: var(--ink-light);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* ---- Stats Row ---- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 24px 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---- Download Card ---- */
.download-card {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  margin: 24px 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.download-card h3 {
  margin-top: 0;
  font-size: 1.3rem;
}

.download-card .version {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 8px 0 16px;
}

/* ---- Info Table ---- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.info-table th,
.info-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.info-table th {
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-weight: 600;
  width: 140px;
}

.info-table td {
  color: var(--text-light);
}

/* ---- Tip Box ---- */
.tip-box {
  background: var(--accent-pale);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--text-light);
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px 0 0;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* ---- Lightbox ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(22, 30, 48, 0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  border: 3px solid var(--accent-light);
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 32px 24px;
  background: var(--header-bg);
  color: var(--text-on-dark-muted);
  font-size: 0.85rem;
  margin-top: 60px;
  border-top: 3px solid var(--accent);
}

footer p {
  margin: 4px 0;
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 24px; }
.mb-1 { margin-bottom: 12px; }
.mb-2 { margin-bottom: 24px; }
.section { margin: 32px 0; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 12px;
    gap: 2px;
    border-bottom: 3px solid var(--accent);
  }

  nav.show { display: flex; }

  nav a {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  .nav-cta { margin-left: 0; }

  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 2rem; }

  .info-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }

  .stats-row { gap: 16px; }
  .stat-value { font-size: 1.4rem; }

  .page-hero h1 { font-size: 1.6rem; }

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