/* === 字体引入 === */
@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === 设计令牌 === */
:root {
  --c-paper:   #fdfbf7;
  --c-bg2:     #f5f5f5;
  --c-ink:     #1a1a1a;
  --c-ink2:    #3a3a3a;
  --c-ink3:    #6a6a6a;
  --c-border:  #d4d0c8;
  --c-accent:  #1a1a1a;
  --c-hover:   #f0ede6;

  --f-head:  'Calistoga', Georgia, serif;
  --f-body:  'Inter', system-ui, sans-serif;
  --f-mono:  'JetBrains Mono', 'Courier New', monospace;

  --nav-w:   240px;
  --gap:     24px;
  --radius:  0;
  --shadow:  2px 4px 12px rgba(26,26,26,0.10);
}

/* === 重置 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: auto; }
body {
  font-family: var(--f-body);
  background: var(--c-paper);
  color: var(--c-ink);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  /* 纸质纹理 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; transition: none; }
a:hover { background: var(--c-hover); text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }

/* === 辅助 === */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === 布局骨架 === */
.site-wrap {
  display: flex;
  min-height: 100vh;
}

/* === 侧边导航 === */
.sidenav {
  width: var(--nav-w);
  min-width: var(--nav-w);
  background: var(--c-bg2);
  border-right: 2px solid var(--c-ink);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding-bottom: 24px;
}

.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--c-border);
}

.sidenav__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidenav__name {
  font-family: var(--f-head);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--c-ink);
  line-height: 1.3;
}

.sidenav__search {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}

.sidenav__input {
  width: 100%;
  background: var(--c-paper);
  border: 1px solid var(--c-border);
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--c-ink);
  outline: none;
  border-radius: var(--radius);
}

.sidenav__input:focus {
  border-color: var(--c-ink);
  box-shadow: inset 0 0 0 1px var(--c-ink);
}

.sidenav__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
}

.nav-link {
  display: block;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: none;
}

.nav-link:hover {
  background: var(--c-paper);
  border-color: var(--c-border);
}

.nav-link--active {
  background: var(--c-ink);
  color: var(--c-paper);
  border-color: var(--c-ink);
}

.nav-link--active:hover {
  background: var(--c-ink2);
  color: var(--c-paper);
}

/* === 主内容区 === */
.page-body {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* === 面包屑 === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 40px;
  font-size: 0.8125rem;
  color: var(--c-ink3);
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}

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

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-hidden] { color: var(--c-border); }

/* === Hero（首页） === */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--c-ink);
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  padding: 60px 40px 60px 40px;
  position: relative;
  z-index: 2;
}

.hero__eyebrow {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink3);
  margin-bottom: 16px;
}

.hero__h1 {
  font-family: var(--f-head);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.15;
  color: var(--c-ink);
  margin-bottom: 20px;
  max-width: 480px;
}

.hero__sub {
  font-size: 1.0625rem;
  color: var(--c-ink2);
  max-width: 360px;
  margin-bottom: 32px;
  line-height: 1.65;
}

.hero__cta {
  display: inline-block;
  background: var(--c-ink);
  color: var(--c-paper);
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--c-ink);
  min-height: 44px;
  letter-spacing: 0.04em;
}

.hero__cta:hover {
  background: var(--c-paper);
  color: var(--c-ink);
}

.hero__visual {
  position: relative;
  overflow: hidden;
  background: var(--c-bg2);
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__stripe {
  position: absolute;
  top: 0;
  left: -20%;
  width: 40%;
  height: 100%;
  background: var(--c-ink);
  opacity: 0.06;
  transform: skewX(-8deg);
  pointer-events: none;
}

/* === 首页内容区 === */
.home-content {
  padding: 56px 40px;
  max-width: 1100px;
}

.home-content__main {
  margin-bottom: 56px;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 48px;
}

/* === 区块标题 === */
.section-heading {
  font-family: var(--f-head);
  font-size: 1.5rem;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-ink);
  display: inline-block;
}

/* === 分类网格（首页） === */
.home-cats {
  margin-bottom: 56px;
}

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

.cat-card {
  background: var(--c-paper);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
}

.cat-card a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  text-decoration: none;
  height: 100%;
  min-height: 100px;
}

.cat-card a:hover {
  background: var(--c-hover);
}

.cat-card__title {
  font-family: var(--f-head);
  font-size: 1.0625rem;
  color: var(--c-ink);
  line-height: 1.3;
}

.cat-card__desc {
  font-size: 0.8125rem;
  color: var(--c-ink2);
  line-height: 1.55;
  flex: 1;
}

.cat-card__count {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-ink3);
  margin-top: 8px;
}

