@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-bg: #0d0d0d;
  --c-surface: #111118;
  --c-surface2: #16161f;
  --c-purple: #8000ff;
  --c-magenta: #ff00ff;
  --c-purple-dim: rgba(128,0,255,.18);
  --c-magenta-dim: rgba(255,0,255,.12);
  --c-text: #e8e8f0;
  --c-text-muted: #7a7a9a;
  --c-border: rgba(128,0,255,.3);
  --c-border-bright: rgba(255,0,255,.5);
  --glow-purple: 0 0 8px #8000ff, 0 0 20px rgba(128,0,255,.5);
  --glow-magenta: 0 0 8px #ff00ff, 0 0 20px rgba(255,0,255,.5);
  --font-sans: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --nav-w: 260px;
  --radius: 10px;
  --transition: .2s ease;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--c-magenta); text-decoration: none; transition: color var(--transition), text-shadow var(--transition); }
a:hover { color: #fff; text-shadow: var(--glow-magenta); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ── 扫描线叠层 ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,.08) 2px,
    rgba(0,0,0,.08) 4px
  );
  mix-blend-mode: overlay;
}

/* ── 侧边导航 ── */
.site-nav-aside {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.brand-bar {
  padding: 1rem 1.2rem .8rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.brand-announce {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--c-purple);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .6rem;
  animation: terminal-blink 2s step-end infinite;
}

@keyframes terminal-blink {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}

.brand-logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: var(--glow-purple);
  letter-spacing: .04em;
}
.brand-logo:hover { color: var(--c-magenta); text-shadow: var(--glow-magenta); }

.brand-sub {
  font-size: .65rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}

.main-nav { padding: .8rem 0; flex: 1; }
.main-nav ul { display: flex; flex-direction: column; }
.main-nav li { border-bottom: 1px solid rgba(128,0,255,.1); }
.main-nav li a {
  display: block;
  padding: .7rem 1.2rem;
  font-size: .85rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.main-nav li a:hover {
  color: var(--c-magenta);
  background: var(--c-magenta-dim);
  border-left-color: var(--c-magenta);
  text-shadow: none;
  padding-left: 1.5rem;
}

/* ── 主内容区 ── */
.site-main {
  margin-left: var(--nav-w);
  min-height: 100vh;
  position: relative;
}

/* ── wrap / 正文容器结构 ── */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ── Hero（首页） ── */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 80% 50%, rgba(128,0,255,.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

.hero-text { flex: 1; z-index: 1; }

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--c-purple);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .6rem;
}

.hero-h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: var(--glow-purple);
}

/* Glitch */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
.glitch::before {
  color: var(--c-magenta);
  animation: glitch-top 4s infinite linear;
  text-shadow: none;
}
.glitch::after {
  color: var(--c-purple);
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  animation: glitch-bot 4s infinite linear;
  text-shadow: none;
}

@keyframes glitch-top {
  0%,90%,100% { transform: translate(0); opacity: 0; }
  91% { transform: translate(-3px, -1px); opacity: .8; }
  93% { transform: translate(3px, 1px); opacity: .8; }
  95% { transform: translate(-2px, 0); opacity: .8; }
  97% { transform: translate(0); opacity: 0; }
}
@keyframes glitch-bot {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  89% { transform: translate(3px, 1px); opacity: .7; }
  92% { transform: translate(-3px, -1px); opacity: .7; }
  94% { transform: translate(2px, 0); opacity: 0; }
}

.hero-desc {
  font-size: 1rem;
  color: var(--c-text-muted);
  margin-bottom: 1.8rem;
  max-width: 480px;
}

.hero-deco {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}
.hero-bg-text {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: rgba(128,0,255,.08);
  letter-spacing: .2em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-20deg);
  white-space: nowrap;
  font-size: 1.4rem;
  pointer-events: none;
}
.hud-ring {
  width: 140px;
  height: 140px;
  border: 2px solid var(--c-purple);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  box-shadow: var(--glow-purple), inset 0 0 20px rgba(128,0,255,.2);
  animation: hud-spin 8s linear infinite;
}
.hud-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,0,255,.4);
  border-radius: 50%;
  animation: hud-spin 5s linear infinite reverse;
}
.hud-ring::after {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 10px; height: 10px;
  background: var(--c-magenta);
  border-radius: 50%;
  box-shadow: var(--glow-magenta);
  transform: translateX(-50%);
}

