@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* ===== 基础变量 ===== */
:root {
  --cream: #f5e6c8;
  --gold: #d4a574;
  --ink: #262117;
  --ink-80: rgba(38,33,23,0.8);
  --ink-40: rgba(38,33,23,0.4);
  --cream-80: rgba(245,230,200,0.85);
  --gold-dark: #b8864e;
  --gold-light: #e8c99a;
  --shadow: 0 4px 24px rgba(38,33,23,0.18);
  --radius: 28px;
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt: 'VT323', monospace;
  --font-body: 'VT323', Georgia, 'Times New Roman', serif;
  --nav-h: 64px;
  --anchor-h: 42px;
  --transition: 0.3s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 18px;
  background: var(--cream);
  color: var(--ink);
}
body {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  background: var(--cream);
  overflow-x: hidden;
  position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ink); }
ul { list-style: none; }
h1, h2, h3, h4, h5 { font-family: var(--font-pixel); line-height: 1.3; }

/* ===== Film Grain Overlay ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
  animation: grain-shift 0.15s steps(1) infinite;
}
@keyframes grain-shift {
  0%   { background-position: 0 0; }
  25%  { background-position: -60px 30px; }
  50%  { background-position: 40px -20px; }
  75%  { background-position: -20px 60px; }
  100% { background-position: 30px -40px; }
}

/* ===== Light Leak ===== */
.light-leak {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background:
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(212,165,116,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 5% 85%, rgba(245,230,200,0.18) 0%, transparent 60%);
  animation: light-pulse 6s ease-in-out infinite alternate;
}
@keyframes light-pulse {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ===== 顶部导航 aside > nav > ul > li > a ===== */
.site-aside {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);
  background: rgba(38,33,23,0.96);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
  box-shadow: 0 2px 16px rgba(38,33,23,0.4);
}
.site-aside::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.aside-brand .brand-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-text {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.site-logo { height: 36px; width: auto; }

.main-nav { flex: 1; overflow: hidden; }
.main-nav ul {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.main-nav ul li a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 0.9rem;
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--cream);
  border: 1px solid rgba(212,165,116,0.3);
  border-radius: 999px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  letter-spacing: 0.03em;
}
.main-nav ul li a:hover,
.main-nav ul li a:focus-visible {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 1.2rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  border-radius: 999px;
  border: 2px solid var(--gold-dark);
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.cta-btn:hover { background: var(--gold-light); transform: scale(1.04); color: var(--ink); }

/* ===== 粘性锚点条 ===== */
.sticky-anchor-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 850;
  height: var(--anchor-h);
  background: rgba(245,230,200,0.97);
  border-bottom: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(38,33,23,0.1);
}
.sticky-anchor-bar ul {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  overflow-x: auto;
  padding: 0 1rem;
  scrollbar-width: none;
}
.sticky-anchor-bar ul::-webkit-scrollbar { display: none; }
.sticky-anchor-bar ul li a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 0.75rem;
  font-family: var(--font-vt);
  font-size: 1rem;
  color: var(--ink-80);
  border-radius: 999px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.sticky-anchor-bar ul li a:hover,
.sticky-anchor-bar ul li a:focus-visible {
  background: var(--gold);
  color: var(--ink);
}

/* ===== section 锚点偏移 ===== */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--anchor-h) + 16px);
}

/* ===== main ===== */
main {
  padding-top: calc(var(--nav-h) + var(--anchor-h));
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Hero section > article ===== */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 4rem;
}
.hero-article {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 4rem 0 3rem;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(212,165,116,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,165,116,0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 0% 50%, rgba(245,230,200,0.6) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}
.hero-eyebrow {
  margin-bottom: 1.2rem;
}
.hero-eyebrow small {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--gold-dark);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  padding: 0.2em 0.8em;
  border-radius: 4px;
}
h1.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.5vw, 2rem);
  color: var(--ink);
  margin-bottom: 1.2rem;
  line-height: 1.4;
  word-break: break-word;
}
.hero-desc {
  font-family: var(--font-vt);
  font-size: 1.3rem;
  color: var(--ink-80);
  max-width: 560px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 1.8rem;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  transition: background var(--transition), color var(--transition), transform var(--transition);
  letter-spacing: 0.05em;
}
.btn-primary:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); transform: translateY(-2px); }

/* ===== 内容区主 + 侧 ===== */
.content-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
  margin-bottom: 5rem;
}
.content-article {
  min-width: 0;
}
.page-content {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink);
}

