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

/* ── 变量 ── */
:root {
  --paper: #fdfbf7;
  --paper-alt: #f5f5f5;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-soft: #6a6a6a;
  --border: #d4d0c8;
  --border-light: #e8e4dc;
  --shadow-sm: 2px 4px 12px rgba(26,26,26,0.08);
  --shadow-md: 4px 8px 24px rgba(26,26,26,0.12);
  --header-h: 3.5rem;
  --nav-announce: 2.25rem;
  --max-prose: 760px;
  --max-wide: 1200px;
  --font-serif: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-sans: 'Josefin Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: auto; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── 纸质纹理叠加 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

/* ── 链接 ── */
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── 站点包装 ── */
.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 顶部公告条 ── */
.header-top-bar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.55rem 1rem;
  line-height: 1.4;
}

/* ── 头部 / 导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  min-height: var(--header-h);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main-nav p {
  margin: 0;
  white-space: nowrap;
}

.brand-mark {
  flex-shrink: 0;
}

.brand-mark a {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: center;
  overflow-x: auto;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-mid);
  padding: 0.65rem 0.85rem;
  display: inline-block;
  min-height: 40px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border-light);
  transition: none;
}

.nav-links a:hover {
  background: var(--paper-alt);
  color: var(--ink);
  text-decoration: none;
}

.nav-links a:first-child { border-left: none; }

/* ── 主内容 ── */
.main-content {
  flex: 1;
}

/* ── 首页 Hero ── */
.hero-section {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
  text-align: center;
}

.hero-inner {
  max-width: 820px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.hero-sub {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── 页眉（非首页）── */
.page-header {
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem 3rem;
  background: var(--paper);
}

.page-header-inner {
  max-width: var(--max-prose);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  border-left: 3px solid var(--ink);
  padding-left: 0.75rem;
}

.page-header h1,
.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.page-desc, .article-desc {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.75;
  max-width: 640px;
}

/* ── 文章头部 ── */
.article-header {
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2.5rem;
}

.article-header-inner {
  max-width: var(--max-prose);
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
}

.breadcrumb a {
  color: var(--ink-soft);
}

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

.article-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.article-meta time { font-variant-numeric: tabular-nums; }

/* ── 英雄图 ── */
.article-hero-wrap {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

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

/* ── 正文容器 ── */
.content-body {
  padding: 3rem 2rem;
  max-width: var(--max-prose);
  margin: 0 auto;
  width: 100%;
}

/* ── 散文样式 ── */
.prose {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink);
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}

.prose p { margin-bottom: 1.35rem; }

.prose ul, .prose ol {
  margin: 0 0 1.35rem 1.5rem;
}

.prose li { margin-bottom: 0.45rem; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}

.prose a:hover { text-decoration-color: var(--ink); }

.prose strong { font-weight: 600; }

.prose blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper-alt);
  font-style: italic;
  color: var(--ink-mid);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  text-align: left;
}

.prose th {
  background: var(--paper-alt);
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.prose--legal { font-size: 0.97rem; color: var(--ink-mid); }
.prose--legal h2 { font-size: 1.25rem; }

/* ── 章节标题 ── */
.section-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

/* ── 首页：话题卡片网格 ── */
.topics-section, .articles-section, .children-section, .sibling-nav, .related-section, .about-nav-section {
  padding: 3rem 2rem;
  max-width: var(--max-wide);
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid var(--border-light);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem 1.5rem;
  background: var(--paper);
  text-decoration: none;
  transition: none;
  box-shadow: none;
}

.topic-card:hover {
  background: var(--paper-alt);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  z-index: 1;
  position: relative;
}

.topic-card strong {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: block;
  line-height: 1.4;
}

.topic-card span {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ── 首页：文章列表 ── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.article-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  text-decoration: none;
  align-items: start;
}

.article-item:hover {
  background: var(--paper-alt);
  text-decoration: none;
}

.article-item strong {
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--ink);
  grid-column: 1;
  grid-row: 1;
  letter-spacing: 0.02em;
}

