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

/* ── 变量与重置 ── */
:root {
  --c-primary: #8000ff;
  --c-accent: #ff00ff;
  --c-bg: #0d0d0d;
  --c-surface: #111118;
  --c-surface2: #18181f;
  --c-border: rgba(128,0,255,0.3);
  --c-border-bright: rgba(255,0,255,0.5);
  --c-text: #e8e8f0;
  --c-text-dim: #9090aa;
  --c-text-bright: #ffffff;
  --c-neon-glow: 0 0 8px #8000ff, 0 0 20px rgba(128,0,255,0.4);
  --c-accent-glow: 0 0 8px #ff00ff, 0 0 20px rgba(255,0,255,0.4);
  --nav-h: 56px;
  --sticky-h: 48px;
  --max-w: 1200px;
  --max-prose: 780px;
  --radius: 0;
  --font-main: 'Be Vietnam Pro', 'Noto Sans', system-ui, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 扫描线背景 ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
}

/* ── 导航 details/summary ── */
.nav-wrap {
  position: relative;
  z-index: 200;
}

.nav-wrap[open] .nav-brand-bar .nav-toggle-label::after { content: '收起'; }
.nav-brand-bar .nav-toggle-label::after { content: '展开'; }

.nav-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--nav-h);
  background: rgba(13,13,13,0.95);
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-brand-bar::-webkit-details-marker { display: none; }

.brand-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: var(--c-accent-glow);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-toggle-label {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.nav-menu {
  list-style: none;
  background: rgba(13,13,13,0.98);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 8px 16px;
}

.nav-menu li a {
  display: block;
  padding: 10px 16px;
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), text-shadow var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] {
  color: var(--c-accent);
  border-color: var(--c-border);
  text-shadow: var(--c-accent-glow);
}

/* ── 粘性锚点条 ── */
.nav-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(13,13,13,0.97);
  border-bottom: 1px solid var(--c-border-bright);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sticky-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--sticky-h);
}

.sticky-brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-primary);
  text-decoration: none;
  text-shadow: var(--c-neon-glow);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.sticky-pills {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-pills::-webkit-scrollbar { display: none; }

.pill-btn {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition);
  min-height: 32px;
  letter-spacing: 0.03em;
}

.pill-btn:hover,
.pill-btn--active {
  border-color: var(--c-primary);
  color: var(--c-primary);
  text-shadow: var(--c-neon-glow);
  background: rgba(128,0,255,0.08);
}

.btn-cta-main {
  display: flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--c-primary);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--c-primary);
  box-shadow: var(--c-neon-glow);
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
  letter-spacing: 0.05em;
}

.btn-cta-main:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  box-shadow: var(--c-accent-glow);
}

/* ── 霓虹按钮 ── */
.btn-neon {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border: 1px solid var(--c-primary);
  color: var(--c-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(128,0,255,0.07);
  box-shadow: inset 0 0 8px rgba(128,0,255,0.1), var(--c-neon-glow);
  transition: all var(--transition);
  cursor: pointer;
  letter-spacing: 0.04em;
  min-height: 44px;
}

.btn-neon:hover {
  background: rgba(128,0,255,0.18);
  box-shadow: inset 0 0 16px rgba(128,0,255,0.2), 0 0 16px #8000ff, 0 0 40px rgba(128,0,255,0.3);
}

.btn-neon--alt {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(255,0,255,0.07);
  box-shadow: inset 0 0 8px rgba(255,0,255,0.1), var(--c-accent-glow);
}

.btn-neon--alt:hover {
  background: rgba(255,0,255,0.18);
  box-shadow: inset 0 0 16px rgba(255,0,255,0.2), 0 0 16px #ff00ff, 0 0 40px rgba(255,0,255,0.3);
}

/* ── Glitch 文字 ── */
.glitch-text {
  position: relative;
  display: inline-block;
}

@keyframes glitch-a {
  0%, 100% { clip-path: inset(0 0 95% 0); transform: skewX(0deg); }
  20% { clip-path: inset(30% 0 50% 0); transform: skewX(-2deg) translateX(-4px); }
  40% { clip-path: inset(60% 0 20% 0); transform: skewX(2deg) translateX(4px); }
  60% { clip-path: inset(10% 0 80% 0); transform: skewX(-1deg); }
  80% { clip-path: inset(80% 0 5% 0); transform: skewX(1deg) translateX(-2px); }
}

@keyframes glitch-b {
  0%, 100% { clip-path: inset(95% 0 0 0); transform: skewX(0deg); }
  20% { clip-path: inset(50% 0 20% 0); transform: skewX(2deg) translateX(4px); }
  40% { clip-path: inset(20% 0 60% 0); transform: skewX(-2deg) translateX(-4px); }
  60% { clip-path: inset(80% 0 5% 0); transform: skewX(1deg); }
  80% { clip-path: inset(5% 0 80% 0); transform: skewX(-1deg) translateX(2px); }
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch-text::before {
  color: var(--c-primary);
  animation: glitch-a 4s infinite steps(1);
  opacity: 0.7;
}

.glitch-text::after {
  color: var(--c-accent);
  animation: glitch-b 4s infinite steps(1);
  opacity: 0.7;
}

/* ── 玻璃拟态卡片 ── */
.glass-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.glass-card:hover {
  border-color: var(--c-primary);
  background: rgba(128,0,255,0.05);
  box-shadow: 0 0 20px rgba(128,0,255,0.15);
}

/* ── 主内容区 ── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px 60px;
}

.main-content--article {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

.main-content--article > article {
  min-width: 0;
}

/* ── Hero ── */
.hero-section {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(128,0,255,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,0,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: var(--c-neon-glow);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-text-bright);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--c-text-dim);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-scan-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-accent), transparent);
}

