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

/* ===== CSS 变量 ===== */
:root {
  --color-bg: #0d0d0d;
  --color-primary: #8000ff;
  --color-accent: #ff00ff;
  --color-text: #e0e0e0;
  --color-text-dim: #888;
  --color-surface: #111118;
  --color-surface2: #16161f;
  --color-border: #8000ff44;
  --color-border-accent: #ff00ff66;
  --color-green: #00ff88;
  --nav-height: 64px;
  --header-height: 60px;
  --font-heading: 'Russo One', 'Chakra Petch', monospace;
  --font-body: 'Chakra Petch', monospace;
  --radius: 10px;
  --glow-primary: 0 0 8px #8000ff, 0 0 20px #8000ff66;
  --glow-accent: 0 0 8px #ff00ff, 0 0 20px #ff00ff66;
  --glow-text: 0 0 6px #8000ffcc;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-bottom: calc(var(--nav-height) + 16px);
  font-size: 16px;
  background: var(--color-bg);
}
body.cyberpunk-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-height);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s, text-shadow 0.2s; }
a:hover { color: #fff; text-shadow: var(--glow-accent); }
ol, ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }

/* ===== 扫描线覆盖层 ===== */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===== 站头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.92);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  height: var(--header-height);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.05em;
  padding: 0.35rem 0;
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
}
.site-logo { height: 36px; width: auto; }
.header-tagline {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  flex: 1;
  letter-spacing: 0.08em;
}
.hud-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--color-green);
  letter-spacing: 0.1em;
}
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--color-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  scroll-margin-top: var(--header-height);
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
  overflow: hidden;
}
.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(128,0,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,0,255,0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}
.dot-matrix {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,0,255,0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
}
.hero-aside {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 2;
  width: 180px;
}
.hud-box {
  border: 1px solid var(--color-border-accent);
  background: rgba(13,13,13,0.8);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.hud-row { display: flex; justify-content: space-between; padding: 0.2rem 0; border-bottom: 1px solid rgba(128,0,255,0.1); }
.hud-row:last-child { border-bottom: none; }
.hud-label { color: var(--color-text-dim); }
.hud-val { color: var(--color-accent); }
.hud-val.online { color: var(--color-green); text-shadow: 0 0 6px var(--color-green); }
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  text-shadow: var(--glow-accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: #fff;
  text-shadow: var(--glow-primary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.hero-sub {
  font-size: 1rem;
  color: var(--color-text-dim);
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.7;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  min-height: 44px;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  border-radius: var(--radius);
  text-shadow: var(--glow-primary);
  box-shadow: var(--glow-primary), inset 0 0 20px rgba(128,0,255,0.05);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 20px #8000ff, 0 0 40px #8000ff88;
  text-shadow: none;
}

/* ===== Glitch 动画 ===== */
.glitch-text { position: relative; }
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}
.glitch-text::before {
  color: var(--color-accent);
  animation: glitch-before 4s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.glitch-text::after {
  color: var(--color-primary);
  animation: glitch-after 4s infinite linear;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
@keyframes glitch-before {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92% { transform: translate(-3px, -2px) skewX(-5deg); opacity: 0.8; }
  94% { transform: translate(3px, 2px) skewX(5deg); opacity: 0.6; }
  96% { transform: translate(-2px, 0); opacity: 0.4; }
  98% { transform: none; opacity: 0; }
}
@keyframes glitch-after {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90% { transform: translate(3px, 2px) skewX(3deg); opacity: 0.8; }
  93% { transform: translate(-3px, -1px) skewX(-3deg); opacity: 0.5; }
  97% { transform: none; opacity: 0; }
}

/* ===== 内容区（主栏 + 侧栏）===== */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}
.content-main { min-width: 0; }

/* ===== page.content 内 section 样式 ===== */
.content-main section {
  scroll-margin-top: calc(var(--header-height) + 80px);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.content-main section:last-child { border-bottom: none; }
.content-main section > figure {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  padding: 1rem;
}
.content-main section > aside {
  float: right;
  width: 220px;
  margin: 0 0 1.5rem 1.5rem;
  border: 1px solid var(--color-border-accent);
  border-radius: var(--radius);
  background: var(--color-surface2);
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-dim);
}
.content-main h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.content-main h2 > span { display: inline-block; }
.content-main h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  margin-right: 0.5rem;
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
}
.content-main h3 {
  font-size: 1.1rem;
  color: var(--color-accent);
  margin: 1.25rem 0 0.5rem;
  letter-spacing: 0.04em;
}
.content-main h3 > span { display: inline-block; }
.content-main p { margin-bottom: 0.85rem; line-height: 1.8; }
.content-main ul, .content-main ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
  list-style: disc;
}
.content-main ol { list-style: decimal; }
.content-main li { margin-bottom: 0.4rem; line-height: 1.7; }
.content-main a {
  color: var(--color-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.content-main a:hover { border-color: var(--color-accent); }
.content-main strong { color: #fff; }
.content-main em { color: var(--color-accent); font-style: normal; }
.content-main blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text-dim);
  font-size: 0.95rem;
}
.content-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.content-main th, .content-main td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.content-main th {
  background: var(--color-surface2);
  color: var(--color-primary);
  font-family: var(--font-heading);
}
.content-main code {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88em;
  color: var(--color-green);
}
.content-main pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.content-main pre code { background: none; border: none; padding: 0; }

/* ===== 侧栏 ===== */
.content-aside { position: sticky; top: calc(var(--header-height) + 1rem); }
.aside-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.aside-panel--decor {
  border-color: var(--color-border-accent);
  background: rgba(255,0,255,0.03);
}
.aside-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-accent);
  text-shadow: var(--glow-accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.aside-title > span { display: inline-block; }
.aside-nav-list { display: flex; flex-direction: column; gap: 0.4rem; }
.aside-link {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, text-shadow 0.2s;
  letter-spacing: 0.05em;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.aside-link:hover {
  background: rgba(128,0,255,0.12);
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
}
.terminal-lines {
  font-size: 0.72rem;
  color: var(--color-green);
  line-height: 1.8;
  font-family: monospace;
}
.t-line { letter-spacing: 0.04em; }
.blink-cursor { animation: blink 1s infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ===== 滚动揭示动画 ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.5s, transform 0.5s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(13,13,13,0.96);
  border-top: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  height: var(--nav-height);
}
.bottom-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 0.5rem;
}
.bottom-nav-inner > li { flex: 1; display: flex; justify-content: center; }
.bottom-nav-brand { flex: 0 0 auto; padding: 0 0.75rem; display: flex; align-items: center; justify-content: center; }
.bottom-brand-link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.5rem;
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.4rem;
  font-size: 0.68rem;
  color: var(--color-text-dim);
  letter-spacing: 0.06em;
  text-align: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s, text-shadow 0.2s;
  white-space: nowrap;
  line-height: 1.2;
}
.nav-link:hover {
  color: var(--color-accent);
  background: rgba(255,0,255,0.08);
  text-shadow: var(--glow-accent);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-bottom: var(--nav-height);
}
.footer-brand-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.footer-brand-logo .logo-text {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.75rem;
  min-height: auto;
  line-height: 1.4;
  padding: 0;
}
.footer-brand-desc {
  font-size: 0.88rem;
  color: var(--color-text-dim);
  line-height: 1.7;
}
.footer-contact { margin-top: 1rem; }
.footer-link { font-size: 0.85rem; color: var(--color-accent); }
.footer-links-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.footer-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}
.footer-section-title > span { display: inline-block; }
.footer-nav-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-nav-link {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  transition: color 0.2s, text-shadow 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-nav-link:hover { color: var(--color-accent); text-shadow: var(--glow-accent); }
.footer-bottom-section {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-dim);
  line-height: 1.8;
}
.footer-copy { color: var(--color-text-dim); }
.footer-note { font-size: 0.72rem; opacity: 0.6; margin-top: 0.25rem; }

/* ===== 区块分隔 ===== */
.content-main section::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, transparent 100%);
  margin-bottom: 2rem;
  opacity: 0.4;
  border-radius: 1px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }
  .content-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
  }
  .aside-panel { margin-bottom: 0; }
  .footer-brand-section { grid-template-columns: 1fr; }
  .hero-aside { display: none; }
}
@media (max-width: 600px) {
  .hero-section { padding: 3.5rem 1rem 3rem; min-height: 70vh; }
  .hero-title { font-size: clamp(2rem, 11vw, 3.5rem); }
  .header-tagline { display: none; }
  .bottom-nav-inner { padding: 0; }
  .nav-link { font-size: 0.6rem; padding: 0.4rem 0.2rem; }
  .content-wrapper { padding: 1.5rem 1rem; }
  .content-aside { grid-template-columns: 1fr; }
  .content-main section > aside { float: none; width: 100%; margin: 1rem 0; }
  .footer-brand-section { padding: 2rem 1rem 1.5rem; }
  .footer-links-section { padding: 1.5rem 1rem; }
}
@media (max-width: 400px) {
  .bottom-nav-brand { display: none; }
  .bottom-nav-inner > li { flex: 1; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
