/* ============================================================
   能干的后辈葵酱 — Aoi-chan the Capable Junior
   Theme: Office Romance / Sakura-Pink & Warm Beige
   Light warm office background with Japanese paper-texture motif
   ============================================================ */

/* --- CSS Variables --- */
:root {
  /* Core palette */
  --bg: #fdf8f5;
  --bg-card: #ffffff;
  --bg-header: #4a3728;
  --bg-footer: #3a2a1c;
  --accent: #e88d9b;
  --accent-dark: #d06b7d;
  --accent-light: #f9d5da;
  --gold: #8b6914;
  --gold-light: #c49b3f;
  --text: #3a3028;
  --text-soft: #6b5d52;
  --text-muted: #9b8d82;
  --text-light: #f5ede3;
  --border: #e8ddd2;
  --border-accent: #f0c4cc;
  --shadow: rgba(139, 105, 20, 0.08);
  --shadow-md: rgba(139, 105, 20, 0.15);
  --radius: 10px;
  --radius-sm: 6px;

  /* Typography */
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-serif: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
  --font-display: "Noto Serif SC", "STSong", serif;

  /* Layout */
  --max-width: 1120px;
  --header-h: 68px;
}

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

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

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;
  /* Subtle paper texture pattern via pseudo-element */
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(200, 180, 160, 0.03) 2px, rgba(200, 180, 160, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(200, 180, 160, 0.02) 2px, rgba(200, 180, 160, 0.02) 4px);
  pointer-events: none;
}

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

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

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

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

.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;
  text-decoration: none;
}

.header-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.header-logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}

.header-logo:hover .header-logo-text {
  color: var(--accent-light);
}

/* --- Nav --- */
.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: #cbbfb0;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

.nav-links a.active {
  background: rgba(232, 141, 155, 0.25);
  color: var(--accent-light);
}

/* --- Header CTA --- */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(232, 141, 155, 0.35);
}

.header-cta:hover {
  background: linear-gradient(135deg, var(--accent-dark), #c05a6b);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232, 141, 155, 0.5);
  color: #ffffff;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #d4c8b8;
  border-radius: 1px;
  transition: all 0.2s;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(175deg, #fdf1f3 0%, #fdf8f5 40%, #faf3eb 100%);
  text-align: center;
  padding: 64px 24px 72px;
  position: relative;
  overflow: hidden;
}

/* Sakura petal decoration */
.hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -20px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(232, 141, 155, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 10%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(139, 105, 20, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-subpage {
  padding: 40px 24px 48px;
}

.hero-title-main {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.hero-subpage .hero-tagline,
.hero-subpage-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero-image {
  max-width: 700px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow-md);
}

.hero-image img {
  width: 100%;
  height: auto;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* --- Section headings --- */
.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Decorative divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 36px;
}

.divider::before,
.divider::after {
  content: "";
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.divider::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.divider-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

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

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

.info-card:hover {
  transform: translateY(-2px);
}

.info-card-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.info-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

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

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

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-light);
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.25s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-md);
}

.feature-number {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
}

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

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.25s;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

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

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 6px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

/* --- Review / Quotes --- */
.reviews-section {
  margin-bottom: 48px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

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

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

.review-text {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
  padding-top: 12px;
  margin-bottom: 12px;
  line-height: 1.7;
}

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

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, #fdf1f3, #fdf8f5);
  border: 2px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 16px;
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.cta-banner p {
  color: var(--text-soft);
  margin-bottom: 20px;
  font-size: 1rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  border-radius: 28px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(232, 141, 155, 0.4);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 141, 155, 0.55);
  color: #ffffff;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-footer);
  text-align: center;
  padding: 24px;
  color: #a89885;
  font-size: 0.9rem;
}

/* --- Content Sections (for sub-pages) --- */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

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

.content-section h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

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

/* --- Guide styles --- */
.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 1.85;
}

.route-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 12px;
  line-height: 1.8;
}

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

/* Chapter sub-headings in story page */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-accent);
}

/* --- Tips Box --- */
.tips-box {
  background: linear-gradient(135deg, #fff9f5, #fef5f1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0 24px;
}

.tips-box h4 {
  font-family: var(--font-serif);
  color: var(--gold);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.tips-box p {
  margin-bottom: 8px;
}

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

.char-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.25s;
}

.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-md);
}

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

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

.char-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.char-name-jp {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.char-trait {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 500;
}

.char-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 12px;
}

.char-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 0.88rem;
}

.char-stat-label {
  color: var(--text-muted);
}

.char-stat-value {
  color: var(--text);
  font-weight: 500;
}

/* --- Character relationship --- */
.char-relations {
  margin: 40px 0;
}

.relation-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-light);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px var(--shadow);
}

.relation-card h4 {
  font-family: var(--font-display);
  margin-bottom: 6px;
}

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

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

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

.faq-q {
  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);
  text-align: left;
  transition: background 0.2s;
}

.faq-q:hover {
  background: #fdf6f2;
}

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

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

.faq-a {
  display: none;
  padding: 0 24px 20px;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.8;
}

.faq-item.open .faq-a {
  display: block;
}

/* --- System Requirements Table --- */
.table-scroll {
  overflow-x: auto;
  margin: 16px 0 32px;
}

.sys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.sys-table th {
  background: #faf3eb;
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-serif);
}

.sys-table td {
  color: var(--text-soft);
}

.sys-table tr:last-child td {
  border-bottom: none;
}

.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin: 28px 0 12px;
}

/* --- Content Lists (for guide/story/faq) --- */
.content-list {
  list-style: disc;
  padding-left: 24px;
  margin: 8px 0 20px;
}

.content-list-num {
  list-style: decimal;
  padding-left: 24px;
  margin: 8px 0 20px;
}

.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
  line-height: 1.8;
}

.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
  line-height: 1.8;
}

.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
  line-height: 1.8;
}

.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
  line-height: 1.8;
}

/* --- Colored strong tags --- */
.strong-pink { color: var(--accent-dark); }
.strong-red { color: #c0392b; }
.strong-gold { color: var(--gold); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: #2c3e50; }

/* --- Highlighted table cell --- */
.td-highlight {
  color: var(--accent-dark);
  font-weight: 700;
}

/* --- Story page specials --- */
.story-intro {
  font-size: 1.1rem;
  color: var(--text-soft);
  font-style: italic;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fff9f5, #fef5f1);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 28px;
  line-height: 1.85;
}

.ending-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-right: 8px;
}

.ending-good {
  background: #e8f5e9;
  color: #2e7d32;
}

.ending-normal {
  background: #fff3e0;
  color: #e65100;
}

.ending-bad {
  background: #fce4ec;
  color: #c62828;
}

/* --- Numbered Steps --- */
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 56px;
  margin-bottom: 28px;
  min-height: 40px;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  border-radius: 50%;
  text-align: center;
  line-height: 38px;
  font-weight: 700;
  font-size: 1rem;
}

.step-list h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}

.step-list p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-title-main {
    font-size: 2rem;
  }

  .hero-subpage-title {
    font-size: 1.6rem;
  }

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

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

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

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

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

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

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

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

  .hero-subpage-title {
    font-size: 1.4rem;
  }

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

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

  .game-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-cta {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

  .header-logo-text {
    display: none;
  }
}
