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

/* ===== 变量 ===== */
:root {
  --c-red: #ff0000;
  --c-pink: #ff006e;
  --c-dark: #1a1a2e;
  --c-dark2: #16213e;
  --c-dark3: #0f0f1a;
  --c-text: #e8e8f0;
  --c-text-muted: #9090b0;
  --c-border: rgba(255,0,110,0.25);
  --c-card-bg: rgba(26,26,46,0.85);
  --c-glow-red: 0 0 8px #ff0000, 0 0 20px rgba(255,0,0,0.4);
  --c-glow-pink: 0 0 8px #ff006e, 0 0 20px rgba(255,0,110,0.4);
  --font-main: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-h: 64px;
  --radius-pill: 999px;
  --transition: 0.2s ease;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--c-dark); color: var(--c-text); font-family: var(--font-main); font-size: 16px; line-height: 1.7; min-height: 100vh; overflow-x: hidden; }
a { color: var(--c-pink); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-red); }
ul, menu { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; width: 100%; }

/* ===== CRT 扫描线 ===== */
.crt-overlay {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  animation: crt-flicker 8s infinite;
}
@keyframes crt-flicker {
  0%,95%,100% { opacity: 1; }
  96% { opacity: 0.92; }
  97% { opacity: 0.98; }
  98% { opacity: 0.90; }
}

