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

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-primary: #8000ff;
  --c-accent: #ff00ff;
  --c-bg: #0d0d0d;
  --c-bg2: #111118;
  --c-bg3: #1a1a2e;
  --c-text: #e0e0e0;
  --c-text-dim: #888;
  --c-border: rgba(128, 0, 255, 0.35);
  --c-glow-p: rgba(128, 0, 255, 0.6);
  --c-glow-a: rgba(255, 0, 255, 0.6);
  --font-head: 'Syncopate', 'Space Mono', monospace;
  --font-body: 'Space Mono', monospace;
  --nav-h: 64px;
  --radius: 4px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body.cyberpunk-body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  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 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* ===== 页面包裹 ===== */
.page-wrap {
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 13, 13, 0.96);
  border-top: 1px solid var(--c-border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 24px rgba(128, 0, 255, 0.2);
}

.bottom-nav ol {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1200px;
}

.bottom-nav ol li {
  flex-shrink: 0;
}

.bottom-nav ol li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 12px;
  background: rgba(128, 0, 255, 0.12);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  color: var(--c-text);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
  white-space: nowrap;
}

.bottom-nav ol li a:hover,
.bottom-nav ol li a:focus {
  background: rgba(128, 0, 255, 0.35);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 0 12px var(--c-glow-p);
  outline: none;
}

/* ===== Hero 通用 ===== */
.hero-section,
.topic-hero {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,13,13,0.92) 0%, rgba(13,13,13,0.55) 60%, rgba(13,13,13,0.82) 100%);
}

.hero-slash {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(170deg, transparent 45%, var(--c-primary) 45%, var(--c-accent) 50%, transparent 50%);
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: right;
  padding: 48px 40px 80px 20px;
  max-width: 700px;
}

.hero-eyebrow {
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 0 8px var(--c-glow-a);
}

.hero-content h1 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 20px var(--c-glow-p), 0 0 40px rgba(128,0,255,0.4);
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero-desc {
  font-size: 15px;
  color: var(--c-text-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== 药丸按钮 ===== */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--c-primary);
  background: rgba(128, 0, 255, 0.12);
  color: #e0e0e0;
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
}

.pill-btn:hover,
.pill-btn:focus {
  background: rgba(128, 0, 255, 0.4);
  border-color: var(--c-accent);
  color: #fff;
  box-shadow: 0 0 16px var(--c-glow-a);
  outline: none;
}

.pill-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-accent);
  box-shadow: 0 0 12px var(--c-glow-p);
}

.pill-primary:hover {
  background: var(--c-accent);
  border-color: var(--c-primary);
  box-shadow: 0 0 20px var(--c-glow-a);
}

.pill-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 10px;
}

/* ===== 内容网格 ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 正文排版 ===== */
.prose {
  min-width: 0;
}

.prose h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 8px var(--c-glow-p);
  margin: 2em 0 0.5em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}

.prose h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  margin: 1.5em 0 0.5em;
  text-shadow: 0 0 6px var(--c-glow-a);
}

.prose p {
  margin-bottom: 1em;
  line-height: 1.75;
}

