/* ============================================================
   卡琳的监狱 - Prison Management Theme
   Design: Cell-block grays + guard-uniform blues
   Prison-bar vertical motifs on light institutional bg
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --font-sans: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-serif: 'Noto Serif SC', 'SimSun', 'STSong', serif;

  /* Institutional light bg */
  --bg: #f4f2ee;
  --bg-card: #ffffff;
  --bg-hero: #e8e4db;

  /* Guard-uniform blues */
  --blue-dark: #1a2a3a;
  --blue-mid: #2c4053;
  --blue-accent: #3d5a80;
  --blue-light: #5c7fa3;

  /* Cell-block grays */
  --gray-cell: #6b6b6b;
  --gray-bar: #4a4a4a;
  --gray-light: #8a8a8a;

  /* Text */
  --text: #2a2a2a;
  --text-soft: #5a5a5a;
  --text-muted: #8a8a8a;
  --text-inverse: #f0ede8;

  /* Accent */
  --accent: #c0392b;
  --accent-hover: #a93226;
  --warning: #d4a017;
  --success: #2e7d32;

  /* Borders & shadows */
  --border: #d5d0c8;
  --border-light: #e8e4db;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

  /* Spacing */
  --max-width: 1100px;
  --header-height: 64px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  padding-top: var(--header-height);
  /* Subtle vertical prison-bar motif on body bg */
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 38px,
      rgba(74,74,74,0.03) 38px,
      rgba(74,74,74,0.03) 40px
    );
}

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

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

/* --- Utility: Screen Reader Only --- */
.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;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; margin: 32px 0 12px; color: var(--blue-dark); }
h3 { font-size: 1.5rem; margin: 24px 0 8px; }
h4 { font-size: 1.2rem; margin: 16px 0 6px; }
p { margin-bottom: 14px; }

/* --- Anti-inline utility classes --- */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--blue-mid);
  font-weight: 600;
  margin: 20px 0 6px;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}
.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 600px;
  line-height: 1.7;
}
.guide-intro {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 18px;
  line-height: 1.8;
}
.route-desc {
  font-size: 0.98rem;
  color: var(--text-soft);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--blue-accent);
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--blue-mid);
  margin: 22px 0 6px;
  padding-left: 12px;
  border-left: 3px solid var(--gray-cell);
}
.content-list {
  list-style: disc;
  padding-left: 24px;
  margin: 10px 0 16px;
}
.content-list-num {
  list-style: decimal;
  padding-left: 24px;
  margin: 10px 0 16px;
}
.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
}
.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
}
.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
}
.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
}
.strong-red {
  color: var(--accent);
}
.strong-gold {
  color: var(--warning);
}
.strong-muted {
  color: var(--gray-cell);
}
.strong-navy {
  color: var(--blue-mid);
}
.td-highlight {
  color: var(--accent);
  font-weight: 700;
}
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--blue-mid);
  margin: 24px 0 10px;
}
.sys-reqs-h3:first-of-type {
  margin-top: 0;
}
.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--blue-dark);
}

/* --- Sub-page hero overrides --- */
.hero-subpage {
  padding: 40px 24px 48px !important;
}
.hero-subpage-title {
  font-size: 2rem !important;
  font-weight: 700 !important;
}

/* Content section h2 styled as H1 for sub-pages */
.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--blue-dark);
  border-bottom: 3px solid var(--gray-cell);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-inverse);
  white-space: nowrap;
}
.header-logo:hover {
  color: #c0b8a8;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-nav a {
  color: #b0a898;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--text-inverse);
}

/* Header CTA button */
.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 3px;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.btn-cta:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-inverse);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--bg-hero) 0%, #ddd8cb 50%, #d5cfc0 100%);
  padding: 50px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Prison-bar motif in hero */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(74,74,74,0.06) 18px,
      rgba(74,74,74,0.06) 20px
    );
  pointer-events: none;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero-image {
  max-width: 700px;
  margin: 0 auto 24px;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 8px;
  color: var(--blue-dark);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 4px;
}

/* --- Game Info Cards --- */
.game-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}
.info-card {
  background: var(--bg-card);
  border-left: 3px solid var(--gray-cell);
  padding: 14px 18px;
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.info-card .info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-card .info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}

