/* ============================================================
   水管工传说 — Plumber Comedy Theme
   Wrench-metal silvers, pipe-copper oranges, water-drop blues
   Light tile background with subtle plumbing patterns
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Tile background palette */
  --bg:            #F5F2ED;
  --bg-card:       #FCF9F5;
  --bg-tile:       #EDEAE5;
  --bg-tile-light: #F2F0EB;

  /* Pipe copper/orange */
  --copper:        #D4784C;
  --copper-light:  #E8925E;
  --copper-dark:   #B85F32;
  --copper-pale:   #F5E1D5;

  /* Wrench silver/metallic */
  --silver:        #8A98A8;
  --silver-light:  #B8C4D0;
  --silver-dark:   #5A6A7A;
  --silver-pale:   #E8EDF2;

  /* Water-drop blue */
  --water:         #4A90D9;
  --water-light:   #6BB5F0;
  --water-dark:    #2E6EB5;
  --water-pale:    #DCEAF8;

  /* Text tones */
  --text-dark:     #2C3038;
  --text-mid:      #5A5F68;
  --text-light:    #8A8F98;

  /* UI */
  --white:         #FFFFFF;
  --shadow-sm:     0 2px 8px rgba(44,48,56,0.06);
  --shadow-md:     0 4px 16px rgba(44,48,56,0.10);
  --shadow-lg:     0 8px 32px rgba(44,48,56,0.14);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --font-heading:  'Noto Serif SC', 'SimSun', 'STSong', 'Songti SC', serif;
  --font-body:     'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --max-width:     1100px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* Subtle tile body pattern — crosshatch grout lines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 48px,
      rgba(138,152,168,0.04) 48px,
      rgba(138,152,168,0.04) 50px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(138,152,168,0.03) 48px,
      rgba(138,152,168,0.03) 50px
    );
}

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

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

ul, ol { padding-left: 1.5em; }

/* ---------- 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;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2C3038;
  border-bottom: 3px solid var(--copper);
  box-shadow: 0 2px 12px rgba(44,48,56,0.3);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '🔧';
  font-size: 1.1rem;
}

.logo:hover { color: var(--copper-light); }

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

nav a {
  color: var(--silver-light);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.btn-download {
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  color: var(--white) !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  margin-left: 8px;
  transition: all 0.25s !important;
  position: relative;
  overflow: hidden;
}

.btn-download::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%
  );
  transition: left 0.4s;
}

.btn-download:hover {
  background: linear-gradient(135deg, var(--copper-light), var(--copper));
  box-shadow: 0 4px 16px rgba(212,120,76,0.4);
  transform: translateY(-1px);
}

.btn-download:hover::after { left: 100%; }

/* ---------- Mobile Nav ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--silver-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* ---------- Main ---------- */
main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  margin: 0 -20px;
  overflow: hidden;
  background: linear-gradient(135deg, #2C3038 0%, #3A4048 50%, #2E3A48 100%);
}

.hero-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity 0.6s;
}

.hero:hover .hero-img { opacity: 0.85; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(44,48,56,0.3) 0%,
    rgba(44,48,56,0.5) 50%,
    rgba(44,48,56,0.85) 100%
  );
}

/* Pipe overlay decoration */
.hero-overlay::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--copper) 0%,
    var(--copper-light) 40%,
    var(--water) 60%,
    var(--water-light) 100%
  );
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 40px 40px;
  text-align: center;
  z-index: 2;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--silver-light);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
  line-height: 1.6;
}

/* ---------- Sections ---------- */
section {
  margin: 48px 0;
}

section:first-of-type { margin-top: 24px; }

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
  padding-bottom: 10px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--water));
  border-radius: 2px;
}

/* ---------- Info Cards ---------- */
.info-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-tile);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--water));
}

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

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

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

.card-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* ---------- About Text ---------- */
.about-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-mid);
  max-width: 800px;
}

/* ---------- Feature Cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--copper);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:nth-child(2n) { border-left-color: var(--water); }
.feature-card:nth-child(3n) { border-left-color: var(--silver); }

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

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

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ---------- Screenshot Gallery ---------- */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.screenshot-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}

.screenshot-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.screenshot-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s;
}

.screenshot-item:hover img { transform: scale(1.05); }

/* ---------- Reviews ---------- */
.review-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-tile);
  position: relative;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--copper-pale);
  line-height: 1;
}

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

