/* ============================================================
   精灵忍者逃走中 (Flee, My Elven Ninja!) — Ninja Stealth Theme
   Shadow blacks + Ninja crimson + Emerald accents + Rice-paper bg
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --accent: #c41e3a;
  --accent-dark: #8b0000;
  --accent-light: rgba(196, 30, 58, 0.12);
  --accent-hover: #a0182f;
  --emerald: #27ae60;
  --emerald-dark: #1e8449;
  --emerald-light: rgba(39, 174, 96, 0.10);
  --bg: #faf5eb;
  --bg-rice: #f5f0e6;
  --bg-header: #0d0d0d;
  --bg-footer: #111111;
  --bg-card: #ffffff;
  --bg-dark: #1a1a1a;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --text-muted: #999999;
  --text-header: #e0e0e0;
  --text-on-dark: #f0f0f0;
  --border: #e0d8cc;
  --border-light: #f0ebe0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-body: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-heading: 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
  --transition: 0.25s ease;
  --max-width: 1200px;
}

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

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

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

/* Rice-paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(196,30,58,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(39,174,96,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

main { flex: 1; position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text); line-height: 1.3; }
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.65rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* --- Header --- */
header {
  background: var(--bg-header);
  color: var(--text-header);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--emerald);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  display: inline-block;
}

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

nav a {
  color: #b0b0b0;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

nav a:hover, nav a.active { color: #ffffff; }
nav a:hover::after, nav a.active::after { width: 100%; }

/* Shuriken divider in nav */
nav .nav-sep {
  color: var(--accent);
  font-size: 0.6rem;
  opacity: 0.5;
}

.nav-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff !important;
  padding: 8px 22px !important;
  border-radius: var(--radius-md);
  font-weight: 700;
  letter-spacing: 1px;
  transition: transform var(--transition), box-shadow var(--transition) !important;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.nav-cta::after { display: none; }

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196,30,58,0.45);
  color: #ffffff !important;
}

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

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 72px 20px 64px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-header) 0%, #1a1512 40%, var(--bg) 100%);
  color: var(--text-on-dark);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(196,30,58,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: 20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(39,174,96,0.10) 0%, transparent 70%);
  pointer-events: none;
}

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

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero .hero-subtitle {
  font-size: 1.15rem;
  color: #c0c0c0;
  margin-bottom: 8px;
  font-weight: 400;
}

.hero .hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 28px;
}

.hero-tags .tag {
  display: inline-block;
  background: rgba(255,255,255,0.10);
  color: #d0d0d0;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.15);
}

.hero-tags .tag-accent {
  background: rgba(196,30,58,0.25);
  border-color: rgba(196,30,58,0.5);
  color: #ff6b81;
}

.hero .btn-hero {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  padding: 14px 40px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  transition: transform var(--transition), box-shadow var(--transition);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.hero .btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(196,30,58,0.5);
  color: #ffffff;
}

/* Page hero (smaller, for sub-pages) */
.page-hero {
  position: relative;
  padding: 48px 20px 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-header) 0%, #1a1512 60%, var(--bg) 100%);
  color: var(--text-on-dark);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(196,30,58,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero h1 {
  font-size: 2rem;
  color: #ffffff;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.page-hero .breadcrumbs {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #909090;
}

.page-hero .breadcrumbs a { color: var(--accent); }
.page-hero .breadcrumbs a:hover { color: #ff6b81; }

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

.section-title {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  padding-bottom: 16px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--accent);
}

/* Shuriken motif divider */
.shuriken-divider {
  text-align: center;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 8px;
  margin: 40px 0;
  opacity: 0.5;
}

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

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.info-card .info-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

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

.info-card .info-value {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  transition: width var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.feature-card:hover::before { width: 6px; }

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

.feature-card h3 { margin-bottom: 10px; font-size: 1.15rem; }

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

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

.gallery-grid img {
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 2px solid var(--border);
}

.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* --- Story Blocks --- */
.story-block {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.story-block:hover { box-shadow: var(--shadow-md); }

.story-block .story-chapter {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.story-block h3 { margin-bottom: 8px; }

.story-block p { color: var(--text-light); line-height: 1.75; }

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

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.char-card .char-header {
  background: var(--bg-dark);
  color: #ffffff;
  padding: 20px 24px;
  position: relative;
}

.char-card .char-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--emerald));
}

.char-card .char-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.char-card .char-role {
  font-size: 0.85rem;
  color: #909090;
  margin-top: 4px;
}

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

.char-card .char-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: -40px auto 16px;
  background: var(--bg-card);
  position: relative;
}

