/* ============================================================
   欲望之尾 (Tail of Desire) — Temptation Tail Theme
   Sensual crimsons · tail-swipe blacks · succubus-tail motifs
   Seductive elegance on light blush background
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg: #fdf5f7;
  --bg-card: #ffffff;
  --bg-header: #1a0a0f;
  --bg-footer: #1a0a0f;
  --accent: #c41e3a;
  --accent-hover: #a01830;
  --accent-light: #f8d0d8;
  --accent-dark: #0d0508;
  --accent-glow: #e8506e;
  --text: #2d1a1f;
  --text-light: #8c6b73;
  --text-muted: #b0959e;
  --border: #e8d0d6;
  --border-light: #f2e0e5;
  --shadow: 0 2px 12px rgba(26, 10, 15, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 10, 15, 0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.25s ease;
  --max-width: 1100px;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-heading: 'Noto Serif SC', 'SimSun', 'STSong', Georgia, serif;
}

/* --- 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);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* Body blush radial glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(196, 30, 58, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(232, 80, 110, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(196, 30, 58, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.35; color: var(--accent-dark); }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.65rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout --- */
main { flex: 1; position: relative; z-index: 1; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 3.5rem 0; }
.section-alt { background: var(--border-light); }

/* --- Header --- */
header {
  background: var(--bg-header);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
}
/* Tail-swipe accent line */
header::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0.6;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8d0d8;
  letter-spacing: 0.05em;
}
.logo:hover { color: #fff; }
.logo span { color: var(--accent-glow); }
nav { display: flex; align-items: center; gap: 0.3rem; }
nav a {
  color: #c8a0ac;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  transition: all var(--transition);
}
nav a:hover, nav a.active { color: #fff; background: rgba(196, 30, 58, 0.25); }
.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: #fff !important;
  font-weight: 600;
  margin-left: 0.4rem;
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
}
.nav-cta:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: 0 4px 16px rgba(196, 30, 58, 0.5);
  transform: translateY(-1px);
}
/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #c8a0ac;
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: 0;
  background: var(--bg-header);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.45;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(26, 10, 15, 0.3) 0%,
    rgba(26, 10, 15, 0.6) 50%,
    rgba(26, 10, 15, 0.9) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero h1 {
  font-size: 2.8rem;
  color: #fff;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 20px rgba(196, 30, 58, 0.5);
}
.hero h1 .accent { color: var(--accent-glow); }
.hero .hero-subtitle {
  font-size: 1.15rem;
  color: #d4a0b0;
  margin-bottom: 1.5rem;
  max-width: 650px;
  margin-inline: auto;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  color: #e8c0cc;
  border: 1px solid rgba(255,255,255,0.15);
}
.tag-crimson { background: rgba(196, 30, 58, 0.3); border-color: rgba(196, 30, 58, 0.5); color: #f8d0d8; }
.tag-dark { background: rgba(13, 5, 8, 0.6); border-color: rgba(196, 30, 58, 0.3); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: #fff;
  box-shadow: 0 4px 16px rgba(196, 30, 58, 0.35);
}
.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 24px rgba(196, 30, 58, 0.5);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-outline-dark {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline-dark:hover { background: var(--accent); color: #fff; }
.btn + .btn { margin-left: 0.8rem; }

/* --- Page Hero (sub-pages) --- */
.page-hero {
  background: var(--bg-header);
  padding: 3rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(196, 30, 58, 0.15), transparent 70%);
  pointer-events: none;
}
.page-hero h1 {
  color: #fff;
  position: relative;
  z-index: 1;
}
.page-hero p {
  color: #d4a0b0;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Information Grid --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.info-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
}
.info-card .info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.info-card .info-value {
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 1rem;
}

/* --- Feature Cards --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border-left: 4px solid var(--accent);
}
.feature-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-left-color: var(--accent-glow);
}
.feature-card h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.feature-card .feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

/* --- Story Blocks --- */
.story-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent-dark);
  position: relative;
}
.story-block::before {
  content: '♢';
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 1.2rem;
  color: var(--accent);
  background: var(--bg-card);
  padding: 0 6px;
}
.story-block h3 { color: var(--accent); }
.story-chapter {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

/* --- Character Cards --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.char-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--accent-light);
}
.char-card-header {
  background: linear-gradient(135deg, var(--bg-header), #2d0a15);
  padding: 1rem 1.5rem;
  border-bottom: 3px solid var(--accent);
}
.char-card-header h3 { color: #f8d0d8; margin: 0; }
.char-card-header .char-title { color: #c8a0ac; font-size: 0.85rem; }
.char-card-body { padding: 1.2rem 1.5rem; }
.char-card-body p { font-size: 0.93rem; color: var(--text-light); }
.char-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.char-tags .tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* --- Guide Steps --- */
.guide-steps { counter-reset: step; }
.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.5rem 3.5rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  counter-increment: step;
  transition: all var(--transition);
}
.guide-step:hover { border-color: var(--accent-light); }
.guide-step::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.3rem;
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-step h3 { color: var(--accent); }