.prose a {
  color: var(--c-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(128,0,255,0.3);
  transition: color var(--transition), border-color var(--transition);
}

.prose a:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
  text-shadow: 0 0 6px var(--c-glow-a);
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

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

.prose strong {
  color: #fff;
  font-weight: 700;
}

/* ===== 节标题 ===== */
.section-heading {
  margin: 40px 0 20px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.subtitle, p.subtitle, p.subhead, p.desc, p.lead {
  color: var(--c-text-dim);
  font-size: 13px;
  letter-spacing: 0.05em;
  margin-top: 6px;
  margin-bottom: 0;
}

/* ===== 页面各区 padding ===== */
.home-content-section,
.topic-body,
.article-body,
.about-body,
.privacy-body,
.tag-body {
  padding: 40px 0;
}

/* ===== 文章头 ===== */
.article-header,
.about-header,
.privacy-header,
.tag-header {
  padding: 60px 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.article-title-block h1 {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 16px var(--c-glow-p);
  line-height: 1.3;
  margin-bottom: 8px;
}

.about-title-block h1,
.privacy-header h1,
.tag-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 16px var(--c-glow-p);
  margin-bottom: 8px;
}

/* ===== 内页 hero ===== */
.inner-hero {
  padding: 60px 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.inner-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: #fff;
  text-shadow: 0 0 16px var(--c-glow-p);
  margin-bottom: 12px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  margin-bottom: 16px;
}

.breadcrumb ol {
  display: flex;
  gap: 8px;
  list-style: none;
  font-size: 12px;
  color: var(--c-text-dim);
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb ol li + li::before {
  content: '›';
  margin-right: 8px;
  color: var(--c-primary);
}

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

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

/* ===== 元数据日期 ===== */
.meta-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text-dim);
  margin-top: 12px;
  flex-wrap: wrap;
}

.label-pub,
.label-mod {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(128,0,255,0.18);
  color: var(--c-primary);
  border: 1px solid var(--c-border);
}

.label-mod {
  background: rgba(255,0,255,0.12);
  color: var(--c-accent);
  border-color: rgba(255,0,255,0.3);
}

/* ===== 玻璃拟态卡片 ===== */
.glass-card {
  background: rgba(26, 26, 46, 0.55);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(128,0,255,0.25), 0 0 0 1px var(--c-primary);
  border-color: var(--c-primary);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-body h3 a {
  color: #fff;
  text-decoration: none;
  transition: color var(--transition);
}

.card-body h3 a:hover {
  color: var(--c-accent);
  text-shadow: 0 0 8px var(--c-glow-a);
}

.card-body p {
  font-size: 13px;
  color: var(--c-text-dim);
  line-height: 1.6;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.card-footer time {
  font-size: 11px;
  color: var(--c-text-dim);
}

/* ===== 专题卡片网格 ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.topic-card .card-body h3 {
  font-size: 14px;
}

/* ===== 文章卡片列表 ===== */
.article-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

/* ===== Stagger 动画 ===== */
@media (prefers-reduced-motion: no-preference) {
  .stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerIn 0.5s ease forwards;
  }

  .stagger-item:nth-child(1) { animation-delay: 0.05s; }
  .stagger-item:nth-child(2) { animation-delay: 0.12s; }
  .stagger-item:nth-child(3) { animation-delay: 0.19s; }
  .stagger-item:nth-child(4) { animation-delay: 0.26s; }
  .stagger-item:nth-child(5) { animation-delay: 0.33s; }
  .stagger-item:nth-child(6) { animation-delay: 0.40s; }
  .stagger-item:nth-child(7) { animation-delay: 0.47s; }
  .stagger-item:nth-child(8) { animation-delay: 0.54s; }
  .stagger-item:nth-child(9) { animation-delay: 0.61s; }

  @keyframes staggerIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .glass-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .pill-btn {
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ===== 表格 ===== */
.article-table-wrap,
.tag-table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

tbody tr {
  border-bottom: 1px solid rgba(128,0,255,0.15);
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(128,0,255,0.08);
}

tbody tr:last-child {
  border-bottom: none;
}

td {
  padding: 12px 16px;
  vertical-align: top;
  line-height: 1.5;
}

td a {
  color: var(--c-primary);
  text-decoration: none;
}

td a:hover {
  color: var(--c-accent);
  text-shadow: 0 0 6px var(--c-glow-a);
}

.table-head-row td {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--c-accent);
  background: rgba(255,0,255,0.06);
  border-bottom: 1px solid rgba(255,0,255,0.2);
  text-transform: uppercase;
}

/* ===== 侧边栏 ===== */
.sidebar {
  align-self: start;
  position: sticky;
  top: 24px;
}

.sidebar-inner {
  background: rgba(26,26,46,0.6);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(6px);
}

.sidebar-inner h2 {
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--c-primary);
  text-shadow: 0 0 6px var(--c-glow-p);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sidebar-inner p.subtitle {
  font-size: 11px;
  margin-bottom: 16px;
}

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

.related-list li a {
  display: block;
  padding: 8px 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  background: rgba(128,0,255,0.08);
  border: 1px solid rgba(128,0,255,0.2);
  border-radius: var(--radius);
  color: var(--c-text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: all var(--transition);
  line-height: 1.4;
}

.related-list li a:hover {
  background: rgba(128,0,255,0.22);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 0 8px var(--c-glow-p);
}

.back-btn {
  display: block;
  text-align: center;
}

/* ===== 页脚 ===== */
footer {
  background: rgba(10,10,18,0.98);
  border-top: 1px solid var(--c-border);
  padding: 40px 24px 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 32px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

footer > section {
  /* 直接子 section 分栏 */
}

footer > section h3 {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 0 6px var(--c-glow-a);
}

footer > section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

footer > section ul li a {
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

footer > section ul li a:hover {
  color: var(--c-accent);
  text-shadow: 0 0 6px var(--c-glow-a);
}

footer > section p {
  font-size: 13px;
  color: var(--c-text-dim);
  line-height: 1.6;
  margin-top: 8px;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-primary);
  text-shadow: 0 0 8px var(--c-glow-p);
  margin-bottom: 8px;
}

.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(128,0,255,0.15);
  padding: 16px 0 20px;
  font-size: 11px;
  color: var(--c-text-dim);
  letter-spacing: 0.06em;
  text-align: center;
}

/* ===== 关于页 ===== */
.about-links-block {
  margin-top: 40px;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 16px;
}

.inline-links li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 16px;
  background: rgba(128,0,255,0.1);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: all var(--transition);
}

.inline-links li a:hover {
  background: rgba(128,0,255,0.3);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 10px var(--c-glow-p);
}

/* ===== 首页正文内容区 ===== */
.home-prose-content,
.topic-prose,
.article-prose,
.privacy-prose {
  margin-bottom: 32px;
}

/* ===== 响应式 ===== */
@media (max-width: 800px) {
  .content-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .sidebar {
    position: static;
    order: -1;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 16px 0;
  }

  .footer-bottom {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  .hero-content {
    padding: 32px 16px 72px 16px;
    text-align: right;
  }

  .hero-actions {
    justify-content: flex-end;
  }

  .hero-section,
  .topic-hero {
    min-height: 65vh;
  }

  .bottom-nav ol {
    gap: 4px;
    padding: 0 6px;
  }

  .bottom-nav ol li a {
    padding: 4px 8px;
    font-size: 9px;
  }

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

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

  .article-header,
  .about-header,
  .privacy-header,
  .tag-header,
  .inner-hero {
    padding: 40px 16px 24px;
  }

  .home-content-section,
  .topic-body,
  .article-body,
  .about-body,
  .privacy-body,
  .tag-body {
    padding: 24px 0;
  }

  td {
    padding: 10px 10px;
    font-size: 12px;
  }

  .table-head-row td {
    font-size: 9px;
  }
}

@media (max-width: 375px) {
  html {
    font-size: 16px;
  }

  .hero-content h1 {
    font-size: 1.2rem;
  }

  .bottom-nav ol li a {
    font-size: 8.5px;
    padding: 4px 7px;
  }
}

/* ===== 无障碍焦点 ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ===== 图片自适应 ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 代码块 ===== */
code, pre {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  background: rgba(128,0,255,0.1);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

code {
  padding: 2px 6px;
}

pre {
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}
