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

/* =====================
   CSS 变量 & 基础重置
   ===================== */
:root {
  --c-bg: #1a1a2e;
  --c-red: #ff0000;
  --c-pink: #ff006e;
  --c-cyan: #00ffff;
  --c-blue: #0080ff;
  --c-light: #e0e0f0;
  --c-muted: #8080a0;
  --c-card: #16213e;
  --c-border: #ff006e;
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt: 'VT323', monospace;
  --radius-card: 18px;
  --nav-h: 80px;
  --announce-h: 36px;
  --header-total: calc(var(--nav-h) + var(--announce-h));
  --glow-red: 0 0 8px #ff0000, 0 0 20px #ff0000, 0 0 40px #ff0000;
  --glow-pink: 0 0 8px #ff006e, 0 0 20px #ff006e, 0 0 40px #ff006e;
  --glow-cyan: 0 0 8px #00ffff, 0 0 20px #00ffff;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-bg);
}

body.retro-body {
  font-family: var(--font-vt);
  font-size: 18px;
  line-height: 1.7;
  color: var(--c-light);
  background: var(--c-bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* =====================
   CRT 效果
   ===================== */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px
    );
  animation: crt-flicker 8s infinite;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 0, 110, 0.03) 0px,
    rgba(255, 0, 110, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
}

@keyframes crt-flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.94; }
  97% { opacity: 0.98; }
  98% { opacity: 0.92; }
}

/* =====================
   HEADER & NAV
   ===================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.97);
  border-bottom: 2px solid var(--c-pink);
  box-shadow: 0 2px 20px rgba(255, 0, 110, 0.4);
}

.header-announce {
  height: var(--announce-h);
  background: linear-gradient(90deg, var(--c-red), var(--c-pink), var(--c-red));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.announce-text {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #fff;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
  letter-spacing: 0.05em;
}

@keyframes marquee {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

.main-nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

/* details/summary 结构 */
.nav-details {
  width: 100%;
  position: relative;
}

.nav-details[open] > .nav-summary .nav-toggle-icon {
  display: none;
}

.nav-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--c-pink);
  padding: 10px;
  min-height: 44px;
  align-items: center;
}

.nav-summary::-webkit-details-marker { display: none; }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

menu, menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-right {
  justify-content: flex-end;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  flex-shrink: 0;
  padding: 8px 12px;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.nav-pill {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--c-light);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--c-pink);
  border-radius: 50px;
  white-space: nowrap;
  transition: all 0.2s;
  display: block;
  min-height: 40px;
  display: flex;
  align-items: center;
  background: rgba(255, 0, 110, 0.05);
  line-height: 1.2;
}

.nav-pill:hover,
.nav-pill:focus {
  background: var(--c-pink);
  color: #fff;
  box-shadow: var(--glow-pink);
  text-shadow: none;
}

/* scroll-margin for fixed header */
section[id] {
  scroll-margin-top: calc(var(--header-total) + 20px);
}

/* =====================
   HERO
   ===================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-total) + 40px) 24px 120px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255, 0, 110, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
    var(--c-bg);
  overflow: hidden;
  text-align: center;
}

/* Geometric grid background */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 110, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 110, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #fff;
  background: var(--c-red);
  padding: 8px 20px;
  border-radius: 50px;
  margin-bottom: 32px;
  box-shadow: var(--glow-red);
  animation: float-badge 3s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-h1 {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 4vw, 40px);
  color: #fff;
  text-shadow: var(--glow-pink);
  margin-bottom: 24px;
  line-height: 1.6;
  position: relative;
}

/* Glitch effect */
.glitch-text {
  animation: glitch-main 6s infinite;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
}

.glitch-text::before {
  color: var(--c-cyan);
  animation: glitch-before 6s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
}

.glitch-text::after {
  color: var(--c-red);
  animation: glitch-after 6s infinite;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}

@keyframes glitch-main {
  0%, 85%, 100% { transform: translate(0); }
  86% { transform: translate(-2px, 1px) skewX(-1deg); }
  87% { transform: translate(2px, -1px) skewX(1deg); }
  88% { transform: translate(0); }
  92% { transform: translate(1px, 2px); }
  93% { transform: translate(-1px, -2px); }
  94% { transform: translate(0); }
}

