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

/* ─── 基础变量 ─── */
:root {
  --c-white: #ffffff;
  --c-bg: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-muted: #5a5a5a;
  --c-ink-faint: #9a9a9a;
  --c-border: #d8d8d8;
  --c-accent: #1f1f1f;
  --c-accent-hover: #3a3a3a;
  --c-tile-bg: #ffffff;
  --r-card: 18px;
  --r-hero: 24px;
  --gap: 16px;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --max-w: 1200px;
  --hdr-h: 110px;
}

/* ─── 重置 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
address { font-style: normal; }

/* ─── 站头 ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-ink);
  color: var(--c-white);
  border-bottom: 1px solid #333;
}

.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 8px;
  border-bottom: 1px solid #333;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-white);
  white-space: nowrap;
}
.brand-name:hover { color: var(--c-bg); }

.brand-tagline {
  font-size: 0.78rem;
  color: #888;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-announce {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #777;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav {
  padding: 0 24px;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0.03em;
  border-right: 1px solid #333;
  transition: color 0.2s, background 0.2s;
  min-height: 40px;
  white-space: nowrap;
}
.nav-link:first-child { border-left: 1px solid #333; }
.nav-link:hover { color: var(--c-white); background: #2a2a2a; }
.nav-link--active { color: var(--c-white); background: #2a2a2a; }

/* ─── 主体容器 ─── */
.site-main {
  min-height: calc(100vh - var(--hdr-h) - 60px);
  padding: 0;
}

.page-article { width: 100%; }

/* ─── Hero（首页） ─── */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background: var(--c-ink);
  overflow: hidden;
  padding: 48px 24px 56px;
}

.hero-dot-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #444 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding-top: 64px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.05rem;
  color: #aaa;
  max-width: 540px;
  line-height: 1.7;
}

/* ─── Bento 频道格 ─── */
.channels-section {
  background: var(--c-bg);
  padding: 48px 24px;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.section-heading span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.heading-deco {
  color: var(--c-border);
  font-weight: 300;
}

.section-heading--sm {
  font-size: 0.78rem;
  margin-bottom: 16px;
  margin-top: 32px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
}

.bento-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: var(--c-tile-bg);
  border: 1.5px solid var(--c-border);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  cursor: pointer;
  gap: 4px;
}
.bento-tile:hover {
  border-color: var(--c-ink);
  transform: scale(1.02);
}

.bento-tile--wide {
  grid-column: span 2;
}
.bento-tile--tall {
  grid-row: span 2;
  justify-content: flex-start;
  padding-top: 28px;
}

.bento-tile__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--c-ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bento-tile__title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-ink);
  display: block;
  line-height: 1.3;
}
.bento-tile__desc {
  font-size: 0.82rem;
  color: var(--c-ink-muted);
  line-height: 1.5;
  display: block;
  margin-top: 4px;
}
.bento-tile__count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-ink-faint);
  margin-top: 8px;
  display: block;
}

/* ─── 首页正文区 ─── */
.content-section {
  background: var(--c-white);
  padding: 48px 24px;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.content-prose {
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-ink);
}

/* ─── 首页文章格 ─── */
.articles-section {
  background: var(--c-bg);
  padding: 48px 24px 64px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--c-tile-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-card);
  transition: border-color 0.2s, transform 0.2s;
}
.article-card:hover {
  border-color: var(--c-ink);
  transform: translateY(-2px);
}
.article-card__title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-ink);
  display: block;
  line-height: 1.4;
}
.article-card__desc {
  font-size: 0.82rem;
  color: var(--c-ink-muted);
  line-height: 1.6;
}
.card-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-ink-faint);
  display: block;
}

/* ─── 频道页 ─── */
.site-main--channel {}

.channel-hero {
  background: var(--c-ink);
  padding: 48px 24px 40px;
}

.channel-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.breadcrumb-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #777;
  display: inline-block;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.breadcrumb-link:hover { color: var(--c-white); }

.channel-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.channel-hero__desc {
  font-size: 1rem;
  color: #aaa;
  max-width: 600px;
  margin-bottom: 12px;
  line-height: 1.7;
}
.channel-hero__count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #666;
  display: block;
}