@keyframes hud-spin {
  to { transform: translate(-50%,-50%) rotate(360deg); }
}

/* ── 按钮 ── */
.btn-primary {
  display: inline-block;
  padding: .7rem 1.6rem;
  background: var(--c-purple);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .08em;
  border: 1px solid var(--c-purple);
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  transition: all var(--transition);
  min-height: 44px;
}
.btn-primary:hover {
  background: var(--c-magenta);
  border-color: var(--c-magenta);
  box-shadow: var(--glow-magenta);
  color: #fff;
  text-shadow: none;
}

.btn-outline {
  display: inline-block;
  padding: .6rem 1.2rem;
  background: transparent;
  color: var(--c-purple);
  font-family: var(--font-mono);
  font-size: .8rem;
  border: 1px solid var(--c-purple);
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
  transition: all var(--transition);
  min-height: 40px;
  align-items: center;
}
.btn-outline:hover {
  background: var(--c-purple-dim);
  color: var(--c-magenta);
  border-color: var(--c-magenta);
  box-shadow: var(--glow-magenta);
  text-shadow: none;
}

/* ── 节标题 ── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.2rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--c-border);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--c-magenta);
  box-shadow: var(--glow-magenta);
}

.section-title-sm {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: .8rem;
  font-family: var(--font-mono);
}

/* ── 内容区块 ── */
.content-section,
.cards-section {
  padding: 2rem 0;
  border-top: 1px solid rgba(128,0,255,.1);
}

/* ── 卡片网格 ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.2rem;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  border-bottom: 3px solid var(--c-purple);
  color: var(--c-text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-magenta), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.card-link:hover {
  border-color: var(--c-magenta);
  border-bottom-color: var(--c-magenta);
  box-shadow: 0 0 20px rgba(255,0,255,.15);
  transform: translateY(-2px);
  color: var(--c-text);
  text-shadow: none;
}
.card-link:hover::before { opacity: 1; }

.card-link strong {
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}
.card-desc {
  font-size: .8rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.card-date {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--c-purple);
}

/* ── 文章页布局 ── */
.page-article .site-main,
.page-about .site-main,
.page-privacy .site-main {
  margin-right: 300px;
}

.sidebar-aside {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  overflow-y: auto;
  z-index: 50;
  padding: 1.5rem 1.2rem;
}

.sidebar-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: .8rem;
  font-family: var(--font-mono);
}

.sidebar-dl { margin-bottom: 1.5rem; }
.sidebar-dl dt { display: none; }
.sidebar-dl dd {
  border-bottom: 1px solid rgba(128,0,255,.1);
}
.sidebar-dl dd a {
  display: block;
  padding: .55rem 0;
  font-size: .8rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition), padding-left var(--transition);
}
.sidebar-dl dd a:hover {
  color: var(--c-magenta);
  padding-left: .4rem;
  text-shadow: none;
}

.sidebar-cta { margin-top: 1rem; }

/* ── 文章正文 ── */
.article-section,
.about-section,
.privacy-section,
.default-section {
  padding: 2rem 0;
}

.article-header,
.about-header,
.privacy-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.breadcrumb-link {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--c-text-muted);
  display: inline-block;
  margin-bottom: .8rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  width: fit-content;
}
.breadcrumb-link:hover { color: var(--c-purple); text-shadow: none; }

.article-h1,
.about-h1,
.privacy-h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .8rem;
  text-shadow: 0 0 30px rgba(128,0,255,.3);
}

.about-lead {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-top: .5rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .6rem;
}

.article-date,
.article-mod {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--c-purple);
}

.privacy-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--c-text-muted);
  margin-top: .5rem;
}

