@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ===== CSS变量 ===== */
:root {
  --c-green: #00ff80;
  --c-blue: #0000ff;
  --c-black: #000000;
  --c-white: #ffffff;
  --c-gray: #111111;
  --c-gray2: #222222;
  --c-gray3: #333333;
  --c-text: #f0f0f0;
  --c-text-dim: #aaaaaa;
  --nav-w: 260px;
  --font-serif: 'Playfair Display', 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --border: 2px solid var(--c-green);
  --border-blue: 2px solid var(--c-blue);
  --border-white: 2px solid var(--c-white);
}

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

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

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

a {
  color: var(--c-green);
  text-decoration: none;
  transition: none;
}

a:hover {
  color: var(--c-white);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

/* ===== 网格底纹 ===== */
.page-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0,255,128,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,128,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== 页面骨架 ===== */
.page-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 侧边导航 ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-black);
  border-right: var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav__brand {
  padding: 24px 16px 20px;
  border-bottom: var(--border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-green);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--c-white);
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 14px;
  line-height: 1.3;
  color: inherit;
  word-break: break-all;
}

.side-nav nav {
  flex: 1;
  padding: 12px 0;
}

.side-nav nav ul {
  display: flex;
  flex-direction: column;
}

.side-nav nav ul li {
  border-bottom: 1px solid var(--c-gray2);
}

.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  color: var(--c-text-dim);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 1.4;
  min-height: 44px;
  text-decoration: none;
  transition: none;
}

.nav-link:hover,
.nav-link--active {
  color: var(--c-green);
  background: var(--c-gray2);
  text-decoration: none;
}

.nav-icon {
  flex-shrink: 0;
  color: var(--c-blue);
  font-size: 10px;
  margin-top: 2px;
}

.nav-link--active .nav-icon {
  color: var(--c-green);
}

.nav-text {
  flex: 1;
}

.nav-cta {
  display: block;
  margin: 12px 16px 24px;
  padding: 12px 16px;
  background: var(--c-blue);
  color: var(--c-white);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  border: 2px solid var(--c-blue);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-cta:hover {
  background: var(--c-green);
  border-color: var(--c-green);
  color: var(--c-black);
  text-decoration: none;
}

/* ===== 主内容区 ===== */
.page-main {
  margin-left: var(--nav-w);
  display: flex;
  flex: 1;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
  min-width: 0;
  padding: 0 0 40px;
}

/* ===== 侧边小工具 ===== */
.side-widget {
  width: 220px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-left: var(--border);
  background: var(--c-gray);
}

.side-widget h3 {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  margin-top: 20px;
  border-bottom: 1px solid var(--c-gray3);
  padding-bottom: 6px;
}

.side-widget h3:first-child {
  margin-top: 0;
}

.side-widget h3 > span {
  display: inline;
}

.widget-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widget-links li a {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--c-text-dim);
  border-left: 2px solid transparent;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.widget-links li a:hover {
  color: var(--c-green);
  border-left-color: var(--c-green);
  background: var(--c-gray2);
  text-decoration: none;
}

.widget-parent-link {
  display: block;
  padding: 8px;
  background: var(--c-gray2);
  border: var(--border);
  font-size: 12px;
  color: var(--c-green);
  margin-bottom: 8px;
}

.widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--c-text-dim);
  padding: 16px 24px 0;
  font-family: var(--font-mono);
}

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

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

.bc-sep {
  color: var(--c-blue);
  font-weight: 700;
}

/* ===== 页面头部 ===== */
.page-header-section {
  padding: 16px 24px 24px;
  border-bottom: var(--border);
  margin-bottom: 0;
}

.page-header-section h1 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
  color: var(--c-white);
  line-height: 1.2;
  margin-top: 12px;
}

.page-date {
  font-size: 12px;
  color: var(--c-text-dim);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* ===== Hero（首页） ===== */
.hero-section {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  border-bottom: var(--border);
  position: relative;
  overflow: hidden;
}

.hero-text {
  flex: 1;
  padding: 80px 40px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-blue);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  border-left: 3px solid var(--c-blue);
  padding-left: 10px;
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 900;
  color: var(--c-white);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-lead {
  font-size: 16px;
  color: var(--c-text-dim);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--c-green);
  color: var(--c-black);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--c-green);
  text-decoration: none;
  align-self: flex-start;
  min-height: 48px;
  transition: none;
}

.hero-btn:hover {
  background: var(--c-black);
  color: var(--c-green);
  text-decoration: none;
}

.hero-visual {
  width: 380px;
  flex-shrink: 0;
  background: var(--c-gray);
  border-left: var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,128,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,128,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.hg-label {
  position: absolute;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 64px);
  color: var(--c-green);
  opacity: 0.15;
  user-select: none;
}

.hg-label--1 { top: 15%; left: 10%; font-size: 48px; }
.hg-label--2 { top: 35%; right: 10%; font-size: 56px; color: var(--c-blue); }
.hg-label--3 { bottom: 30%; left: 20%; font-size: 40px; }
.hg-label--4 { bottom: 15%; right: 15%; font-size: 52px; color: var(--c-blue); }