.channel-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0;
  align-items: start;
}

.channel-sidebar {
  padding: 32px 20px 32px 24px;
  border-right: 1px solid var(--c-border);
  background: var(--c-white);
  min-height: 400px;
  position: sticky;
  top: var(--hdr-h);
}

.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
  margin-bottom: 12px;
  display: block;
}
.sidebar-heading--sec { margin-top: 24px; }

.sidebar-link {
  display: block;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--c-ink-muted);
  border-radius: 8px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.sidebar-link:hover { background: var(--c-bg); color: var(--c-ink); }
.sidebar-link--home { color: var(--c-ink-faint); margin-top: 12px; }
.sidebar-link--parent { color: var(--c-ink-faint); margin-top: 4px; font-size: 0.78rem; }

.channel-content {
  padding: 32px 24px 48px;
  background: var(--c-bg);
}

.channel-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-ink);
  max-width: 760px;
  margin-bottom: 32px;
}

.child-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 760px;
}

.child-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--c-tile-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-card);
  transition: border-color 0.2s, transform 0.2s;
  min-height: 80px;
}
.child-block:hover {
  border-color: var(--c-ink);
  transform: translateY(-2px);
}
.child-block__title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-ink);
  display: block;
  line-height: 1.4;
}
.child-block__desc {
  font-size: 0.8rem;
  color: var(--c-ink-muted);
  line-height: 1.55;
}

/* ─── 文章页 ─── */
.site-main--article {}

.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  align-items: start;
}

.article-sidebar {
  padding: 32px 20px 32px 24px;
  border-right: 1px solid var(--c-border);
  background: var(--c-white);
  min-height: 400px;
  position: sticky;
  top: var(--hdr-h);
}

.article-main {
  padding: 40px 32px 56px;
  background: var(--c-bg);
  min-width: 0;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-ink-faint);
  margin-bottom: 20px;
}
.article-breadcrumb a {
  color: var(--c-ink-muted);
  transition: color 0.15s;
}
.article-breadcrumb a:hover { color: var(--c-ink); }
.article-breadcrumb span { color: var(--c-border); }

.article-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.article-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-ink-faint);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
}
.article-date--mod { color: #888; }

.article-desc {
  font-size: 0.95rem;
  color: var(--c-ink-muted);
  margin-bottom: 28px;
  line-height: 1.7;
  border-left: 3px solid var(--c-border);
  padding-left: 14px;
}

.article-hero-figure {
  margin-bottom: 28px;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.article-hero-img {
  width: 100%;
  height: auto;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-ink);
  max-width: 720px;
}

.article-footer-nav {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}

/* ─── 扁平页（about / privacy） ─── */
.site-main--flat {}

.flat-hero {
  background: var(--c-ink);
  padding: 64px 24px 52px;
}
.flat-hero--sm { padding: 40px 24px 36px; }

.flat-hero__inner {
  max-width: 760px;
  margin: 0 auto;
}

.flat-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #666;
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}

.flat-title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
  margin-bottom: 14px;
}

.flat-desc {
  font-size: 1rem;
  color: #aaa;
  line-height: 1.7;
  max-width: 600px;
}

.flat-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #666;
  margin-top: 10px;
  display: block;
}

.flat-body {
  padding: 48px 24px 64px;
  max-width: 760px;
  margin: 0 auto;
}

.flat-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-ink);
}

.flat-prose--legal {
  font-size: 0.95rem;
}

.flat-links {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── 按钮 ─── */
.btn-back,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 10px;
  border: 1.5px solid var(--c-ink);
  color: var(--c-ink);
  background: transparent;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  min-height: 40px;
  letter-spacing: 0.02em;
}
.btn-back:hover {
  background: var(--c-ink);
  color: var(--c-white);
}
.btn-secondary {
  border-color: var(--c-border);
  color: var(--c-ink-muted);
}
.btn-secondary:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
}

/* ─── 页脚 ─── */
.site-footer {
  background: var(--c-ink);
  border-top: 1px solid #2a2a2a;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 56px;
}

