/* ============================================================
   pch88.com — 蓬城交友中心
   A nostalgic memorial website
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --paper: #f8f3e8;
  --paper-dark: #ede4d3;
  --ink: #3a3226;
  --ink-light: #5c5242;
  --muted: #8b7d6b;
  --rust: #c75b39;
  --rust-dark: #a04028;
  --rust-light: #e8a87c;
  --gold: #b8956a;
  --gold-light: #d4c5a9;
  --cream: #faf6ee;
  --shadow-sm: 0 1px 3px rgba(58,50,38,0.08);
  --shadow-md: 0 4px 20px rgba(58,50,38,0.12);
  --shadow-lg: 0 12px 40px rgba(58,50,38,0.18);
  --radius: 6px;
  --nav-h: 56px;
  --player-h: 48px;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
  overflow-x: hidden;
  padding-bottom: var(--player-h);
  -webkit-font-smoothing: antialiased;
}

/* Aged paper grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2.5vw, 2rem);
  padding: 0 1.5rem;
  background: linear-gradient(to bottom, rgba(248,243,232,0.97), rgba(248,243,232,0.88));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(180,160,130,0.25);
  transition: transform 0.35s, box-shadow 0.35s;
}
.site-nav.hidden { transform: translateY(-100%); }
.site-nav.scrolled { box-shadow: 0 1px 8px rgba(58,50,38,0.08); }

.nav-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  transition: color 0.3s, background 0.3s;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.03em;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%; height: 2px;
  background: var(--rust);
  border-radius: 1px;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover { color: var(--rust); }
.nav-link.active { color: var(--rust); font-weight: 700; }
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }
.nav-home { font-weight: 800; font-size: 1rem; color: var(--ink); letter-spacing: 0.06em; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none; border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: absolute;
  right: 1rem; top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
  border-radius: 1px;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* --- Page Sections (PJAX) --- */
.page-section {
  display: none;
  min-height: calc(100vh - var(--nav-h) - var(--player-h));
  padding-top: var(--nav-h);
}
.page-section.active { display: block; }

.section-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* --- Hero (首页) --- */
.hero-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--nav-h) - var(--player-h));
  position: relative;
  overflow: hidden;
}
.hero-dots {
  position: absolute; inset: 0; z-index: 0;
  opacity: 0.04;
  background:
    radial-gradient(circle at 15% 25%, var(--rust) 1.5px, transparent 1.5px),
    radial-gradient(circle at 75% 60%, var(--rust) 1.5px, transparent 1.5px),
    radial-gradient(circle at 40% 80%, var(--rust) 1.5px, transparent 1.5px);
  background-size: 80px 80px, 100px 100px, 70px 70px;
}
.hero-content { position: relative; z-index: 1; }

.hero-logo {
  width: clamp(180px, 28vw, 260px);
  height: auto;
  margin-bottom: 2rem;
  filter: sepia(0.55) brightness(0.88);
  transition: filter 0.8s, transform 0.8s;
}
.hero-logo:hover { filter: sepia(0.15) brightness(1); transform: scale(1.04); }

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}
.hero-badge {
  display: inline-block;
  background: var(--rust);
  color: #fff;
  padding: 0.35rem 1.8rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin-bottom: 2.2rem;
}
.hero-poem {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 2;
  font-family: var(--font-display);
}
.hero-poem em { font-style: normal; color: var(--rust); font-weight: 600; }

.scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  animation: float 2.4s ease-in-out infinite;
  z-index: 1;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