/* ── section 通用 ── */
.content-section,
.channels-section,
.latest-section,
.children-section,
.related-section,
.about-links-section,
.privacy-footer-links,
.topic-hero,
.page-header-section,
.article-header-section,
.article-body-section {
  padding: 48px 0;
  border-bottom: 1px solid rgba(128,0,255,0.1);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: var(--c-accent-glow);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-text-bright);
  margin-bottom: 28px;
  line-height: 1.2;
}

/* ── 正文 prose ── */
.prose-body {
  max-width: var(--max-prose);
  line-height: 1.85;
  color: var(--c-text);
}

.prose-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-text-bright);
  margin: 2em 0 0.8em;
  border-left: 3px solid var(--c-primary);
  padding-left: 14px;
}

.prose-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 1.5em 0 0.6em;
}

.prose-body p { margin-bottom: 1.2em; }

.prose-body a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,0,255,0.4);
  transition: text-shadow var(--transition);
}

.prose-body a:hover { text-shadow: var(--c-accent-glow); }

.prose-body ul, .prose-body ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.prose-body li { margin-bottom: 0.4em; }

.prose-body strong { color: var(--c-text-bright); font-weight: 700; }

.prose-body code {
  font-family: var(--font-mono);
  background: rgba(128,0,255,0.12);
  border: 1px solid var(--c-border);
  padding: 2px 6px;
  font-size: 0.88em;
  color: var(--c-accent);
}

.prose-body blockquote {
  border-left: 3px solid var(--c-accent);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: rgba(255,0,255,0.04);
  color: var(--c-text-dim);
  font-style: italic;
}

.article-prose { max-width: 100%; }

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

.card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--c-primary);
  letter-spacing: 0.2em;
  text-shadow: var(--c-neon-glow);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-title a {
  color: var(--c-text-bright);
  text-decoration: none;
  transition: color var(--transition);
}

.card-title a:hover { color: var(--c-accent); }

.card-desc {
  font-size: 0.875rem;
  color: var(--c-text-dim);
  flex: 1;
  line-height: 1.6;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
  letter-spacing: 0.05em;
}

.card-link {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 8px 16px;
  min-height: 36px;
}

/* ── 最新列表 ── */
.latest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.latest-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px 20px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid rgba(128,0,255,0.1);
  transition: background var(--transition);
}

.latest-item:hover { background: rgba(128,0,255,0.03); }

.art-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-primary);
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 3px;
}

.art-date--mod {
  color: var(--c-text-dim);
  margin-left: 12px;
}

.latest-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-text-bright);
  text-decoration: none;
  grid-column: 2;
  grid-row: 1;
  transition: color var(--transition);
  line-height: 1.4;
}

.latest-title:hover { color: var(--c-accent); }