/* ── prose 正文排版 ── */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}
.prose h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 2rem 0 .8rem;
  padding-left: .8rem;
  border-left: 3px solid var(--c-magenta);
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 1.5rem 0 .6rem;
}
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol {
  margin: .8rem 0 1rem 1.2rem;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--c-magenta); border-bottom: 1px solid rgba(255,0,255,.3); }
.prose a:hover { border-bottom-color: var(--c-magenta); }
.prose strong { color: #fff; font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: rgba(128,0,255,.15);
  border: 1px solid rgba(128,0,255,.3);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--c-magenta);
}
.prose pre {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  padding: 1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.prose blockquote {
  border-left: 3px solid var(--c-purple);
  padding-left: 1rem;
  color: var(--c-text-muted);
  margin: 1rem 0;
  font-style: italic;
}

/* ── 文章相关链接 ── */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

.article-related-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .8rem;
}

.related-link {
  display: flex;
  align-items: center;
  padding: .7rem .9rem;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  border-bottom: 3px solid var(--c-purple);
  color: var(--c-text);
  font-size: .85rem;
  transition: all var(--transition);
}
.related-link strong { color: var(--c-text); font-weight: 500; }
.related-link:hover {
  border-bottom-color: var(--c-magenta);
  background: var(--c-magenta-dim);
  color: #fff;
  text-shadow: none;
}
.related-link:hover strong { color: #fff; }

/* ── about 文章链接 ── */
.about-links-block {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

.about-article-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .8rem;
  margin-top: .8rem;
}

/* ── privacy footer links ── */
.privacy-footer-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── default nav links ── */
.default-nav-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  margin-left: var(--nav-w);
  padding: 0;
}

.footer-brand-row {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid rgba(128,0,255,.1);
}

.footer-brand-big {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: rgba(128,0,255,.15);
  letter-spacing: .08em;
  display: block;
  line-height: 1;
  text-shadow: none;
  user-select: none;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 2rem;
}

.footer-dl { }
.footer-dl .dl-head {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--c-purple);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: block;
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--c-border);
}
.footer-dl dd {
  font-size: .82rem;
  color: var(--c-text-muted);
  margin-bottom: .35rem;
  line-height: 1.5;
}
.footer-dl dd a {
  color: var(--c-text-muted);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}
.footer-dl dd a:hover {
  color: var(--c-magenta);
  text-shadow: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(128,0,255,.1);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--c-text-muted);
}
.footer-bottom a {
  color: var(--c-text-muted);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 .2rem;
}
.footer-bottom a:hover { color: var(--c-magenta); text-shadow: none; }

/* ── 侧栏 small eyebrow ── */
.sidebar-aside .eyebrow {
  font-size: .62rem;
  margin-bottom: .4rem;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── 移动端响应 ── */
@media (max-width: 900px) {
  .sidebar-aside { display: none; }
  .page-article .site-main,
  .page-about .site-main,
  .page-privacy .site-main {
    margin-right: 0;
  }
}

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

  .site-nav-aside {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
  }

  .main-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .2rem;
    padding: .4rem;
  }
  .main-nav li {
    border-bottom: none;
    flex: 0 0 auto;
  }
  .main-nav li a {
    font-size: .75rem;
    padding: .5rem .8rem;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    min-height: 40px;
    border-left: 3px solid transparent;
  }
  .main-nav li a:hover {
    padding-left: .8rem;
  }

  .site-main { margin-left: 0; }
  .site-footer { margin-left: 0; }

  .wrap { padding: 1.5rem 1rem 3rem; }

  .hero-section { min-height: 60vh; padding: 2rem 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-deco { display: none; }

  .footer-cols {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .footer-brand-row { padding: 1.2rem 1rem .8rem; }
  .footer-bottom { padding: .8rem 1rem; flex-direction: column; align-items: flex-start; gap: .3rem; }

  .card-grid { grid-template-columns: 1fr; }

  .about-article-links { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.5rem; }
  .article-h1, .about-h1, .privacy-h1 { font-size: 1.3rem; }
  .main-nav li a { font-size: .7rem; padding: .45rem .6rem; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