.article-item time {
  font-size: 0.78rem;
  color: var(--ink-soft);
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.article-item span {
  font-size: 0.85rem;
  color: var(--ink-soft);
  grid-column: 1 / -1;
  grid-row: 2;
  line-height: 1.55;
}

/* ── 栏目：子页列表 ── */
.child-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.5rem;
  background: var(--paper);
  text-decoration: none;
  box-shadow: none;
}

.child-card:hover {
  background: var(--paper-alt);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.child-card strong {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.child-card time {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.child-card span {
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ── 兄弟/关联导航 ── */
.sibling-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.sibling-link {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  text-decoration: none;
}

.sibling-link:hover {
  background: var(--paper-alt);
  text-decoration: none;
}

.sibling-link strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.sibling-link span {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── 相关文章 ── */
.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1.25rem;
  background: var(--paper);
  text-decoration: none;
}

.related-item:hover {
  background: var(--paper-alt);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.related-item strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.related-item span {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── 隐私页补充 ── */
.privacy-footer-links {
  padding: 2rem 2rem 3rem;
  max-width: var(--max-prose);
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  border-top: 1px solid var(--border);
}

.privacy-footer-links a {
  font-size: 0.88rem;
  color: var(--ink-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 40px;
  display: flex;
  align-items: center;
}

/* ── 页脚 ── */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  margin-top: auto;
}

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

.footer-col {
  padding: 2.5rem 2rem;
  border-right: 1px solid rgba(253,251,247,0.12);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col:last-child { border-right: none; }

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 0.25rem;
}

.footer-col p {
  font-size: 0.82rem;
  color: rgba(253,251,247,0.65);
  line-height: 1.65;
}

.footer-col-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253,251,247,0.45) !important;
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-size: 0.86rem;
  color: rgba(253,251,247,0.75);
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(253,251,247,0.08);
  padding: 0.35rem 0;
}

.footer-col a:hover {
  color: var(--paper);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(253,251,247,0.15);
  padding: 1.25rem 2rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(253,251,247,0.45);
  letter-spacing: 0.04em;
}

/* ── Scroll Reveal 动效 ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease calc(var(--i, 0) * 60ms),
                transform 0.4s ease calc(var(--i, 0) * 60ms);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col:nth-child(2) { border-right: none; }
  .footer-col:nth-child(3) {
    grid-column: 1 / -1;
    border-right: none;
    border-top: 1px solid rgba(253,251,247,0.12);
  }
}

@media (max-width: 640px) {
  .header-top-bar {
    font-size: 0.68rem;
    padding: 0.45rem 0.75rem;
  }

  .main-nav {
    padding: 0 0.75rem;
    gap: 0;
  }

  .brand-mark a { font-size: 1rem; }

  .nav-links a {
    font-size: 0.72rem;
    padding: 0.65rem 0.55rem;
    min-height: 44px;
  }

  .hero-section {
    min-height: 42vh;
    padding: 3rem 1.25rem;
  }

  .hero-title { font-size: clamp(1.75rem, 8vw, 2.8rem); }

  .page-header { padding: 2.5rem 1.25rem 2rem; }

  .article-header { padding: 2rem 1.25rem 1.75rem; }

  .content-body { padding: 2rem 1.25rem; }

  .topics-section, .articles-section, .children-section,
  .sibling-nav, .related-section, .about-nav-section {
    padding: 2rem 1.25rem;
  }

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

  .related-list { grid-template-columns: 1fr; }

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

  .footer-col {
    border-right: none;
    border-top: 1px solid rgba(253,251,247,0.12);
    padding: 1.75rem 1.25rem;
  }

  .footer-col:first-child { border-top: none; }

  .article-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .article-item time {
    grid-column: 1;
    grid-row: 2;
  }

  .article-item span { grid-row: 3; }

  .privacy-footer-links { flex-direction: column; gap: 0.75rem; }
}

@media (max-width: 375px) {
  .nav-links a {
    padding: 0.65rem 0.4rem;
    font-size: 0.68rem;
  }
}