/* === 最近更新列表（首页） === */
.home-recent { margin-bottom: 0; }

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--c-border);
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  padding: 0;
}

.entry-row > a {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  text-decoration: none;
  min-height: 44px;
}

.entry-row > a:hover { background: var(--c-hover); }

.entry-row__label {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--c-ink3);
  letter-spacing: 0.08em;
  white-space: nowrap;
  min-width: 60px;
}

.entry-row__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-ink);
}

.entry-row__date {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-ink3);
  white-space: nowrap;
  padding: 14px 0 14px 16px;
}

/* === 栏目页头部 === */
.cat-header {
  padding: 48px 40px 36px;
  border-bottom: 2px solid var(--c-ink);
  background: var(--c-bg2);
}

.cat-header__h1 {
  font-family: var(--f-head);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.cat-header__desc {
  font-size: 1rem;
  color: var(--c-ink2);
  max-width: 600px;
  margin-bottom: 10px;
}

.cat-header__count {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-ink3);
  letter-spacing: 0.08em;
}

/* === 栏目内容 === */
.cat-content {
  padding: 40px 40px 0;
  max-width: 1100px;
}

.cat-content__prose {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-border);
}

.cat-entries {
  margin-bottom: 48px;
}

/* === 条目卡片列表 === */
.entry-card-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--c-border);
}

.entry-card {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-paper);
}

.entry-card__link {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  min-height: 80px;
}

.entry-card__link:hover { background: var(--c-hover); }

.entry-card__media {
  width: 120px;
  min-width: 120px;
  overflow: hidden;
  border-right: 1px solid var(--c-border);
  background: var(--c-bg2);
}

.entry-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
}

.entry-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-ink);
  line-height: 1.4;
}

.entry-card__desc {
  font-size: 0.875rem;
  color: var(--c-ink2);
  line-height: 1.55;
  flex: 1;
  margin: 0;
}

.entry-card__date {
  font-family: var(--f-mono);
  font-size: 0.725rem;
  color: var(--c-ink3);
  margin: 0;
}

/* Stagger animation */
@media (prefers-reduced-motion: no-preference) {
  .stagger-list .entry-card {
    animation: staggerIn 0.25s both;
    animation-delay: calc(var(--stagger, 0) * 60ms);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .stagger-list .entry-card { animation: none; }
}

/* === 条目详情页 === */
.entry-eyebrow {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.725rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink3);
  margin-bottom: 12px;
}

.entry-article {
  padding: 40px 40px 60px;
  max-width: 820px;
}

.entry-article__header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--c-border);
}

.entry-article__h1 {
  font-family: var(--f-head);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.entry-article__meta {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  color: var(--c-ink3);
}

.entry-hero {
  margin-top: 20px;
  border: 1px solid var(--c-border);
  overflow: hidden;
}

.entry-hero__img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.entry-article__body {
  margin-bottom: 40px;
}

.entry-siblings {
  border-top: 1px solid var(--c-border);
  padding-top: 28px;
  margin-top: 40px;
}

.entry-siblings__heading {
  font-family: var(--f-head);
  font-size: 1.125rem;
  margin-bottom: 16px;
}

.entry-siblings__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--c-border);
}

.entry-siblings__list dt {
  border-bottom: 1px solid var(--c-border);
}

.entry-siblings__list dt a {
  display: block;
  padding: 10px 0;
  font-size: 0.9375rem;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.entry-siblings__list dt a:hover { background: var(--c-hover); padding-left: 8px; }

/* === 静态页（about / privacy） === */
.static-article {
  padding: 48px 40px 60px;
  max-width: 820px;
}

.static-article--narrow {
  max-width: 680px;
}

.static-article__header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--c-ink);
}

.static-article__h1 {
  font-family: var(--f-head);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 14px;
}

.static-article__lead {
  font-size: 1.0625rem;
  color: var(--c-ink2);
  line-height: 1.65;
}

.static-article__body {
  margin-bottom: 40px;
}

.about-links {
  border-top: 1px solid var(--c-border);
  padding-top: 28px;
  margin-top: 40px;
}

.about-links__heading {
  font-family: var(--f-head);
  font-size: 1.125rem;
  margin-bottom: 20px;
}

.about-links__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-links__list dt {
  font-weight: 600;
}

.about-links__list dt a {
  font-size: 0.9375rem;
}

.about-links__list dd {
  font-size: 0.8125rem;
  color: var(--c-ink2);
  margin-bottom: 12px;
  padding-left: 0;
}

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

.privacy-nav__list dt {
  display: inline;
  margin-right: 16px;
}