@keyframes glitch-before {
  0%, 85%, 100% { transform: translate(0); opacity: 0; }
  86% { transform: translate(-4px, 0); opacity: 0.7; }
  87% { transform: translate(4px, 0); opacity: 0.7; }
  88%, 92% { transform: translate(0); opacity: 0; }
  93% { transform: translate(-3px, 1px); opacity: 0.5; }
  94% { opacity: 0; }
}

@keyframes glitch-after {
  0%, 85%, 100% { transform: translate(0); opacity: 0; }
  86% { transform: translate(4px, 0); opacity: 0.7; }
  87% { transform: translate(-4px, 0); opacity: 0.7; }
  88%, 92% { opacity: 0; }
  93% { transform: translate(3px, -1px); opacity: 0.5; }
  94% { opacity: 0; }
}

.hero-desc {
  font-family: var(--font-vt);
  font-size: 22px;
  color: var(--c-muted);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn-primary {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--c-red), var(--c-pink));
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: var(--glow-pink);
  transition: all 0.3s;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 15px #ff006e, 0 0 40px #ff006e, 0 8px 20px rgba(255, 0, 110, 0.4);
}

.neon-pulse {
  animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%, 100% { box-shadow: var(--glow-pink); }
  50% { box-shadow: 0 0 20px #ff006e, 0 0 60px #ff006e, 0 0 100px #ff006e; }
}

.btn-secondary {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--c-pink);
  background: transparent;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 50px;
  border: 2px solid var(--c-pink);
  cursor: pointer;
  transition: all 0.3s;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  background: rgba(255, 0, 110, 0.15);
  box-shadow: var(--glow-pink);
  color: #fff;
}

.hero-tags {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--c-cyan);
  border: 1px solid var(--c-cyan);
  padding: 6px 14px;
  border-radius: 4px;
  text-shadow: var(--glow-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

.hero-arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--c-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 3;
}

/* =====================
   CONTENT WRAPPER (aside + main)
   ===================== */
.content-wrapper {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 24px;
  align-items: flex-start;
  position: relative;
}

/* =====================
   ASIDE (left)
   ===================== */
.content-aside {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-total) + 20px);
  margin-right: 40px;
}

.aside-inner {
  background: var(--c-card);
  border: 1px solid rgba(255, 0, 110, 0.3);
  border-radius: var(--radius-card);
  padding: 24px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 0, 110, 0.03);
}

.aside-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--c-pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 0, 110, 0.3);
  letter-spacing: 0.05em;
}