.char-card .char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.char-card .trait-tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

.char-card .trait-tag.emerald {
  background: var(--emerald-light);
  color: var(--emerald-dark);
}

/* --- Guide Steps --- */
.guide-steps {
  max-width: 720px;
  margin: 0 auto;
}

.guide-step {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
  align-items: flex-start;
}

.guide-step .step-num {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
}

.guide-step .step-num::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(1.6); opacity: 0; }
}

.guide-step .step-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}

.guide-step .step-content h3 {
  color: var(--accent-dark);
  margin-bottom: 6px;
}

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

/* --- Tip Box --- */
.tip-box {
  background: var(--emerald-light);
  border-left: 4px solid var(--emerald);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 24px 0;
}

.tip-box .tip-label {
  font-weight: 700;
  color: var(--emerald-dark);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

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

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

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

.faq-item:hover { border-color: var(--accent); }

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

.faq-question .faq-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

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

.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;
  padding: 0 22px 18px;
}

.faq-answer p {
  color: var(--text-light);
  line-height: 1.75;
  font-size: 0.95rem;
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-dark), #1a1512);
  color: #ffffff;
  text-align: center;
  padding: 48px 20px;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(196,30,58,0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(39,174,96,0.08) 0%, transparent 50%);
}

.cta-banner h2 { color: #ffffff; position: relative; z-index: 2; }

.cta-banner p { color: #b0b0b0; position: relative; z-index: 2; margin-bottom: 20px; }

.cta-banner .btn-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  padding: 14px 40px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
  transition: transform var(--transition), box-shadow var(--transition);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.cta-banner .btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(196,30,58,0.5);
  color: #ffffff;
}

/* --- Tags --- */
.tag { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 0.82rem; }
.tag-red { background: var(--accent-light); color: var(--accent); }
.tag-green { background: var(--emerald-light); color: var(--emerald-dark); }

/* --- Tables --- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

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

.info-table th {
  background: var(--bg-rice);
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  width: 160px;
}

.info-table td { color: var(--text-light); font-size: 0.95rem; }

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

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

.stat-item .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-heading);
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Blockquote --- */
blockquote {
  border-left: 4px solid var(--emerald);
  background: var(--emerald-light);
  padding: 16px 22px;
  margin: 20px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-light);
  font-style: italic;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  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: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  cursor: default;
}

.lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1;
  line-height: 1;
}

/* --- Footer --- */
footer {
  background: var(--bg-footer);
  color: #666666;
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
  border-top: 2px solid #222222;
}

footer p { margin: 0; }

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

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

  nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-header);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    border-bottom: 2px solid var(--accent);
    z-index: 99;
  }

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

  nav .nav-sep { display: none; }

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

  .guide-step { flex-direction: column; gap: 12px; }
  .guide-step .step-num { width: 38px; height: 38px; font-size: 0.95rem; }

  .gallery-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 20px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 14px; }
  .logo { font-size: 1.1rem; }
  .nav-cta { padding: 6px 14px !important; font-size: 0.82rem; }

  .hero { padding: 48px 16px 40px; }
  .hero h1 { font-size: 1.5rem; }
  .content-section { padding: 32px 16px; }
}