.footer-address {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: 0;
  align-items: center;
}
.footer-links li a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #555;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-left: 1px solid #2a2a2a;
  transition: color 0.2s;
}
.footer-links li:first-child a { border-left: none; }
.footer-links li a:hover { color: var(--c-white); }

/* ─── 富文本正文样式 ─── */
.content-prose h2,
.channel-prose h2,
.article-body h2,
.flat-prose h2 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-ink);
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--c-border);
  letter-spacing: 0.01em;
}

.content-prose h3,
.channel-prose h3,
.article-body h3,
.flat-prose h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-ink);
  margin: 24px 0 8px;
}

.content-prose p,
.channel-prose p,
.article-body p,
.flat-prose p {
  margin-bottom: 16px;
}

.content-prose a,
.channel-prose a,
.article-body a,
.flat-prose a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.content-prose a:hover,
.channel-prose a:hover,
.article-body a:hover,
.flat-prose a:hover { opacity: 0.7; }

.content-prose ul,
.channel-prose ul,
.article-body ul,
.flat-prose ul {
  padding-left: 20px;
  margin-bottom: 16px;
  list-style: disc;
}

.content-prose ol,
.channel-prose ol,
.article-body ol,
.flat-prose ol {
  padding-left: 20px;
  margin-bottom: 16px;
  list-style: decimal;
}

.content-prose li,
.channel-prose li,
.article-body li,
.flat-prose li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.content-prose strong,
.channel-prose strong,
.article-body strong,
.flat-prose strong {
  font-weight: 600;
}

.content-prose table,
.channel-prose table,
.article-body table,
.flat-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.content-prose th,
.channel-prose th,
.article-body th,
.flat-prose th,
.content-prose td,
.channel-prose td,
.article-body td,
.flat-prose td {
  border: 1px solid var(--c-border);
  padding: 8px 12px;
  text-align: left;
}
.content-prose th,
.channel-prose th,
.article-body th,
.flat-prose th {
  background: var(--c-bg);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
}

.content-prose code,
.channel-prose code,
.article-body code,
.flat-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1px 5px;
}

.content-prose pre,
.channel-prose pre,
.article-body pre,
.flat-prose pre {
  background: var(--c-ink);
  color: var(--c-white);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.content-prose blockquote,
.channel-prose blockquote,
.article-body blockquote,
.flat-prose blockquote {
  border-left: 3px solid var(--c-ink);
  padding-left: 16px;
  color: var(--c-ink-muted);
  margin: 20px 0;
  font-style: italic;
}

/* ─── Scroll Reveal 动效 ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── 响应式 ─── */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-tile--wide { grid-column: span 2; }
  .bento-tile--tall { grid-row: span 1; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --hdr-h: 130px; }

  .header-brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 16px 8px;
  }
  .header-announce { display: none; }
  .header-nav { padding: 0 16px; }
  .nav-link { padding: 8px 10px; font-size: 0.72rem; }

  .hero-section { min-height: 60vh; padding: 32px 16px 40px; }
  .hero-title { font-size: 2rem; }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }
  .bento-tile--wide { grid-column: span 2; }
  .bento-tile--tall { grid-row: span 1; }

  .channels-section { padding: 32px 16px; }
  .articles-section { padding: 32px 16px 48px; }
  .article-grid { grid-template-columns: 1fr; }
  .content-section { padding: 32px 16px; }

  .channel-body {
    grid-template-columns: 1fr;
  }
  .channel-sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 20px 16px;
    min-height: unset;
  }
  .channel-content { padding: 24px 16px 40px; }
  .child-list { grid-template-columns: 1fr; }

  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 16px;
    min-height: unset;
  }
  .article-main { padding: 24px 16px 40px; }

  .flat-hero { padding: 40px 16px 32px; }
  .flat-body { padding: 32px 16px 48px; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
  .footer-links { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 140px;
  }
  .bento-tile--wide { grid-column: span 1; }
  .hero-title { font-size: 1.7rem; }
  .brand-tagline { display: none; }
  .nav-link { font-size: 0.7rem; padding: 8px 8px; }
  .flat-title { font-size: 1.6rem; }
  .channel-hero__title { font-size: 1.6rem; }
}