.aside-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-link {
  display: block;
  font-family: var(--font-vt);
  font-size: 17px;
  color: var(--c-muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  color: var(--c-pink);
  border-left-color: var(--c-pink);
  background: rgba(255, 0, 110, 0.08);
  text-shadow: 0 0 8px rgba(255, 0, 110, 0.5);
}

.aside-deco {
  text-align: center;
  margin-top: 20px;
  font-size: 24px;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  animation: spin-deco 8s linear infinite;
}

@keyframes spin-deco {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =====================
   MAIN CONTENT
   ===================== */
.content-main {
  flex: 1;
  min-width: 0;
}

.page-content-section {
  /* page.content 直接输出的区域 */
}

/* =====================
   page.content 内部样式
   ===================== */
.page-content-section h2,
main h2 {
  font-family: var(--font-pixel);
  font-size: clamp(13px, 2vw, 18px);
  color: var(--c-pink);
  text-shadow: var(--glow-pink);
  margin: 60px 0 24px;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(255, 0, 110, 0.3);
  line-height: 1.6;
}

.page-content-section h2 > span,
main h2 > span {
  display: inline;
}

.page-content-section h3,
main h3 {
  font-family: var(--font-pixel);
  font-size: clamp(11px, 1.5vw, 14px);
  color: var(--c-red);
  text-shadow: var(--glow-red);
  margin: 36px 0 16px;
  line-height: 1.6;
}

.page-content-section h3 > span,
main h3 > span {
  display: inline;
}

.page-content-section p,
main p {
  font-family: var(--font-vt);
  font-size: 20px;
  line-height: 1.75;
  color: var(--c-light);
  margin-bottom: 20px;
  max-width: 72ch;
}

.page-content-section ul,
.page-content-section ol,
main ul,
main ol {
  font-family: var(--font-vt);
  font-size: 20px;
  line-height: 1.75;
  color: var(--c-light);
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.page-content-section li,
main li {
  margin-bottom: 8px;
}

.page-content-section a,
main a {
  color: var(--c-pink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 110, 0.4);
  transition: all 0.2s;
}

.page-content-section a:hover,
main a:hover {
  text-shadow: 0 0 8px rgba(255, 0, 110, 0.8);
  text-decoration-color: var(--c-pink);
}

.page-content-section strong,
main strong {
  color: var(--c-cyan);
  font-weight: normal;
  text-shadow: var(--glow-cyan);
}

/* Section separators via page.content sections */
.page-content-section section,
main article > section {
  padding: 40px 0;
  border-bottom: 1px solid rgba(255, 0, 110, 0.12);
  position: relative;
}

.page-content-section section::before,
main article > .content-main section::before {
  content: '';
  display: block;
  height: 2px;
  width: 60px;
  background: linear-gradient(90deg, var(--c-red), var(--c-pink));
  margin-bottom: 24px;
  box-shadow: var(--glow-pink);
}

/* scroll-reveal targets */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  background: linear-gradient(180deg, var(--c-bg) 0%, #0d0d1a 100%);
  border-top: 2px solid var(--c-red);
  box-shadow: 0 -4px 30px rgba(255, 0, 0, 0.2);
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-brand-block {
  text-align: center;
  margin-bottom: 32px;
}

.footer-brand-big {
  font-family: var(--font-pixel);
  font-size: clamp(18px, 5vw, 48px);
  color: var(--c-red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.05em;
  display: block;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 0, 0, 0.2);
  padding-top: 24px;
}

.footer-copy {
  font-family: var(--font-vt);
  font-size: 17px;
  color: var(--c-muted);
}

.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.footer-link {
  font-family: var(--font-vt);
  font-size: 17px;
  color: var(--c-muted);
  text-decoration: none;
  padding: 10px 4px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--c-pink);
  text-shadow: 0 0 8px rgba(255, 0, 110, 0.6);
}

.footer-meta {
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--c-red);
  text-shadow: 0 0 6px rgba(255, 0, 0, 0.5);
}

.footer-tip {
  border: 1px solid var(--c-red);
  padding: 6px 14px;
  border-radius: 4px;
}

/* =====================
   图片
   ===================== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

/* =====================
   滚动条
   ===================== */
::-webkit-scrollbar {
  width: 6px;
  background: var(--c-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--c-pink);
  border-radius: 3px;
}

/* =====================
   响应式
   ===================== */
@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
    padding: 40px 16px;
  }

  .content-aside {
    width: 100%;
    position: static;
    margin-right: 0;
    margin-bottom: 32px;
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .aside-link {
    border-left: none;
    border: 1px solid rgba(255, 0, 110, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
  }
}

@media (max-width: 768px) {
  .nav-summary {
    display: flex;
  }

  .nav-details:not([open]) .nav-inner {
    display: none;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: rgba(26, 26, 46, 0.98);
    border-top: 1px solid rgba(255, 0, 110, 0.3);
  }

  .nav-left,
  .nav-right {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-brand {
    order: -1;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 0, 110, 0.2);
  }

  .nav-pill {
    font-size: 7px;
    padding: 6px 10px;
    min-height: 40px;
  }

  .main-nav {
    height: auto;
    min-height: var(--nav-h);
  }

  .hero-h1 {
    font-size: clamp(16px, 5vw, 26px);
  }

  .hero-desc {
    font-size: 19px;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 9px;
    padding: 14px 24px;
  }

  .footer-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .footer-brand-big {
    font-size: clamp(16px, 8vw, 32px);
  }

  .page-content-section h2,
  main h2 {
    font-size: 12px;
  }
}

@media (max-width: 375px) {
  body.retro-body {
    font-size: 16px;
  }

  .hero-section {
    padding-top: calc(var(--header-total) + 20px);
  }

  .hero-h1 {
    font-size: 15px;
  }

  .content-wrapper {
    padding: 24px 12px;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }
}

/* =====================
   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;
  }
  html {
    scroll-behavior: auto;
  }
}

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