/* --- 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);
  margin-bottom: 0.8rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-q {
  padding: 1rem 2.5rem 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  color: var(--accent-dark);
  transition: color var(--transition);
  font-family: var(--font-heading);
  font-size: 1rem;
}
.faq-q:hover { color: var(--accent); }
.faq-q::after {
  content: '+';
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform var(--transition);
  font-weight: 300;
}
.faq-item.open .faq-q { color: var(--accent); }
.faq-item.open .faq-q::after {
  content: '×';
  transform: translateY(-50%) rotate(90deg);
}
.faq-a {
  padding: 0 1.2rem 1rem;
  color: var(--text-light);
  font-size: 0.93rem;
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.gallery-item:hover {
  border-color: var(--accent-glow);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.gallery-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-header), #2d0a15);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  border: 1px solid rgba(196, 30, 58, 0.2);
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(196, 30, 58, 0.15), transparent 70%);
}
.cta-banner h2 {
  color: #fff;
  position: relative;
  z-index: 1;
}
.cta-banner p {
  color: #d4a0b0;
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}
.cta-banner .btn {
  position: relative;
  z-index: 1;
}

/* --- Tail-Swipe Divider --- */
.tail-divider {
  height: 3px;
  background: linear-gradient(90deg,
    transparent,
    var(--accent-dark) 20%,
    var(--accent) 50%,
    var(--accent-dark) 80%,
    transparent);
  margin: 1rem 0;
  position: relative;
}
.tail-divider::after {
  content: '♢';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--accent);
  padding: 0 10px;
  font-size: 0.9rem;
}

/* --- Stats Row --- */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0;
}
.stat-item { text-align: center; }
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-heading);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Section Title --- */
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 { color: var(--accent-dark); }
.section-title p { color: var(--text-light); }

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 0.8rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs span { color: var(--text-muted); }

/* --- Rating Badge --- */
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--accent-light);
  border-radius: 20px;
  font-weight: 600;
  color: var(--accent);
}
.rating-stars { color: #e8506e; }

/* --- Tip Box --- */
.tip-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  border-left: 4px solid var(--accent);
  margin-bottom: 1.2rem;
}
.tip-box h4 { color: var(--accent); margin-bottom: 0.4rem; }

/* --- Blockquote --- */
blockquote {
  background: var(--border-light);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* --- Footer --- */
footer {
  background: var(--bg-footer);
  color: #8c6b73;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  z-index: 1;
  border-top: 2px solid var(--accent);
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 5, 8, 0.95);
  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); cursor: default; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

/* --- Endings Grid --- */
.ending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.ending-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.ending-card:hover { border-color: var(--accent-light); }
.ending-card .ending-type {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.ending-type.good { background: #d4edda; color: #155724; }
.ending-type.true { background: var(--accent-light); color: var(--accent); }

/* --- Download Card --- */
.download-card {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.download-card .version {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.download-card .features-list {
  text-align: left;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
}
.download-card .features-list li {
  padding: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.download-card .features-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.4rem;
}

/* --- Info Table --- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.info-table th, .info-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.93rem;
}
.info-table th {
  background: var(--border-light);
  color: var(--accent);
  font-weight: 600;
  width: 30%;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }

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

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2rem; }
  .hero-content { padding: 3.5rem 1rem 2.5rem; }
  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-header);
    padding: 1rem;
    gap: 0.4rem;
    border-bottom: 3px solid var(--accent);
  }
  nav.open a {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
  }
  .menu-toggle { display: flex; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .char-grid { grid-template-columns: 1fr; }
  section { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .stats-row { gap: 1.2rem; }
}
