@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --neon: #80ff00;
  --neon2: #00ff00;
  --dark: #1f2617;
  --dark2: #151c0e;
  --dark3: #283320;
  --mid: #2e3d1f;
  --text: #d8f0b0;
  --text-dim: #8aaa60;
  --text-muted: #5a7040;
  --white: #f5ffe0;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --font-sans: 'Fira Sans', system-ui, -apple-system, sans-serif;
  --nav-w: 220px;
  --marquee-h: 32px;
  --radius: 10px;
  --radius-sm: 6px;
  --trans: 0.22s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--dark2);
  color: var(--text);
  font-family: var(--font-mono);
  overflow-x: hidden;
}

body.body-home {
  background: var(--dark2);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--neon); text-decoration: none; }
a:hover { color: var(--neon2); text-decoration: underline; }

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

/* ===== SCROLL MARGIN FOR FIXED NAV ===== */
section[id] {
  scroll-margin-top: calc(var(--marquee-h) + 12px);
}

/* ===== MARQUEE BAR ===== */
.marquee-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--marquee-h);
  background: var(--neon);
  color: var(--dark2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee-scroll 28s linear infinite;
  will-change: transform;
}

.marquee-track span {
  display: inline-block;
  padding-right: 2em;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== SITE WRAPPER ===== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: var(--marquee-h);
}

/* ===== LEFT SIDEBAR NAV ===== */
.sidenav {
  position: fixed;
  top: var(--marquee-h);
  left: 0;
  width: var(--nav-w);
  height: calc(100vh - var(--marquee-h));
  background: var(--dark);
  border-right: 2px solid var(--neon);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 900;
  overflow: hidden;
  overflow-y: auto;
}

.sidenav-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--mid);
}

.brand-link {
  display: block;
  text-decoration: none;
}

.brand-logo-img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

.brand-logo-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon);
  letter-spacing: 0.04em;
  display: block;
  line-height: 1.3;
}

/* 导航标签结构：nav > p > a */
.sidenav-nav {
  flex: 1;
  padding: 12px 0;
}

.sidenav-nav p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--trans), border-color var(--trans), background var(--trans);
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--neon);
  border-left-color: var(--neon);
  background: rgba(128, 255, 0, 0.06);
  text-decoration: none;
}

.sidenav-slogan {
  padding: 14px 16px;
  border-top: 1px solid var(--mid);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ===== FLOATING STICKERS ===== */
.sticker {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 4px 7px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  animation: jitter 3s ease-in-out infinite;
  user-select: none;
}

.sticker-age {
  background: #ff003c;
  color: #fff;
  animation-delay: 0s;
}
.sticker-hot {
  background: var(--neon);
  color: var(--dark2);
  animation-delay: 0.7s;
}
.sticker-free {
  background: var(--dark3);
  color: var(--neon);
  border: 1px solid var(--neon);
  animation-delay: 1.3s;
}
.sticker-raw {
  background: var(--neon2);
  color: var(--dark2);
  animation-delay: 0.4s;
  mix-blend-mode: screen;
}

@keyframes jitter {
  0%,100% { transform: rotate(var(--r, 0deg)) translateY(0px); }
  25%      { transform: rotate(calc(var(--r, 0deg) + 2deg)) translateY(-2px); }
  75%      { transform: rotate(calc(var(--r, 0deg) - 2deg)) translateY(2px); }
}

/* ===== MAIN AREA ===== */
.main-area {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== HERO ===== */
.hero-block {
  min-height: 45vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
  padding: 40px 48px 40px 40px;
  background:
    linear-gradient(135deg, var(--dark) 60%, var(--dark3) 100%);
  border-bottom: 2px solid var(--neon);
  position: relative;
  overflow: hidden;
}

.hero-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      rgba(128,255,0,0.03) 40px,
      rgba(128,255,0,0.03) 41px
    );
  pointer-events: none;
}

.hero-text-col {
  flex: 1 1 55%;
  min-width: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.hero-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-neon {
  background: var(--neon);
  color: var(--dark2);
}

.badge-outline {
  background: transparent;
  color: var(--neon);
  border: 1.5px solid var(--neon);
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 440px;
}

.hero-cta {
  display: inline-block;
  padding: 12px 28px;
  background: var(--neon);
  color: var(--dark2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: background var(--trans), transform var(--trans);
  min-height: 44px;
  line-height: 1.4;
  align-self: flex-start;
}

.hero-cta:hover {
  background: var(--neon2);
  transform: translateY(-2px);
  text-decoration: none;
}

.hero-img-col {
  flex: 0 1 40%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hero-img {
  border-radius: var(--radius);
  max-height: 320px;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(128,255,0,0.25);
  filter: saturate(140%);
}

.hero-float-badge {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--neon);
  color: var(--dark2);
  letter-spacing: 0.07em;
  animation: float-badge 2.5s ease-in-out infinite;
}

.hero-float-badge:first-of-type {
  top: 12%;
  right: -10px;
}

.hero-float-badge.badge-b {
  bottom: 15%;
  right: -14px;
  animation-delay: 1.2s;
  background: var(--neon2);
}

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

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

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}

.content-section {
  /* section 直接子元素是 div */
}

.content-article {
  /* div */
}

.article-inner {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

/* ===== ARTICLE BODY (page.content 落点) ===== */
.article-body {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

/* 正文内容样式 */
.article-body h2 {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon);
  margin: 2.2em 0 0.6em;
  letter-spacing: -0.01em;
  border-left: 4px solid var(--neon);
  padding-left: 14px;
}

.article-body h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin: 1.6em 0 0.5em;
}

.article-body p {
  margin-bottom: 1em;
  color: var(--text);
}

.article-body ul, .article-body ol {
  margin: 0.8em 0 1em 1.4em;
}

.article-body li {
  margin-bottom: 0.4em;
  color: var(--text);
}

.article-body a {
  color: var(--neon);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--neon2);
}