/* ===== Glitch 效果 ===== */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  clip: rect(0,0,0,0);
}
.glitch::before {
  color: var(--c-red);
  animation: glitch-a 3s infinite steps(1);
  text-shadow: none;
}
.glitch::after {
  color: var(--c-pink);
  animation: glitch-b 3s infinite steps(1) 0.5s;
  text-shadow: none;
}
@keyframes glitch-a {
  0%,90%,100% { clip: rect(0,0,0,0); transform: none; }
  91% { clip: rect(8px, 999px, 20px, 0); transform: skewX(-3deg) translateX(3px); }
  92% { clip: rect(40px,999px,55px,0); transform: skewX(2deg) translateX(-3px); }
  93% { clip: rect(0,0,0,0); transform: none; }
}
@keyframes glitch-b {
  0%,88%,100% { clip: rect(0,0,0,0); transform: none; }
  89% { clip: rect(25px,999px,38px,0); transform: skewX(4deg) translateX(-4px); }
  90% { clip: rect(60px,999px,70px,0); transform: skewX(-2deg) translateX(4px); }
  91% { clip: rect(0,0,0,0); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { display: none; }
  .crt-overlay { animation: none; }
  .reveal-row { opacity: 1 !important; transform: none !important; }
}

/* ===== 导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(26,26,46,0.95);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  height: var(--nav-h);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center;
}

.nav-details { width: 100%; position: relative; }
.nav-details[open] { position: static; }

.nav-brand {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  list-style: none;
  height: var(--nav-h);
  padding: 0 8px;
  user-select: none;
}
.nav-brand::-webkit-details-marker { display: none; }

.brand-logo-text {
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--c-red);
  text-shadow: var(--c-glow-red);
  font-family: var(--font-mono);
}
.nav-toggle-icon { font-size: 1.2rem; color: var(--c-pink); margin-left: 8px; }

.nav-menu {
  position: absolute; top: calc(var(--nav-h) - 2px); left: 0; right: 0;
  background: rgba(26,26,46,0.98);
  border: 1px solid var(--c-border);
  border-top: none;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 24px;
  z-index: 200;
}
.nav-pill {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  color: var(--c-text);
  font-size: 0.88rem; font-weight: 500;
  min-height: 40px; line-height: 22px;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.nav-pill:hover, .nav-pill--active {
  border-color: var(--c-pink);
  color: var(--c-pink);
  box-shadow: var(--c-glow-pink);
}

@media (min-width: 768px) {
  .nav-details { display: flex; align-items: center; }
  .nav-details[open] .nav-menu,
  .nav-details .nav-menu {
    position: static;
    border: none; background: transparent;
    padding: 0; gap: 6px;
    flex-wrap: nowrap;
    display: flex !important;
  }
  .nav-brand { justify-content: flex-start; gap: 24px; pointer-events: none; }
  .nav-toggle-icon { display: none; }
  .nav-details { overflow: visible; }
}

/* ===== 按钮 ===== */
.btn-neon {
  display: inline-block;
  padding: 12px 28px; min-height: 44px;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem;
  transition: box-shadow var(--transition), background var(--transition);
}
.btn-neon--primary {
  background: var(--c-red);
  color: #fff;
  box-shadow: var(--c-glow-red);
}
.btn-neon--primary:hover { box-shadow: 0 0 16px #ff0000, 0 0 40px rgba(255,0,0,0.5); color: #fff; }
.btn-neon--ghost {
  background: transparent;
  color: var(--c-pink);
  border: 1px solid var(--c-pink);
  box-shadow: var(--c-glow-pink);
}
.btn-neon--ghost:hover { background: rgba(255,0,110,0.1); color: var(--c-pink); }
.btn-neon:not(.btn-neon--primary):not(.btn-neon--ghost) {
  background: var(--c-pink); color: #fff;
  box-shadow: var(--c-glow-pink);
}

/* ===== Hero (首页) ===== */
.hero {
  position: relative; min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(255,0,0,0.08) 0%, transparent 70%);
}
.hero-bg-text {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: clamp(80px, 18vw, 220px);
  font-weight: 700; letter-spacing: 0.1em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,0,110,0.12);
  pointer-events: none; user-select: none;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 60px 24px;
  max-width: 700px;
}
.hero-badge {
  display: inline-block; padding: 5px 16px;
  border: 1px solid var(--c-pink);
  border-radius: var(--radius-pill);
  font-size: 0.78rem; font-family: var(--font-mono);
  color: var(--c-pink); letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.hero-h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700; line-height: 1.15;
  color: var(--c-text);
  text-shadow: 0 0 30px rgba(255,0,0,0.3);
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 1.05rem; color: var(--c-text-muted);
  margin-bottom: 32px; max-width: 520px; margin-left: auto; margin-right: auto;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-pixel-deco { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.pixel-block { display: block; width: 8px; height: 8px; }
.px1 { background: var(--c-red); box-shadow: var(--c-glow-red); }
.px2 { background: var(--c-pink); width: 16px; box-shadow: var(--c-glow-pink); }
.px3 { background: var(--c-red); box-shadow: var(--c-glow-red); }

/* ===== 页面级 Hero (非首页) ===== */
.page-hero {
  position: relative; padding: 60px 24px 40px;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.page-hero-bg-num {
  position: absolute; right: 5%; top: 50%; transform: translateY(-50%);
  font-size: clamp(60px, 12vw, 140px); font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px rgba(255,0,110,0.1);
  font-family: var(--font-mono); pointer-events: none; user-select: none;
  white-space: nowrap;
}
.page-hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.page-hero-eyebrow {
  display: inline-block; font-size: 0.78rem; font-family: var(--font-mono);
  color: var(--c-pink); letter-spacing: 0.1em; margin-bottom: 12px;
  border-left: 3px solid var(--c-pink); padding-left: 10px;
}
.page-hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 700;
  color: var(--c-text);
  text-shadow: 0 0 20px rgba(255,0,0,0.2);
  margin-bottom: 12px;
}
.page-hero-desc { color: var(--c-text-muted); max-width: 600px; }

/* ===== 主布局 ===== */
.page-main { max-width: 1200px; margin: 0 auto; padding: 40px 24px 60px; }

.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}
.content-section--wide { grid-template-columns: 200px 1fr; }
.content-section--narrow { grid-template-columns: 200px 1fr; }
.content-section--article { grid-template-columns: 200px 1fr; }

.content-aside { grid-column: 1; }
.content-figure { grid-column: 2; min-width: 0; }

/* ===== 侧边栏 ===== */
.aside-block {
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  padding: 16px 18px;
}
.aside-block--mt { margin-top: 16px; }
.aside-eyebrow {
  display: block;
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--c-pink); letter-spacing: 0.1em;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--c-border); padding-bottom: 6px;
}
.aside-links li { border-bottom: 1px solid rgba(255,0,110,0.08); }
.aside-links li:last-child { border-bottom: none; }
.aside-links a {
  display: block; padding: 8px 0;
  color: var(--c-text-muted); font-size: 0.9rem;
  min-height: 40px; line-height: 24px;
  transition: color var(--transition), padding-left var(--transition);
}
.aside-links a:hover, .aside-active { color: var(--c-pink) !important; padding-left: 6px; }
.aside-parent-link {
  display: block; color: var(--c-pink); font-size: 0.9rem;
  padding: 6px 0; min-height: 40px; line-height: 28px;
}
.aside-info-text { font-size: 0.82rem; color: var(--c-text-muted); line-height: 1.6; }