/* ===== 内容区 ===== */
.content-section {
  padding: 32px 24px;
  border-bottom: 1px solid var(--c-gray2);
}

.prose {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-white);
  margin: 28px 0 12px;
  border-left: 4px solid var(--c-green);
  padding-left: 12px;
}

.prose h2 > span {
  display: inline;
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-green);
  margin: 20px 0 8px;
}

.prose h3 > span {
  display: inline;
}

.prose p {
  margin-bottom: 14px;
}

.prose ul, .prose ol {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 14px;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 6px;
}

.prose a {
  color: var(--c-green);
  text-decoration: underline;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.prose th {
  background: var(--c-gray2);
  border: 1px solid var(--c-gray3);
  padding: 8px 12px;
  text-align: left;
  color: var(--c-green);
}

.prose td {
  border: 1px solid var(--c-gray3);
  padding: 8px 12px;
}

/* ===== 分类网格 ===== */
.cats-section,
.entries-section,
.tags-section,
.children-section,
.siblings-section,
.about-cats-section,
.nav-links-section,
.back-section,
.legal-links-section,
.about-links-section,
.tags-nav-section,
.related-section,
.hero-img-section {
  padding: 28px 24px;
  border-bottom: 1px solid var(--c-gray2);
}

.cats-section h2,
.entries-section h2,
.tags-section h2,
.children-section h2,
.siblings-section h2,
.about-cats-section h2,
.nav-links-section h2,
.back-section h2,
.legal-links-section h2,
.about-links-section h2,
.tags-nav-section h2,
.related-section h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 16px;
  border-bottom: var(--border);
  padding-bottom: 8px;
}

.cats-section h2 > span,
.entries-section h2 > span,
.tags-section h2 > span,
.children-section h2 > span,
.siblings-section h2 > span,
.about-cats-section h2 > span,
.nav-links-section h2 > span,
.back-section h2 > span,
.legal-links-section h2 > span,
.about-links-section h2 > span,
.tags-nav-section h2 > span,
.related-section h2 > span {
  display: inline;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: var(--border);
  background: var(--c-gray);
  color: var(--c-text);
  text-decoration: none;
  border-radius: 4px;
  transition: none;
}

.cat-block:hover {
  background: var(--c-gray2);
  border-color: var(--c-white);
  color: var(--c-white);
  text-decoration: none;
}

.cat-block strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-green);
  line-height: 1.3;
}

.cat-block:hover strong {
  color: var(--c-white);
}

.cat-desc {
  font-size: 12px;
  color: var(--c-text-dim);
  line-height: 1.5;
}

/* ===== 子页卡片 ===== */
.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 2px solid var(--c-gray3);
  background: var(--c-gray);
  color: var(--c-text);
  text-decoration: none;
  border-radius: 4px;
  transition: none;
}

.child-card:hover {
  border-color: var(--c-green);
  background: var(--c-gray2);
  text-decoration: none;
}

.child-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.4;
}

.child-desc {
  font-size: 12px;
  color: var(--c-text-dim);
  line-height: 1.5;
}

.child-date {
  font-size: 11px;
  color: var(--c-blue);
  font-family: var(--font-mono);
}

/* ===== 条目列表 ===== */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--c-gray3);
  background: var(--c-gray);
  color: var(--c-text);
  text-decoration: none;
  transition: none;
}

.entry-item:hover {
  border-color: var(--c-green);
  background: var(--c-gray2);
  text-decoration: none;
}

.entry-item strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
  flex: 1;
  min-width: 0;
}

.entry-date {
  font-size: 11px;
  color: var(--c-text-dim);
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* ===== 标签 ===== */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 2px solid var(--c-blue);
  background: transparent;
  color: var(--c-blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: none;
  min-height: 32px;
}

.tag-pill:hover,
.tag-pill--active {
  background: var(--c-blue);
  color: var(--c-white);
  text-decoration: none;
}

/* ===== 相关分类链接 ===== */
.rel-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rel-cat-link {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border: 2px solid var(--c-gray3);
  background: var(--c-gray);
  color: var(--c-text);
  text-decoration: none;
  border-radius: 4px;
  min-width: 160px;
  transition: none;
}

.rel-cat-link:hover {
  border-color: var(--c-blue);
  color: var(--c-white);
  text-decoration: none;
}

.rel-cat-link strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-dim);
}

.rel-cat-link:hover strong {
  color: var(--c-white);
}

/* ===== 兄弟条目 ===== */
.siblings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.sib-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 2px solid var(--c-gray3);
  background: var(--c-gray);
  color: var(--c-text);
  text-decoration: none;
  border-radius: 4px;
  transition: none;
}

.sib-link:hover {
  border-color: var(--c-green);
  background: var(--c-gray2);
  text-decoration: none;
}

.sib-link strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-white);
}

.sib-link span {
  font-size: 12px;
  color: var(--c-text-dim);
}

