:root {
  --paper: #faf8f4;
  --ink: #26241f;
  --ink-soft: #6d6860;
  --ink-faint: #9a948a;
  --line: #e8e3d9;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景：照片柔化后垫在最底下，上面压一层米白，再撒一点纸的颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E"),
    linear-gradient(180deg,
      rgba(250, 248, 244, 0.82) 0%,
      rgba(250, 248, 244, 0.90) 100%),
    url("images/bg.webp");
  background-size: 160px 160px, cover, cover;
  background-position: 0 0, center, center top;
  background-repeat: repeat, no-repeat, no-repeat;
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

/* ---------- 头部 ---------- */

.site-head {
  padding: 96px 0 0;
}

.site-head--mini {
  padding-top: 72px;
}

.site-head h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 2.9rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.site-head h1 a {
  color: inherit;
  text-decoration: none;
}

body[data-view="list"] .site-head h1 {
  font-size: 2.3rem;
}

.tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
}

.head-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.back {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.back a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

/* ---------- 板块入口 ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
}

.hub {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 134px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.3s ease, background 0.3s ease,
    transform 0.3s ease;
}

.hub:hover {
  border-color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.62);
  transform: translateY(-2px);
}

.hub-name {
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.32rem;
  letter-spacing: 0.04em;
}

.hub-n {
  font-size: 0.76rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

/* ---------- 分区导航 ---------- */

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  letter-spacing: 0.04em;
}

.cats a {
  display: inline-flex;
  align-items: center;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.cats a:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.cats a.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- 别处 ---------- */

.cross {
  margin: 56px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.cross a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

/* ---------- 搜索 ---------- */

.search {
  display: block;
  margin-top: 18px;
}

.search input {
  width: 100%;
  max-width: 260px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  font: inherit;
  font-size: 0.84rem;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.search input::placeholder {
  color: var(--ink-faint);
}

.search input:focus {
  border-color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.7);
}

/* ---------- 回到顶部 ---------- */

.totop {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(250, 248, 244, 0.88);
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.totop.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.totop:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
}

.empty {
  padding: 64px 0 40px;
  color: var(--ink-faint);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* ---------- 列表 ---------- */

.list {
  margin-top: 8px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.year {
  margin: 0;
  padding: 52px 0 6px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}

.year:first-child {
  padding-top: 30px;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 30px;
  padding: 26px 0;
  color: inherit;
  text-decoration: none;
}

.row::before {
  content: "";
  position: absolute;
  top: 36px;
  left: -30px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink-faint);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.row:hover::before {
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.row-date {
  padding-top: 4px;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  transition: color 0.3s ease;
}

.row:hover .row-date {
  color: var(--ink-soft);
}

.row-main {
  display: block;
}

.row-title {
  display: block;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.22rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  transition: opacity 0.25s ease;
}

.row-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink-faint);
}

.row:hover .row-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 4px;
}

/* ---------- 单篇 ---------- */

.single {
  padding-top: 44px;
}

.single-date {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.single-title {
  margin: 14px 0 30px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.single-body p {
  margin: 0 0 18px;
  text-wrap: pretty;
}

.single-body p:last-child {
  margin-bottom: 0;
}

/* ---------- 媒体 ---------- */

.media {
  margin: 24px 0;
}

.media img,
.media video {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.media audio {
  width: 100%;
}

.media figcaption {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- 页脚 ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 28px;
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.site-foot p {
  margin: 0;
}

/* ---------- 小屏 ---------- */

@media (max-width: 640px) {
  .page {
    padding: 0 22px 80px;
  }

  .site-head {
    padding: 64px 0 0;
  }

  .site-head--mini {
    padding-top: 48px;
  }

  .site-head h1 {
    font-size: 2.2rem;
  }

  body[data-view="list"] .site-head h1 {
    font-size: 1.9rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 34px;
  }

  .hub {
    min-height: 104px;
    padding: 18px 20px;
  }

  .tagline {
    font-size: 0.94rem;
  }

  .head-meta {
    margin-top: 28px;
  }

  .list {
    padding-left: 18px;
  }

  .year {
    padding-top: 40px;
  }

  .row {
    grid-template-columns: 64px 1fr;
    gap: 16px;
    padding: 22px 0;
  }

  .row::before {
    top: 31px;
    left: -22px;
  }

  .row-date {
    padding-top: 3px;
    font-size: 0.8rem;
  }

  .row-title {
    font-size: 1.1rem;
  }

  .single {
    padding-top: 32px;
  }

  .single-title {
    font-size: 1.7rem;
    margin-bottom: 24px;
  }
}