/* ===== 正文 ===== */
.content-body { min-width: 0; }
.page-h1, .article-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700; line-height: 1.25;
  color: var(--c-text);
  text-shadow: 0 0 20px rgba(255,0,0,0.15);
  margin-bottom: 16px;
}
.article-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem; font-family: var(--font-mono);
  color: var(--c-text-muted); margin-bottom: 24px;
  border-bottom: 1px solid var(--c-border); padding-bottom: 12px;
}
.article-date { color: var(--c-pink); }
.article-hero-wrap { margin-bottom: 24px; border: 1px solid var(--c-border); }
.article-hero-img { width: 100%; height: auto; display: block; }

/* ===== Prose ===== */
.prose { font-size: 1rem; line-height: 1.8; color: var(--c-text); }
.prose h2 { font-size: 1.35rem; font-weight: 600; color: var(--c-text); margin: 32px 0 12px; border-left: 3px solid var(--c-red); padding-left: 12px; }
.prose h3 { font-size: 1.1rem; font-weight: 600; color: var(--c-text); margin: 24px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 12px 0 16px 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--c-pink); border-bottom: 1px solid rgba(255,0,110,0.3); }
.prose a:hover { color: var(--c-red); }
.prose strong { color: var(--c-red); }
.prose code { font-family: var(--font-mono); background: rgba(255,0,110,0.1); color: var(--c-pink); padding: 2px 6px; font-size: 0.88em; }
.prose blockquote { border-left: 3px solid var(--c-pink); padding: 8px 16px; background: rgba(255,0,110,0.05); margin: 16px 0; color: var(--c-text-muted); }

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: 0.82rem; color: var(--c-text-muted);
  margin-bottom: 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-pink); }

/* ===== 眉题标签 ===== */
.eyebrow-label {
  display: inline-block;
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--c-pink); letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.section-h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--c-text);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--c-border); padding-bottom: 8px;
}

/* ===== 卡片式表格 ===== */
.cat-table, .child-table {
  width: 100%; border: 1px solid var(--c-border);
}
.cat-table tr, .child-table tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--transition);
}
.cat-table tr:last-child, .child-table tr:last-child { border-bottom: none; }
.cat-table tr:hover, .child-table tr:hover { background: rgba(255,0,110,0.05); }
.cat-table td, .child-table td {
  padding: 14px 16px; vertical-align: middle; font-size: 0.92rem;
}
.tbl-icon { color: var(--c-pink); font-size: 1.1rem; width: 36px; }
.tbl-num { font-family: var(--font-mono); color: var(--c-pink); font-size: 0.8rem; width: 40px; }
.tbl-title { width: 35%; }
.tbl-link { color: var(--c-text); font-weight: 600; }
.tbl-link:hover { color: var(--c-pink); }
.tbl-desc { color: var(--c-text-muted); font-size: 0.88rem; }
.tbl-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--c-text-muted); white-space: nowrap; width: 100px; }