.latest-desc {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  grid-column: 2;
  grid-row: 2;
  line-height: 1.6;
}

/* ── Topic 页 hero ── */
.topic-hero {
  padding: 48px 0 36px;
}

.topic-hero-inner { max-width: 860px; }

.topic-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-text-bright);
  line-height: 1.15;
  margin: 12px 0 16px;
}

.topic-desc {
  font-size: 1rem;
  color: var(--c-text-dim);
  max-width: 620px;
  line-height: 1.75;
}

.topic-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-primary);
  margin-top: 12px;
}

/* ── 子页列表 ── */
.child-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.child-item {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.child-title {
  font-size: 1rem;
  font-weight: 700;
}

.child-title a {
  color: var(--c-text-bright);
  text-decoration: none;
  transition: color var(--transition);
}

.child-title a:hover { color: var(--c-accent); }

.child-desc {
  font-size: 0.875rem;
  color: var(--c-text-dim);
  line-height: 1.65;
}

.child-readmore {
  font-size: 0.8rem;
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
  transition: text-shadow var(--transition);
  align-self: flex-start;
  min-height: 24px;
  display: flex;
  align-items: center;
}

.child-readmore:hover { text-shadow: var(--c-neon-glow); }

/* ── 面包屑 ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--c-text-dim);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--c-text-dim);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--c-primary); }

.bc-sep { color: var(--c-primary); }

/* ── 文章页 ── */
.page-header-section,
.article-header-section {
  padding: 36px 0 28px;
}

.page-title,
.article-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--c-text-bright);
  line-height: 1.2;
  margin: 12px 0 12px;
}

.page-desc {
  font-size: 1rem;
  color: var(--c-text-dim);
  line-height: 1.75;
  max-width: 620px;
}

.article-meta-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.article-hero-wrap { margin-top: 20px; }

.article-hero-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--c-border);
}

/* ── 侧边栏 ── */
.article-sidebar {
  position: sticky;
  top: calc(var(--sticky-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-block {
  padding: 20px;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--c-accent);
  letter-spacing: 0.2em;
  margin-bottom: 14px;
  text-shadow: var(--c-accent-glow);
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-link {
  display: block;
  padding: 8px 10px;
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.sidebar-nav-link:hover,
.sidebar-nav-link--active {
  color: var(--c-primary);
  border-left-color: var(--c-primary);
  background: rgba(128,0,255,0.06);
}

.sidebar-cta {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0.82rem;
  padding: 10px 14px;
}

/* ── 相关文章 ── */
.related-title { font-size: 1.1rem; margin-bottom: 16px; }

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rel-link {
  display: block;
  padding: 10px 14px;
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  border: 1px solid transparent;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.rel-link:hover {
  color: var(--c-accent);
  border-color: var(--c-border);
  background: rgba(255,0,255,0.04);
}

/* ── About 页导航网格 ── */
.about-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.about-nav-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.about-nav-card:hover {
  border-color: var(--c-accent);
  box-shadow: 0 0 16px rgba(255,0,255,0.12);
}

.about-nav-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text-bright);
}

.about-nav-desc {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  line-height: 1.55;
}

/* ── Privacy 页 ── */
.priv-link-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border-bright);
  margin-top: 40px;
}

.footer-form-block {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--c-border);
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: var(--c-accent-glow);
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  max-width: 500px;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  text-decoration: none;
  transition: color var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.footer-links a:hover { color: var(--c-primary); }

/* ── Scroll reveal ── */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: reveal-up 0.5s ease both;
}

/* ── 响应式断点 ── */
@media (max-width: 900px) {
  .main-content--article {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .sticky-pills { display: none; }

  .hero-section { min-height: 60vh; padding: 48px 0 40px; }

  .hero-title { font-size: 2.2rem; }

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

  .latest-item {
    grid-template-columns: 1fr;
  }

  .latest-title { grid-column: 1; grid-row: 2; }
  .art-date { grid-column: 1; grid-row: 1; }
  .latest-desc { grid-column: 1; grid-row: 3; }

  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }

  .nav-menu { flex-direction: column; }

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

@media (max-width: 420px) {
  body { font-size: 16px; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn-neon { width: 100%; justify-content: center; }

  .priv-link-row { flex-direction: column; }
  .priv-link-row .btn-neon { width: 100%; justify-content: center; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
