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

/* ===== 变量 ===== */
:root {
  --red: #ff0000;
  --pink: #ff006e;
  --dark: #1a1a2e;
  --darker: #0d0d1a;
  --cyan: #00ffff;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --card-bg: #16213e;
  --border: rgba(255,0,110,0.3);
  --nav-h: 60px;
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius: 10px;
  --glow-red: 0 0 8px #ff0000, 0 0 20px rgba(255,0,0,0.4);
  --glow-pink: 0 0 8px #ff006e, 0 0 20px rgba(255,0,110,0.4);
  --glow-cyan: 0 0 8px #00ffff, 0 0 16px rgba(0,255,255,0.3);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body.retro-body {
  background: var(--darker);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}

/* ===== 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
  );
  mix-blend-mode: multiply;
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: linear-gradient(
    rgba(0,255,255,0.02) 50%,
    transparent 50%
  );
  background-size: 100% 4px;
  animation: scanMove 8s linear infinite;
}
@keyframes scanMove {
  from { background-position: 0 0; }
  to   { background-position: 0 100vh; }
}

/* ===== 页头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,13,26,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}
.site-logo { height: 36px; width: auto; }
.brand-text {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.04em;
}
.header-tag {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--pink);
  border: 1px solid var(--pink);
  padding: 3px 8px;
  border-radius: 3px;
  text-shadow: var(--glow-pink);
  box-shadow: var(--glow-pink);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 70vh;
  background: linear-gradient(135deg, var(--darker) 0%, #0f0f23 40%, #1a0010 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 0 120px;
  scroll-margin-top: 56px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,0,0,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255,0,110,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: clamp(80px, 18vw, 240px);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,0,110,0.08);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.02em;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}
.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 16px;
  font-weight: 500;
}
.hero-h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: var(--glow-red);
  margin-bottom: 24px;
  max-width: 720px;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
}
/* 斜切底边 */
.hero-clip {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--darker);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
}

/* ===== Glitch 动效 ===== */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  background: transparent;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.glitch::before {
  color: var(--cyan);
  text-shadow: -2px 0 var(--cyan);
  animation: glitchTop 4s infinite linear;
  left: 2px;
}
.glitch::after {
  color: var(--pink);
  text-shadow: 2px 0 var(--pink);
  animation: glitchBot 4s infinite linear;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  left: -2px;
}
@keyframes glitchTop {
  0%,90%,100% { transform: skew(0deg) translateX(0); opacity: 0; }
  92% { transform: skew(-2deg) translateX(-4px); opacity: 0.7; }
  94% { transform: skew(1deg) translateX(2px); opacity: 0.5; }
  96% { transform: skew(0deg) translateX(0); opacity: 0; }
}
@keyframes glitchBot {
  0%,91%,100% { transform: skew(0deg) translateX(0); opacity: 0; }
  93% { transform: skew(2deg) translateX(4px); opacity: 0.6; }
  95% { transform: skew(-1deg) translateX(-2px); opacity: 0.4; }
  97% { transform: skew(0deg) translateX(0); opacity: 0; }
}

/* ===== 页面布局：侧边栏 + 主内容 ===== */
.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: sticky;
  top: 72px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  box-shadow: 0 0 20px rgba(255,0,110,0.08);
}
.sidebar nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar nav ul li a {
  display: block;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 40px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}
.sidebar nav ul li a:hover {
  color: var(--pink);
  border-left-color: var(--pink);
  background: rgba(255,0,110,0.08);
  text-shadow: var(--glow-pink);
}

/* ===== 主内容 ===== */
.main-content { min-width: 0; }
.wrap { width: 100%; }
.content-section { width: 100%; }
.page-article { width: 100%; }

/* ===== 正文内容排版 ===== */
.page-article h2 {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin: 60px 0 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,0,0,0.2);
  text-shadow: 0 0 12px rgba(255,0,0,0.3);
  letter-spacing: 0.02em;
}
.page-article h2:first-child { margin-top: 0; border-top: none; }

.page-article .subtitle,
.page-article p.subhead,
.page-article p.desc,
.page-article p.lead {
  color: var(--pink);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  text-shadow: 0 0 6px rgba(255,0,110,0.4);
}

.page-article h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cyan);
  margin: 32px 0 12px;
  text-shadow: var(--glow-cyan);
}
.page-article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 8px;
}
.page-article p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 18px;
}
.page-article a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s, text-shadow 0.2s;
}
.page-article a:hover {
  color: var(--red);
  text-shadow: var(--glow-red);
}
.page-article ul,
.page-article ol {
  padding-left: 24px;
  margin-bottom: 18px;
}
.page-article li {
  margin-bottom: 8px;
  line-height: 1.75;
  font-size: 1rem;
}
.page-article strong { color: #fff; font-weight: 600; }
.page-article em { color: var(--cyan); font-style: normal; }
.page-article blockquote {
  border-left: 3px solid var(--red);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(255,0,0,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.page-article code {
  background: rgba(0,255,255,0.08);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}
.page-article pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.page-article pre code {
  background: none;
  padding: 0;
}
.page-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 24px auto;
}
.page-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.page-article th {
  background: rgba(255,0,0,0.15);
  color: var(--red);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.page-article td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.page-article tr:hover td { background: rgba(255,0,110,0.04); }

/* div 区块间距与滚动偏移 */
.page-article div {
  scroll-margin-top: calc(56px + var(--nav-h) + 20px);
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,0,110,0.08);
}
.page-article div:last-child { border-bottom: none; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--dark);
  border-top: 1px solid rgba(255,0,0,0.25);
  padding: 60px 24px 40px;
  margin-top: 40px;
}
.footer-brand-block {
  text-align: center;
  margin-bottom: 40px;
  overflow: hidden;
}
.footer-brand-giant {
  font-family: var(--font-title);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,0,0,0.4);
  letter-spacing: 0.05em;
  line-height: 1;
  display: block;
  user-select: none;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px;
}
.footer-bottom > nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-bottom > nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
  padding: 6px 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-bottom > nav a:hover { color: var(--pink); }
.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ===== 底部固定导航 ===== */
.bottom-nav-aside {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(13,13,26,0.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 -4px 20px rgba(255,0,110,0.15);
}
.bottom-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: var(--nav-h);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 12px;
}
.bottom-nav-left,
.bottom-nav-right {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}
.bottom-nav-right { justify-content: flex-end; }
.bottom-nav-left li a,
.bottom-nav-right li a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 40px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: clamp(0.65rem, 1.2vw, 0.8rem);
  letter-spacing: 0.04em;
  transition: color 0.2s, text-shadow 0.2s;
  white-space: nowrap;
}
.bottom-nav-left li a:hover,
.bottom-nav-right li a:hover {
  color: var(--pink);
  text-shadow: var(--glow-pink);
}
.bottom-nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  flex-shrink: 0;
}
.bottom-nav-brand span {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.06em;
}

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

/* ===== 辅助 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding: 40px 16px 60px;
    gap: 24px;
  }
  .sidebar {
    position: static;
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .hero { padding: 60px 0 100px; }
  .hero-inner { padding: 0 16px; }
  .hero-h1 { font-size: 1.8rem; }
  .bottom-nav { padding: 0 4px; }
  .bottom-nav-left li a,
  .bottom-nav-right li a {
    padding: 8px 5px;
    font-size: 0.6rem;
  }
  .bottom-nav-brand { padding: 0 8px; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer-bottom > nav { gap: 12px; }
  .page-layout { padding: 24px 16px 60px; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .scanlines { animation: none; }
  .glitch::before,
  .glitch::after { animation: none; opacity: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