.privacy-nav__list dt a {
  font-size: 0.9375rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

/* === 富文本 Prose === */
.prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-ink);
  max-width: 72ch;
}

.prose h2 {
  font-family: var(--f-head);
  font-size: 1.375rem;
  margin: 2em 0 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--c-border);
}

.prose h3 {
  font-family: var(--f-head);
  font-size: 1.125rem;
  margin: 1.6em 0 0.5em;
}

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

.prose a {
  color: var(--c-ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

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

.prose blockquote {
  border-left: 3px solid var(--c-ink);
  padding: 8px 20px;
  margin: 1.5em 0;
  background: var(--c-bg2);
  font-style: italic;
}

.prose code {
  font-family: var(--f-mono);
  font-size: 0.875em;
  background: var(--c-bg2);
  padding: 2px 5px;
  border: 1px solid var(--c-border);
}

.prose pre {
  font-family: var(--f-mono);
  font-size: 0.875em;
  background: var(--c-ink);
  color: var(--c-paper);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 1.2em;
}

.prose pre code { background: none; border: none; padding: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2em;
  font-size: 0.9rem;
}

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

.prose th { background: var(--c-bg2); font-weight: 600; }

/* === 空提示 === */
.empty-tip {
  padding: 24px 0;
  color: var(--c-ink3);
  font-style: italic;
}

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

.footer-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--c-border);
}

.footer-col {
  padding: 32px 28px;
  border-right: 1px solid var(--c-border);
}

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

.footer-col__heading {
  font-family: var(--f-head);
  font-size: 0.9375rem;
  margin-bottom: 14px;
  color: var(--c-ink);
}

.footer-col__text {
  font-size: 0.8125rem;
  color: var(--c-ink2);
  line-height: 1.65;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-nav dt a {
  font-size: 0.8125rem;
  color: var(--c-ink2);
  text-decoration: none;
  display: block;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.footer-nav dt a:hover {
  color: var(--c-ink);
  text-decoration: underline;
}

.footer-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-form__label {
  font-size: 0.75rem;
  color: var(--c-ink3);
}

.footer-form__input {
  background: var(--c-paper);
  border: 1px solid var(--c-border);
  padding: 8px 10px;
  font-size: 0.8125rem;
  color: var(--c-ink);
  outline: none;
}

.footer-form__input:focus {
  border-color: var(--c-ink);
}

.footer-form__btn {
  background: var(--c-ink);
  color: var(--c-paper);
  border: none;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-height: 40px;
  letter-spacing: 0.04em;
}

.footer-form__btn:hover {
  background: var(--c-ink2);
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  font-size: 0.75rem;
  color: var(--c-ink3);
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bar a {
  color: var(--c-ink3);
  font-size: 0.75rem;
}

.footer-sitemap {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 12px 28px;
}

.footer-sitemap dt {
  border-right: 1px solid var(--c-border);
}

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

.footer-sitemap dd a {
  display: block;
  padding: 6px 16px;
  font-size: 0.75rem;
  color: var(--c-ink3);
  text-decoration: none;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.footer-sitemap dd a:hover {
  color: var(--c-ink);
  text-decoration: underline;
}

/* === 响应式 === */
@media (max-width: 1024px) {
  :root { --nav-w: 200px; }
  .footer-top { grid-template-columns: repeat(2, 1fr); }
  .footer-col:nth-child(2) { border-right: none; }
  .footer-col:nth-child(3) { border-right: 1px solid var(--c-border); }
}

@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .sidenav {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left 0.2s ease;
    z-index: 200;
  }

  .sidenav.is-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.18);
  }

  .page-body {
    margin-left: 0;
  }

  .nav-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    background: var(--c-ink);
    color: var(--c-paper);
    border: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .hero__text {
    padding: 80px 24px 40px;
    align-items: flex-start;
    text-align: left;
    order: 1;
  }

  .hero__visual {
    order: 2;
    min-height: 220px;
  }

  .home-content,
  .cat-content,
  .entry-article,
  .static-article {
    padding: 28px 20px 40px;
  }

  .cat-header {
    padding: 28px 20px 24px;
  }

  .breadcrumb {
    padding: 10px 20px;
  }

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

  .footer-col {
    padding: 24px 18px;
  }

  .footer-col:nth-child(2) { border-right: none; }
  .footer-col:nth-child(3) { border-right: 1px solid var(--c-border); }
  .footer-col:nth-child(4) { border-right: none; }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .footer-bar {
    padding: 12px 18px;
  }

  .footer-sitemap {
    padding: 8px 18px;
  }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-col { border-right: none !important; }

  .hero__h1 { font-size: 1.75rem; }

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

  .entry-card__media { width: 80px; min-width: 80px; }
}