/* page.content 内部样式 */
.page-content h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.75rem, 2vw, 1.1rem);
  color: var(--ink);
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold);
}
.page-content h3 {
  font-family: var(--font-pixel);
  font-size: clamp(0.65rem, 1.5vw, 0.9rem);
  color: var(--gold-dark);
  margin: 2rem 0 0.75rem;
}
.page-content p {
  margin-bottom: 1.1rem;
  font-size: 1.15rem;
  line-height: 1.8;
}
.page-content ul, .page-content ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
  list-style: disc;
}
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 0.5rem; font-size: 1.1rem; line-height: 1.7; }
.page-content strong { color: var(--ink); font-weight: 700; }
.page-content em { color: var(--gold-dark); font-style: normal; }
.page-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: rgba(212,165,116,0.08);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.1rem;
  color: var(--ink-80);
}
.page-content section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(255,255,255,0.45);
  border-radius: var(--radius);
  border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.page-content section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  opacity: 0.6;
}
.page-content section:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(38,33,23,0.15);
}

/* ===== 侧边栏 ===== */
.content-aside {
  position: sticky;
  top: calc(var(--nav-h) + var(--anchor-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.aside-card {
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius);
  border-bottom: 3px solid var(--gold);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.aside-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}
.aside-card small {
  display: block;
  font-family: var(--font-vt);
  font-size: 1rem;
  color: var(--gold-dark);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.aside-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.5;
  word-break: break-word;
}
.aside-card p {
  font-family: var(--font-vt);
  font-size: 1.05rem;
  color: var(--ink-80);
  line-height: 1.6;
}
.aside-nav-list { display: flex; flex-direction: column; gap: 0.4rem; }
.aside-nav-list li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.8rem;
  font-family: var(--font-vt);
  font-size: 1.05rem;
  color: var(--ink-80);
  border-radius: 8px;
  width: 100%;
  transition: background var(--transition), color var(--transition);
}
.aside-nav-list li a:hover {
  background: var(--gold);
  color: var(--ink);
}

/* ===== 页脚 ===== */
footer {
  background: var(--ink);
  color: var(--cream);
  border-top: 2px solid var(--gold);
  position: relative;
  overflow: hidden;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
}
.footer-brand-col .footer-logo-link { display: inline-block; margin-bottom: 1rem; }
.footer-brand-col .logo-text { color: var(--gold); font-size: 0.55rem; }
.footer-desc {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: rgba(245,230,200,0.7);
  line-height: 1.7;
}
.footer-nav-col nav ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-nav-col nav ul li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: rgba(245,230,200,0.75);
  padding: 0 0.3rem;
  transition: color var(--transition);
}
.footer-nav-col nav ul li a:hover { color: var(--gold); }
.footer-contact-col h4 {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.footer-contact-col p {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: rgba(245,230,200,0.7);
  margin-bottom: 0.5rem;
}
.footer-contact-col a { color: var(--gold-light); }
.footer-contact-col a:hover { color: var(--cream); }
.icp {
  font-size: 0.95rem;
  color: rgba(245,230,200,0.5);
}

.footer-bottom {
  border-top: 1px solid rgba(212,165,116,0.25);
  padding: 1.2rem 1.5rem;
}
.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-bottom-inner nav a {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--gold);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.footer-copyright {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-vt);
  font-size: 1rem;
  color: rgba(245,230,200,0.5);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.icp-num { opacity: 0.6; }

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===== small 眉题 (h2/h3 前) ===== */
small + h2, small + h3 {
  margin-top: 0.3rem;
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
  }
  .content-aside {
    position: static;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .site-aside {
    padding: 0 1rem;
  }
  .main-nav { display: none; }
  .cta-btn { font-size: 0.45rem; padding: 0 0.8rem; }

  .sticky-anchor-bar ul {
    justify-content: flex-start;
    padding: 0 0.5rem;
  }
  .sticky-anchor-bar ul li a {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }

  h1.hero-title { font-size: clamp(0.8rem, 5vw, 1.2rem); }
  .hero-article { padding: 3rem 0 2rem; }
  .hero-section { min-height: 60vh; }

  .footer-top {
    grid-template-columns: 1fr;
  }
  .footer-brand-col { grid-column: auto; }

  .footer-bottom-inner { flex-direction: column; gap: 0.8rem; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 1rem; }
  .page-content section { padding: 1.2rem; border-radius: 16px; }
  .aside-card { border-radius: 16px; }
  .btn-primary { height: 44px; font-size: 0.5rem; padding: 0 1.2rem; }
}