/* --- Section Headings --- */
.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}
.section-h2-en {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.section-ornament {
  display: block;
  width: 50px; height: 3px;
  background: var(--rust);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

/* --- Stats Bar --- */
.stats-row {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  flex-wrap: wrap;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(232,213,176,0.3), rgba(232,213,176,0.12));
  border-radius: var(--radius);
  margin: 2rem 0;
  border: 1px solid rgba(180,160,130,0.2);
}
.stat-item { text-align: center; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--rust);
  line-height: 1.15;
}
.stat-lbl { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

/* --- Story Text --- */
.story-block { margin: 2rem 0; }
.story-block p {
  text-indent: 2em;
  margin-bottom: 1rem;
  color: var(--ink-light);
  font-size: 0.98rem;
}
.story-block .lead {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  text-indent: 0;
  font-weight: 600;
}

/* --- Founder Post (创始人说) --- */
.founder-post {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  padding: 2.5rem 2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-md);
}
.founder-post::before {
  content: '"';
  position: absolute;
  top: -0.5rem; left: 1.5rem;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 6rem;
  color: var(--rust);
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}
.founder-post-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(180,160,130,0.3);
}
.founder-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rust-light), var(--rust));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.founder-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.founder-meta { font-size: 0.78rem; color: var(--muted); }
.founder-post-body {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 2.1;
  color: var(--ink);
}
.founder-post-body .highlight { color: var(--rust); font-weight: 700; }
.founder-post-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(180,160,130,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.founder-post-footer .tag {
  display: inline-block;
  background: rgba(199,91,57,0.08);
  color: var(--rust);
  padding: 0.15rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.75rem;
}

/* --- Screenshot Frames (时光印记) --- */
.screenshot-frame {
  background: #fffef9;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 2.5rem 0;
  transition: transform 0.35s, box-shadow 0.35s;
  cursor: pointer;
}
.screenshot-frame:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.frame-toolbar {
  background: #e8e0d0;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
}
.frame-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.frame-dot.r { background: #e06c5c; }
.frame-dot.y { background: #e0c85c; }
.frame-dot.g { background: #6cba6c; }
.frame-url {
  margin-left: 0.5rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-body {
  padding: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}
.frame-body img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.06);
}
.frame-img-wrap { position: relative; flex: 1; min-width: 260px; }
.frame-info { flex: 0 0 220px; font-size: 0.85rem; color: var(--muted); }
.frame-info h4 { font-size: 1rem; color: var(--ink); margin-bottom: 0.5rem; font-family: var(--font-display); }
.frame-info ul { list-style: none; padding: 0; }
.frame-info li { margin-bottom: 0.3rem; }
.frame-info li::before { content: '▸ '; color: var(--rust); font-size: 0.7rem; }

.frame-zoom-hint {
  position: absolute;
  top: 0.5rem; right: 0.8rem;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.screenshot-frame:hover .frame-zoom-hint { opacity: 1; }

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(30,25,18,0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
.lightbox-caption {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* --- Timeline (时代回响) --- */
.timeline {
  position: relative;
  padding-left: 2.2rem;
  margin: 2.5rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5rem; bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--rust), var(--gold-light), transparent);
  border-radius: 1px;
}
.tl-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.8rem;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -2.55rem; top: 0.45rem;
  width: 13px; height: 13px;
  background: var(--paper);
  border: 2.5px solid var(--rust);
  border-radius: 50%;
  z-index: 1;
}
.tl-item.highlight::before {
  background: var(--rust);
  box-shadow: 0 0 0 5px rgba(199,91,57,0.15);
}
.tl-year {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--rust);
  margin-bottom: 0.2rem;
}
.tl-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.tl-desc { color: var(--muted); font-size: 0.9rem; }

/* --- Era Comparison Cards --- */
.era-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2.5rem 0;
}
.era-card {
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.era-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(199,91,57,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.era-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--rust);
}
.era-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.6rem; }

/* --- About Grid --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.about-card {
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.about-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.about-card h4 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.5rem; }
.about-card p { font-size: 0.85rem; color: var(--muted); }

/* --- Audio Player --- */
.audio-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2000;
  height: var(--player-h);
  background: rgba(248,243,232,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(180,160,130,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 1.5rem;
  font-size: 0.85rem;
}
.player-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--rust);
  background: transparent;
  color: var(--rust);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.player-btn:hover { background: var(--rust); color: #fff; }
.player-btn.playing { background: var(--rust); color: #fff; }
.player-info { display: flex; flex-direction: column; min-width: 0; }
.player-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist { font-size: 0.72rem; color: var(--muted); }

.player-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  opacity: 0.5;
}
.player-wave.animating .bar { animation: wave 1.2s ease-in-out infinite; }
.player-wave .bar {
  width: 3px;
  background: var(--rust);
  border-radius: 2px;
  transition: height 0.3s;
}
.player-wave .bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.player-wave .bar:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.player-wave .bar:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.player-wave .bar:nth-child(4) { height: 16px; animation-delay: 0.45s; }
.player-wave .bar:nth-child(5) { height: 6px; animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}

.player-volume { display: flex; align-items: center; gap: 0.4rem; }
.player-volume input[type="range"] {
  width: 60px;
  accent-color: var(--rust);
  height: 3px;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--gold-light);
  margin-top: 3rem;
}
.site-footer .nostalgic {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.8rem;
  font-style: italic;
}
.site-footer .wayback-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #333;
  color: #ddd;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  text-decoration: none;
  margin: 0 0.3rem 0.5rem;
  transition: background 0.3s;
}
.site-footer .wayback-link:hover { background: #555; color: #fff; }

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.1s; }
.stagger > *:nth-child(3) { transition-delay: 0.2s; }
.stagger > *:nth-child(4) { transition-delay: 0.3s; }
.stagger > *:nth-child(5) { transition-delay: 0.4s; }
.stagger > *:nth-child(6) { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --nav-h: 48px;
    --player-h: 44px;
  }
  .site-nav {
    justify-content: flex-start;
    gap: 0.3rem;
    padding: 0 0.8rem;
  }
  .nav-link { font-size: 0.78rem; padding: 0.25rem 0.5rem; }
  .nav-toggle { display: block; }

  .site-nav .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(248,243,232,0.98);
    flex-direction: column;
    padding: 1rem;
    gap: 0.3rem;
    border-bottom: 1px solid var(--gold-light);
    box-shadow: var(--shadow-md);
  }
  .site-nav .nav-links.open { display: flex; }

  .era-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 1.5rem; }
  .stat-num { font-size: 2rem; }
  .frame-body { flex-direction: column; }
  .frame-info { flex: none; }
  .founder-post { padding: 1.5rem 1.2rem; }
  .founder-post-body { font-size: 0.95rem; }
  .section-inner { padding: 2rem 1.2rem 3rem; }
  .player-volume { display: none; }
}

@media (max-width: 400px) {
  .hero-tagline { font-size: 1.6rem; }
  .hero-poem { font-size: 0.85rem; }
  .nav-link { font-size: 0.7rem; }
}