.reveal-row { opacity: 0; transform: translateY(12px); animation: row-in 0.4s ease forwards; animation-delay: calc(var(--row-i, 0) * 0.06s); }
@keyframes row-in { to { opacity: 1; transform: none; } }

/* ===== 首页文章卡片 ===== */
.home-section-block { margin-top: 40px; }
.home-articles { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--c-border); }
.home-article-card { border-bottom: 2px solid transparent; transition: border-color var(--transition), background var(--transition); }
.home-article-card:hover { border-bottom-color: var(--c-red); background: rgba(255,0,0,0.04); }
.home-article-link {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 16px; color: var(--c-text); font-size: 0.95rem;
  min-height: 44px;
}
.home-article-link:hover { color: var(--c-text); }
.card-accent { color: var(--c-red); font-family: var(--font-mono); font-size: 0.8rem; flex-shrink: 0; }
.card-title { flex: 1; font-weight: 500; }
.card-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--c-text-muted); white-space: nowrap; }

/* ===== 标签 ===== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-block; padding: 6px 14px; min-height: 40px; line-height: 28px;
  border: 1px solid var(--c-border); border-radius: var(--radius-pill);
  font-size: 0.82rem; color: var(--c-text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.tag-pill:hover { border-color: var(--c-pink); color: var(--c-pink); }

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: #0f0f1a;
}
.footer-cta {
  background: linear-gradient(90deg, rgba(255,0,0,0.12) 0%, rgba(255,0,110,0.12) 100%);
  border-bottom: 1px solid var(--c-border);
  padding: 40px 24px;
}
.footer-cta-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-cta-text { font-size: 1.15rem; font-weight: 600; color: var(--c-text); }
.footer-cols {
  max-width: 1200px; margin: 0 auto; padding: 32px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.footer-brand-name { display: block; font-size: 1.1rem; font-weight: 700; color: var(--c-red); text-shadow: var(--c-glow-red); font-family: var(--font-mono); margin-bottom: 10px; }
.footer-brand-desc { font-size: 0.88rem; color: var(--c-text-muted); line-height: 1.7; }
.footer-nav ul { display: flex; flex-direction: column; gap: 4px; }
.footer-nav a { color: var(--c-text-muted); font-size: 0.9rem; padding: 6px 0; display: block; min-height: 40px; line-height: 28px; }
.footer-nav a:hover { color: var(--c-pink); }
.footer-bottom {
  border-top: 1px solid var(--c-border); padding: 20px 24px;
  text-align: center;
}
.footer-copy { font-size: 0.8rem; color: var(--c-text-muted); font-family: var(--font-mono); }

/* ===== 隐私/关于 ===== */
.privacy-updated { font-size: 0.85rem; color: var(--c-text-muted); font-family: var(--font-mono); margin-bottom: 24px; }

/* ===== 栏目 ===== */
.cat-prose { margin-bottom: 32px; }
.child-list-block { margin-top: 8px; }

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

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section,
  .content-section--wide,
  .content-section--narrow,
  .content-section--article {
    grid-template-columns: 1fr;
  }
  .content-aside { grid-column: 1; }
  .content-figure { grid-column: 1; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .tbl-desc { display: none; }
}

@media (max-width: 600px) {
  .hero { min-height: 70vh; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .page-main { padding: 24px 16px 40px; }
  .footer-cta-inner { flex-direction: column; text-align: center; }
  .nav-menu { padding: 12px 16px; }
  .tbl-date { display: none; }
}

/* ===== Hover micro-interactions ===== */
.btn-neon { will-change: box-shadow; }
.nav-pill { will-change: box-shadow, color; }
.home-article-card { will-change: background; }