.article-body strong {
  color: var(--neon);
  font-weight: 700;
}

.article-body blockquote {
  border-left: 3px solid var(--neon);
  padding: 10px 18px;
  margin: 1.2em 0;
  background: rgba(128,255,0,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
  font-style: italic;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92rem;
}

.article-body th {
  background: var(--dark3);
  color: var(--neon);
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--mid);
}

.article-body td {
  padding: 9px 14px;
  border: 1px solid var(--mid);
  color: var(--text);
}

.article-body tr:nth-child(even) td {
  background: rgba(128,255,0,0.03);
}

/* section 内容区块样式（page.content 里的 section） */
.article-body section {
  margin-bottom: 2.5em;
  padding: 24px 28px;
  background:
    linear-gradient(135deg, rgba(47,61,32,0.45) 0%, rgba(31,38,23,0.45) 100%);
  border: 1px solid var(--mid);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  transition: border-color var(--trans), box-shadow var(--trans);
}

.article-body section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon), transparent);
  opacity: 0.5;
}

.article-body section:hover {
  border-color: rgba(128,255,0,0.4);
  box-shadow: 0 0 20px rgba(128,255,0,0.08);
}

/* ===== ASIDE ===== */
.article-aside {
  flex: 0 0 240px;
  width: 240px;
  position: sticky;
  top: calc(var(--marquee-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-aside small {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--neon);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.aside-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}

.article-aside nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--dark);
  border: 1px solid var(--mid);
  border-radius: var(--radius);
  padding: 14px 12px;
}

.aside-link {
  display: block;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--trans), color var(--trans);
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  background: rgba(128,255,0,0.1);
  color: var(--neon);
  text-decoration: none;
}

.aside-widget {
  background: var(--dark);
  border: 1px solid var(--mid);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
}

.aside-widget-warn {
  border-color: rgba(255,60,0,0.4);
  background: rgba(80,20,0,0.3);
}

.aside-widget-warn small {
  color: #ff6030;
}

.aside-widget-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 6px;
}

.aside-widget-text {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  border-top: 2px solid var(--neon);
  padding: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 0;
}

.site-footer > section {
  padding: 36px 28px;
  border-right: 1px solid var(--mid);
}

.site-footer > section:last-child {
  border-right: none;
}

.footer-brand-mega {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--neon);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(128,255,0,0.35));
}

.footer-brand-desc {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-section-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 14px;
}

.site-footer small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--neon);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  transition: color var(--trans);
}

.footer-link:hover {
  color: var(--neon);
  text-decoration: none;
}

.footer-info-text {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--mid);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* stagger via CSS custom property */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal-stagger.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay:0.05s; }
.reveal-stagger.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay:0.13s; }
.reveal-stagger.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay:0.21s; }
.reveal-stagger.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay:0.29s; }
.reveal-stagger.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay:0.37s; }
.reveal-stagger.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay:0.45s; }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --nav-w: 190px; }
  .wrap { padding: 32px 20px; }
  .hero-block { padding: 32px 24px; gap: 20px; }
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer > section:nth-child(2) {
    border-right: 1px solid var(--mid);
  }
  .site-footer > section:nth-child(3) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .sidenav {
    position: fixed;
    top: var(--marquee-h);
    left: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--marquee-h));
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 2px solid var(--neon);
    z-index: 900;
    overflow: hidden;
    overflow-x: auto;
  }

  .sidenav-brand {
    padding: 10px 14px;
    border-bottom: none;
    border-right: 1px solid var(--mid);
    display: flex;
    align-items: center;
  }

  .sidenav-nav {
    flex: 1;
    padding: 0;
    display: flex;
    align-items: center;
  }

  .sidenav-nav p {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    padding: 6px 8px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-link {
    white-space: nowrap;
    padding: 10px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 0.76rem;
    min-height: 44px;
  }

  .nav-link:hover {
    border-left-color: transparent;
    border-bottom-color: var(--neon);
  }

  .sidenav-slogan { display: none; }

  .sticker { display: none; }

  .main-area {
    margin-left: 0;
    margin-top: 60px; /* nav height approx */
    padding-top: 0;
  }

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

  .hero-block {
    flex-direction: column;
    min-height: auto;
    padding: 28px 16px;
    gap: 24px;
  }

  .hero-img-col {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-img {
    max-height: 200px;
    width: 100%;
  }

  .hero-float-badge {
    display: none;
  }

  .article-inner {
    flex-direction: column;
    gap: 28px;
  }

  .article-aside {
    position: static;
    width: 100%;
    flex: none;
  }

  .wrap {
    padding: 24px 14px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer > section {
    border-right: none;
    border-bottom: 1px solid var(--mid);
    padding: 24px 18px;
  }

  .site-footer > section:last-child {
    border-bottom: none;
  }

  .footer-brand-mega {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.3rem;
  }

  .badge {
    font-size: 0.67rem;
    padding: 3px 9px;
  }

  .hero-cta {
    padding: 10px 20px;
    font-size: 0.8rem;
  }

  .article-body section {
    padding: 16px 14px;
  }
}

/* ===== GLASS CARD (for any card elements inside content) ===== */
.article-body .glass-card {
  background: rgba(40, 51, 32, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(128,255,0,0.18);
  border-radius: var(--radius);
  padding: 20px;
}

/* ===== NEON GLOW UTILITY ===== */
.neon-text {
  color: var(--neon);
  text-shadow: 0 0 10px rgba(128,255,0,0.6), 0 0 20px rgba(128,255,0,0.3);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: var(--mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon); }

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