/* --- Section --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}
.section-alt {
  background: #ebe7dd;
}

/* --- Feature Cards --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.feature-card {
  background: var(--bg-card);
  border-left: 3px solid var(--blue-accent);
  padding: 22px 20px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.feature-card h3 {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--blue-dark);
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0;
}

/* --- Screenshot Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.gallery-grid a {
  display: block;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  cursor: pointer;
}
.gallery-grid a:hover {
  transform: scale(1.02);
}
.gallery-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

/* --- CTA Banner (index only) --- */
.cta-banner {
  background: var(--blue-dark);
  padding: 40px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 14px,
      rgba(255,255,255,0.04) 14px,
      rgba(255,255,255,0.04) 16px
    );
  pointer-events: none;
}
.cta-banner > * {
  position: relative;
  z-index: 1;
}
.cta-banner h2 {
  color: var(--text-inverse);
  font-size: 1.8rem;
  margin: 0 0 12px;
}
.cta-banner p {
  color: #b0a898;
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.btn-cta-large {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 12px 36px;
  border-radius: 3px;
  transition: background 0.2s;
}
.btn-cta-large:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

/* --- Reviews --- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.review-card {
  background: var(--bg-card);
  padding: 20px 22px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--warning);
}
.review-card .review-text {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.7;
}
.review-card .review-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Guide Page --- */
.guide-step {
  background: var(--bg-card);
  border-left: 3px solid var(--blue-accent);
  padding: 20px 22px;
  margin-bottom: 18px;
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.guide-step h3 {
  margin-top: 0;
  color: var(--blue-dark);
}
.tip-box {
  background: #faf6e8;
  border-left: 3px solid var(--warning);
  padding: 14px 18px;
  margin: 14px 0;
  border-radius: 3px;
  font-size: 0.92rem;
  color: var(--text-soft);
}
.tip-box strong {
  color: var(--warning);
}

/* --- Story Page --- */
.story-block {
  background: var(--bg-card);
  padding: 22px 24px;
  margin-bottom: 20px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--gray-cell);
}

/* --- Characters Page --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.char-card {
  background: var(--bg-card);
  border-radius: 3px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 3px solid var(--blue-mid);
}
.char-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-hero);
}
.char-card-body {
  padding: 18px 20px;
}
.char-card-body h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: var(--blue-dark);
}
.char-card-body .char-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.char-card-body p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0;
}
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.char-tag {
  background: #e8e4db;
  color: var(--text-soft);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 2px;
  border-left: 2px solid var(--gray-cell);
}

/* --- FAQ Page --- */
.faq-item {
  background: var(--bg-card);
  border-left: 3px solid var(--blue-accent);
  margin-bottom: 10px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-question {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--blue-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-question:hover {
  background: #faf8f5;
}
.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gray-light);
  font-weight: 400;
  transition: transform 0.2s;
}
.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(0deg);
}
.faq-answer {
  padding: 0 20px 16px;
  font-size: 0.94rem;
  color: var(--text-soft);
  line-height: 1.8;
  display: none;
}
.faq-item.active .faq-answer {
  display: block;
}

/* System Requirements Table */
.sys-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.92rem;
}
.sys-table th,
.sys-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.sys-table th {
  background: var(--blue-dark);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 0.88rem;
}
.sys-table tr:nth-child(even) {
  background: #faf8f5;
}

/* --- Footer --- */
.site-footer {
  background: var(--blue-dark);
  padding: 20px 24px;
  text-align: center;
  border-top: 3px solid var(--gray-cell);
}
.site-footer p {
  color: #8a8a8a;
  font-size: 0.85rem;
  margin: 0;
}

/* --- Lightbox --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 3px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .hero h1 { font-size: 2.2rem; }
  .hero-subpage-title { font-size: 1.6rem !important; }

  .nav-toggle {
    display: block;
  }
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--blue-dark);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 12px;
    border-bottom: 3px solid var(--gray-cell);
    z-index: 999;
  }
  .header-nav.open {
    display: flex;
  }

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

  .section {
    padding: 36px 16px;
  }

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

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-subpage-title { font-size: 1.4rem !important; }

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