.review-author {
  font-size: 0.85rem;
  color: var(--copper);
  font-weight: 600;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, #2C3038, #3A4048);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(74,144,217,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(212,120,76,0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Pipe dribble border top */
.cta-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--copper), var(--water), transparent);
  border-radius: 0 0 3px 3px;
}

.cta-banner h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.cta-banner p {
  color: var(--silver-light);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.btn-cta-large {
  display: inline-block;
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  color: var(--white);
  padding: 14px 48px;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  z-index: 1;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(212,120,76,0.3);
}

.btn-cta-large:hover {
  background: linear-gradient(135deg, var(--copper-light), var(--copper));
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212,120,76,0.45);
  color: var(--white);
}

/* ---------- Guide Page ---------- */
.guide-steps { counter-reset: step; }

.guide-step {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--copper);
  position: relative;
  counter-increment: step;
}

.guide-step:nth-child(odd) { border-left-color: var(--copper); }
.guide-step:nth-child(even) { border-left-color: var(--water); }

.guide-step h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.guide-step h3::before {
  content: "第" counter(step) "步";
  display: inline-block;
  font-size: 0.75rem;
  background: var(--copper);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 10px;
  margin-right: 10px;
  vertical-align: middle;
  font-family: var(--font-body);
  font-weight: 500;
}

.guide-step p {
  color: var(--text-mid);
  line-height: 1.8;
}

.tip-box {
  background: var(--water-pale);
  border-left: 4px solid var(--water);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}

.tip-box strong {
  color: var(--water-dark);
}

.tip-box.warning {
  background: var(--copper-pale);
  border-left-color: var(--copper);
}

.tip-box.warning strong { color: var(--copper-dark); }

/* ---------- Story Page ---------- */
.story-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-tile);
}

.story-block h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.story-block p {
  color: var(--text-mid);
  line-height: 1.9;
  margin-bottom: 12px;
}

.chapter-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--copper-dark);
  margin-top: 16px;
  margin-bottom: 6px;
}

/* ---------- Character Page ---------- */
.character-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.character-card {
  display: flex;
  gap: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-tile);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.char-img-wrap {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--copper);
}

.char-img-wrap:nth-child(1) { border-color: var(--copper); }

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

.char-info {
  flex: 1;
}

.char-info h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.char-role {
  display: inline-block;
  font-size: 0.8rem;
  background: var(--water-pale);
  color: var(--water-dark);
  padding: 2px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 500;
}

.char-desc {
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 12px;
}

.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.char-trait {
  font-size: 0.8rem;
  background: var(--silver-pale);
  color: var(--silver-dark);
  padding: 4px 12px;
  border-radius: 10px;
  font-weight: 500;
}

/* ---------- FAQ Page ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-tile);
  overflow: hidden;
}

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

.faq-question:hover { background: var(--bg-tile-light); }

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--copper);
  font-weight: 300;
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(0deg);
}

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

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

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--text-mid);
  line-height: 1.9;
}

/* ---------- System Requirements Table ---------- */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.specs-table thead {
  background: linear-gradient(135deg, #2C3038, #3A4048);
  color: var(--white);
}

.specs-table th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

.specs-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--bg-tile);
  color: var(--text-mid);
}

.specs-table tbody tr {
  background: var(--bg-card);
  transition: background 0.2s;
}

.specs-table tbody tr:hover { background: var(--bg-tile-light); }

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

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

/* ---------- Footer ---------- */
footer {
  background: #2C3038;
  border-top: 3px solid var(--copper);
  padding: 24px 20px;
  text-align: center;
}

footer p {
  color: var(--silver-light);
  font-size: 0.85rem;
}

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

  .header-inner {
    padding: 0 12px;
  }

  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #2C3038;
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 4px;
    display: none;
    z-index: 99;
  }

  nav.open { display: flex; }

  nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }

  .btn-download { margin-left: 0; }

  .nav-toggle { display: block; }

  .hero-content { padding: 40px 20px 24px; }

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

  .subtitle { font-size: 0.95rem; }

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

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

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

  .review-cards { grid-template-columns: 1fr; }

  .character-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .char-img-wrap { width: 140px; height: 140px; }

  .char-traits { justify-content: center; }

  section { margin: 32px 0; }

  .cta-banner { padding: 32px 24px; }

  .cta-banner h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .info-cards { grid-template-columns: 1fr; }

  .screenshot-grid { grid-template-columns: 1fr; }

  .hero-content h1 { font-size: 1.5rem; }

  main { padding: 0 12px 40px; }
}
