@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

/* ─── 基础变量 ─── */
:root {
  --c-bg: #0d0d0d;
  --c-purple: #8000ff;
  --c-pink: #ff00ff;
  --c-purple-dim: #5500aa;
  --c-pink-dim: #aa0077;
  --c-fg: #e0d0ff;
  --c-fg-muted: #9980cc;
  --c-border: rgba(128, 0, 255, 0.4);
  --c-border-bright: rgba(255, 0, 255, 0.6);
  --c-card-bg: rgba(20, 0, 40, 0.85);
  --c-nav-bg: #080010;
  --sidenav-w: 220px;
  --font-deco: 'Poiret One', 'Didact Gothic', 'Trebuchet MS', sans-serif;
  --font-body: 'Didact Gothic', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --radius: 18px;
  --glow-purple: 0 0 8px #8000ff, 0 0 20px rgba(128,0,255,0.5);
  --glow-pink: 0 0 8px #ff00ff, 0 0 20px rgba(255,0,255,0.5);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  background: var(--c-bg);
  color: var(--c-fg);
  font-size: 16px;
  line-height: 1.6;
}
body.cyberpunk-body {
  font-family: var(--font-body);
  background: var(--c-bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-pink); text-decoration: none; transition: color 0.2s, text-shadow 0.2s; }
a:hover, a:focus { color: #fff; text-shadow: var(--glow-pink); }
a:focus-visible { outline: 2px solid var(--c-pink); outline-offset: 3px; }
ul, dl, dt, dd { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ─── Scanlines overlay ─── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
}

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

/* ─── Sidenav ─── */
.sidenav {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidenav-w);
  height: 100vh;
  background: var(--c-nav-bg);
  border-right: 1px solid var(--c-border);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidenav::after {
  content: '';
  position: absolute;
  top: 0; right: -1px;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, var(--c-purple), var(--c-pink), var(--c-purple));
  opacity: 0.7;
}
.sidenav-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 24px 0;
  height: 100%;
}

/* Brand logo area */
.sidenav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px 16px;
  border-bottom: 1px solid var(--c-border);
  text-shadow: none;
}
.sidenav-brand:hover { text-shadow: var(--glow-purple); }
.site-logomark, .site-logo { width: 48px; height: 48px; object-fit: contain; }
.site-logo-text {
  font-family: var(--font-deco);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
}

/* Search */
.nav-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--c-border);
}
.nav-search-input {
  flex: 1;
  background: rgba(128,0,255,0.1);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 8px;
  outline: none;
  min-height: 40px;
}
.nav-search-input::placeholder { color: var(--c-fg-muted); }
.nav-search-input:focus { border-color: var(--c-pink); box-shadow: 0 0 6px rgba(255,0,255,0.3); }
.nav-search-btn {
  color: var(--c-pink);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 6px 10px;
  min-height: 40px;
  min-width: 40px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-search-btn:hover { background: rgba(255,0,255,0.15); }

/* Nav dl/dt/dd */
.nav-dl {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}
.nav-item { display: block; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--c-fg-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  min-height: 44px;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s, text-shadow 0.2s;
  text-shadow: none;
}
.nav-link:hover, .nav-link:focus {
  color: var(--c-pink);
  background: rgba(255,0,255,0.06);
  border-left-color: var(--c-pink);
  text-shadow: var(--glow-pink);
}
.nav-icon {
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
  opacity: 0.8;
}
.nav-label { flex: 1; }

/* Glitch bar */
.sidenav-glitch-bar {
  height: 2px;
  margin: 8px 12px;
  background: linear-gradient(to right, var(--c-purple), var(--c-pink), var(--c-purple));
  animation: glitch-bar 3s steps(1) infinite;
}
@keyframes glitch-bar {
  0%, 90%, 100% { opacity: 1; transform: scaleX(1); }
  91% { opacity: 0.4; transform: scaleX(0.6) translateX(8px); }
  93% { opacity: 1; transform: scaleX(1); }
  95% { opacity: 0.2; transform: scaleX(0.9) translateX(-4px); }
  97% { opacity: 1; }
}

/* ─── Page wrap ─── */
.page-wrap {
  margin-left: var(--sidenav-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Hero ─── */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--c-bg);
}

/* Hero media: dual offset images */
.hero-media {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-img-wrap {
  position: absolute;
  overflow: hidden;
}
.hero-img-wrap-a {
  top: 0; right: 0;
  width: 55%;
  height: 60%;
  border-bottom-left-radius: 24px;
  border: 1px solid rgba(128,0,255,0.3);
}
.hero-img-wrap-b {
  bottom: 5%;
  right: 8%;
  width: 42%;
  height: 50%;
  border-radius: 18px;
  border: 1px solid rgba(255,0,255,0.3);
  z-index: 2;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) brightness(0.75);
}
.hero-placeholder {
  background: linear-gradient(135deg, #1a0030 0%, #0d0020 60%, #1a0010 100%);
}

/* Slash divider */
.hero-slash {
  position: absolute;
  top: 0; right: 42%;
  width: 120px; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 45%,
    rgba(128,0,255,0.18) 45%,
    rgba(255,0,255,0.12) 55%,
    transparent 55%,
    transparent 100%
  );
  z-index: 3;
}

/* Color band overlay on hero */
.hero-section::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--c-purple), var(--c-pink));
  z-index: 10;
}