/* ===== 返回链接区 ===== */
.back-links,
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border: var(--border-white);
  background: transparent;
  color: var(--c-white);
  font-family: var(--font-mono);
  text-decoration: none;
  min-height: 44px;
  transition: none;
}

.back-link:hover {
  background: var(--c-white);
  color: var(--c-black);
  text-decoration: none;
}

.back-link strong {
  font-size: 14px;
  font-weight: 700;
}

/* ===== 条目页元信息 ===== */
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.meta-date {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--c-text-dim);
  background: var(--c-gray2);
  padding: 3px 8px;
  border-left: 2px solid var(--c-blue);
}

/* ===== 条目 hero 图 ===== */
.entry-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: var(--border);
}

/* ===== 关于页 ===== */
.about-header {
  background: var(--c-gray);
}

/* ===== 页脚 ===== */
footer {
  margin-left: var(--nav-w);
  border-top: var(--border);
  z-index: 1;
  position: relative;
}

.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  background: var(--c-gray);
  border-bottom: var(--border);
  flex-wrap: wrap;
}

.footer-cta-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-white);
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: var(--c-green);
  color: var(--c-black);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--c-green);
  text-decoration: none;
  min-height: 44px;
  transition: none;
  white-space: nowrap;
}

.footer-cta-btn:hover {
  background: var(--c-black);
  color: var(--c-green);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--c-black);
  flex-wrap: wrap;
  gap: 10px;
}

.footer-copy {
  font-size: 12px;
  color: var(--c-text-dim);
  font-family: var(--font-mono);
}

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

.footer-links a {
  font-size: 12px;
  color: var(--c-text-dim);
  text-decoration: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

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

/* ===== 动效：Stagger List ===== */
@media (prefers-reduced-motion: no-preference) {
  .cats-grid .cat-block,
  .children-grid .child-card,
  .entries-list .entry-item,
  .siblings-grid .sib-link {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.3s ease forwards;
  }

  .cats-grid .cat-block:nth-child(1),
  .children-grid .child-card:nth-child(1),
  .entries-list .entry-item:nth-child(1),
  .siblings-grid .sib-link:nth-child(1) { animation-delay: 0.05s; }
  .cats-grid .cat-block:nth-child(2),
  .children-grid .child-card:nth-child(2),
  .entries-list .entry-item:nth-child(2),
  .siblings-grid .sib-link:nth-child(2) { animation-delay: 0.1s; }
  .cats-grid .cat-block:nth-child(3),
  .children-grid .child-card:nth-child(3),
  .entries-list .entry-item:nth-child(3),
  .siblings-grid .sib-link:nth-child(3) { animation-delay: 0.15s; }
  .cats-grid .cat-block:nth-child(4),
  .children-grid .child-card:nth-child(4),
  .entries-list .entry-item:nth-child(4),
  .siblings-grid .sib-link:nth-child(4) { animation-delay: 0.2s; }
  .cats-grid .cat-block:nth-child(5),
  .children-grid .child-card:nth-child(5),
  .entries-list .entry-item:nth-child(5),
  .siblings-grid .sib-link:nth-child(5) { animation-delay: 0.25s; }
  .cats-grid .cat-block:nth-child(6),
  .children-grid .child-card:nth-child(6),
  .entries-list .entry-item:nth-child(6),
  .siblings-grid .sib-link:nth-child(6) { animation-delay: 0.3s; }

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

  .cat-block:hover,
  .child-card:hover,
  .entry-item:hover,
  .sib-link:hover {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cats-grid .cat-block,
  .children-grid .child-card,
  .entries-list .entry-item,
  .siblings-grid .sib-link {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ===== 汉堡菜单按钮（移动端） ===== */
.nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--c-black);
  border: var(--border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-green);
}

/* ===== 移动端断点 ===== */
@media (max-width: 900px) {
  .side-widget {
    display: none;
  }

  .page-main {
    margin-left: 0;
    padding-top: 60px;
  }

  footer {
    margin-left: 0;
  }

  .side-nav {
    transform: translateX(-100%);
    transition: none;
    width: 280px;
  }

  .side-nav.is-open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .hero-section {
    flex-direction: column;
    min-height: auto;
  }

  .hero-text {
    padding: 40px 20px 32px;
  }

  .hero-visual {
    width: 100%;
    height: 200px;
    border-left: none;
    border-top: var(--border);
  }

  .hero-h1 {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .cats-grid,
  .children-grid,
  .siblings-grid {
    grid-template-columns: 1fr;
  }

  .footer-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    padding: 12px 20px;
  }

  .content-section,
  .cats-section,
  .entries-section,
  .tags-section,
  .children-section,
  .siblings-section,
  .about-cats-section,
  .nav-links-section,
  .back-section,
  .legal-links-section,
  .about-links-section,
  .tags-nav-section,
  .related-section {
    padding: 20px 16px;
  }

  .page-header-section {
    padding: 12px 16px 20px;
  }

  .breadcrumb {
    padding: 10px 16px 0;
  }

  .entry-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .rel-cats {
    flex-direction: column;
  }
}