/* Hero copy */
.hero-copy {
  position: relative;
  z-index: 5;
  max-width: 52%;
  padding: 60px 48px 60px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
}
.hero-h1 {
  font-family: var(--font-deco);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 20px rgba(128,0,255,0.8), 0 0 40px rgba(128,0,255,0.4);
  animation: glitch-h1 6s steps(1) infinite;
}
@keyframes glitch-h1 {
  0%, 88%, 100% { transform: none; clip-path: none; }
  89% { transform: skewX(-3deg) translateX(3px); color: var(--c-pink); }
  90% { transform: skewX(2deg) translateX(-2px); color: #fff; }
  91% { transform: none; }
  92% { transform: skewX(-1deg); color: var(--c-purple); }
  93% { transform: none; color: #fff; }
}
.hero-desc {
  font-size: 0.95rem;
  color: var(--c-fg-muted);
  line-height: 1.7;
  max-width: 420px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid var(--c-pink);
  border-radius: 8px;
  color: var(--c-pink);
  font-family: var(--font-deco);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-shadow: var(--glow-pink);
  box-shadow: 0 0 12px rgba(255,0,255,0.2), inset 0 0 12px rgba(255,0,255,0.04);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  min-height: 44px;
}
.hero-cta:hover, .hero-cta:focus {
  background: rgba(255,0,255,0.12);
  box-shadow: var(--glow-pink), inset 0 0 16px rgba(255,0,255,0.08);
  color: #fff;
  text-shadow: var(--glow-pink);
}

/* ─── Content grid ─── */
.content-grid {
  display: flex;
  flex: 1;
  position: relative;
}

/* ─── Aside (left) ─── */
.content-aside {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--c-nav-bg);
}
.aside-inner {
  padding: 32px 16px 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aside-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
  display: block;
}
.aside-title {
  font-family: var(--font-deco);
  font-size: 1rem;
  color: var(--c-fg);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-shadow: 0 0 6px rgba(128,0,255,0.4);
}
.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aside-nav-link {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.8rem;
  color: var(--c-fg-muted);
  border-left: 2px solid transparent;
  border-radius: 4px;
  min-height: 40px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.aside-nav-link:hover, .aside-nav-link:focus {
  color: var(--c-purple);
  border-left-color: var(--c-purple);
  background: rgba(128,0,255,0.08);
  text-shadow: var(--glow-purple);
}

/* HUD readout */
.aside-hud {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hud-line {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(128,0,255,0.5);
  letter-spacing: 0.1em;
  animation: hud-blink 4s ease-in-out infinite;
}
.hud-line:nth-child(2) { animation-delay: 1.3s; }
.hud-line:nth-child(3) { animation-delay: 2.6s; }
@keyframes hud-blink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; color: var(--c-purple); text-shadow: var(--glow-purple); }
}

/* ─── Main content ─── */
.content-main {
  flex: 1;
  min-width: 0;
  padding: 48px 48px 64px;
}
.main-article {
  max-width: 860px;
}

/* Section scroll margin */
section[id] {
  scroll-margin-top: 24px;
}

/* ─── Section eyebrow + heading ─── */
.section-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  color: var(--c-pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 6px;
}
.section-heading {
  font-family: var(--font-deco);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 10px rgba(128,0,255,0.5);
  margin-bottom: 20px;
}

/* ─── Prose / page.content ─── */
.prose {
  color: var(--c-fg);
  font-size: 1rem;
  line-height: 1.75;
}
.prose h2 {
  font-family: var(--font-deco);
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 8px rgba(128,0,255,0.5);
  margin: 2em 0 0.6em;
}
.prose h3 {
  font-family: var(--font-deco);
  font-size: 1.1rem;
  color: var(--c-fg);
  margin: 1.6em 0 0.5em;
  letter-spacing: 0.05em;
}
.prose p { margin-bottom: 1em; }
.prose ul, .prose ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.prose li { margin-bottom: 0.35em; }
.prose a { color: var(--c-pink); text-decoration: underline; text-decoration-color: rgba(255,0,255,0.4); }
.prose a:hover { color: #fff; }
.prose strong { color: #fff; font-weight: 700; }
.prose em { color: var(--c-purple); font-style: italic; }
.prose code {
  font-family: var(--font-mono);
  background: rgba(128,0,255,0.15);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
  color: var(--c-pink);
}
.prose pre {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}
.prose blockquote {
  border-left: 3px solid var(--c-purple);
  padding-left: 16px;
  color: var(--c-fg-muted);
  font-style: italic;
  margin: 1em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 0.9em;
}
.prose th {
  background: rgba(128,0,255,0.2);
  color: var(--c-pink);
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--c-border);
}
.prose td {
  padding: 8px 12px;
  border: 1px solid rgba(128,0,255,0.2);
  color: var(--c-fg);
}
.prose img {
  border-radius: 12px;
  border: 1px solid var(--c-border);
  margin: 1em 0;
}
.prose section {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  background: var(--c-card-bg);
  margin-bottom: 20px;
  transition: border-color 0.3s;
}
.prose section:hover {
  border-color: rgba(255,0,255,0.4);
}

/* ─── Footer ─── */
.site-footer {
  margin-left: var(--sidenav-w);
  border-top: 1px solid var(--c-border);
  background: var(--c-nav-bg);
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.footer-brand-name {
  font-family: var(--font-deco);
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
  letter-spacing: 0.1em;
}
.footer-brand-line {
  font-size: 0.9rem;
  color: var(--c-fg-muted);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(153,128,204,0.6);
  letter-spacing: 0.06em;
}

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

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

/* ─── Responsive: tablet ─── */
@media (max-width: 1024px) {
  :root { --sidenav-w: 180px; }
  .hero-copy { max-width: 60%; padding: 40px 32px; }
  .content-main { padding: 32px 28px; }
  .content-aside { width: 180px; }
}

/* ─── Responsive: mobile ─── */
@media (max-width: 768px) {
  :root { --sidenav-w: 0px; }

  .sidenav {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0; left: 0;
    flex-direction: row;
    z-index: 1000;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidenav::after { display: none; }
  .sidenav-inner {
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
    gap: 0;
    width: 100%;
    flex-wrap: nowrap;
  }
  .sidenav-brand {
    padding: 8px 12px;
    border-bottom: none;
    border-right: 1px solid var(--c-border);
    flex-shrink: 0;
    min-height: 48px;
  }
  .site-logomark, .site-logo { width: 32px; height: 32px; }
  .site-logo-text { font-size: 1rem; }

  .nav-search {
    padding: 4px 8px;
    border-bottom: none;
    border-right: 1px solid var(--c-border);
    flex-shrink: 0;
    width: 140px;
  }
  .nav-search-input { font-size: 0.72rem; min-height: 40px; }
  .nav-search-btn { min-height: 40px; min-width: 40px; font-size: 0.72rem; }

  .nav-dl {
    flex-direction: row;
    padding: 0 4px;
    flex: 1;
    overflow-x: auto;
  }
  .nav-item { flex-shrink: 0; }
  .nav-link {
    padding: 0 12px;
    min-height: 48px;
    gap: 4px;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.75rem;
  }
  .nav-link:hover, .nav-link:focus {
    border-left-color: transparent;
    border-bottom-color: var(--c-pink);
  }
  .nav-label { white-space: nowrap; }
  .sidenav-glitch-bar { display: none; }

  .page-wrap {
    margin-left: 0;
    padding-top: 56px;
  }

  .hero-section { min-height: 100svh; }
  .hero-copy {
    max-width: 100%;
    padding: 32px 20px 48px;
    position: relative;
    z-index: 5;
  }
  .hero-h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .hero-img-wrap-a { width: 80%; height: 45%; }
  .hero-img-wrap-b { width: 60%; height: 35%; right: 2%; bottom: 12%; }

  .content-grid { flex-direction: column; }
  .content-aside {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .aside-inner { flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 16px; }
  .aside-eyebrow, .aside-title, .aside-hud { display: none; }
  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .aside-nav-link {
    border-left: none;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 6px 12px;
    min-height: 40px;
    font-size: 0.78rem;
  }

  .content-main { padding: 24px 16px 40px; }
  .main-article { max-width: 100%; }

  .site-footer {
    margin-left: 0;
    padding: 16px 20px;
  }

  section[id] { scroll-margin-top: 64px; }
}

@media (max-width: 480px) {
  .hero-copy { padding: 24px 16px 40px; gap: 14px; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-cta { font-size: 0.85rem; padding: 10px 20px; }
  .content-main { padding: 20px 14px 32px; }
  .prose section { padding: 16px 14px; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
