:root {
  --bg: #f5f1e8;
  --bg-soft: #efe7d8;
  --paper: rgba(255, 252, 246, 0.88);
  --paper-strong: #fffdf9;
  --ink: #1f2a24;
  --ink-soft: #55635a;
  --line: rgba(31, 42, 36, 0.12);
  --accent: #1c6b57;
  --accent-soft: #dbeee5;
  --accent-strong: #134b3e;
  --shadow: 0 18px 40px rgba(41, 50, 45, 0.08);
  --radius: 22px;
  --content-width: 1120px;
  --content-narrow: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(28, 107, 87, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(185, 126, 49, 0.08), transparent 25%),
    linear-gradient(180deg, #f7f3eb 0%, #f2ecdf 100%);
  font-family: "IBM Plex Sans", "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.75;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 42, 36, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 36, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 70%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

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

code,
pre,
kbd,
samp {
  font-family: "IBM Plex Mono", "SFMono-Regular", "Menlo", monospace;
}

.site-shell {
  min-height: 100vh;
}

.site-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 16px 0;
}

.site-nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 252, 246, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-brand-title {
  font-family: "Iowan Old Style", "Georgia", "Noto Serif SC", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.site-brand-subtitle {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav-link:hover,
.site-nav-link.is-current {
  color: var(--accent-strong);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.site-main {
  padding: 20px 16px 64px;
}

.hero-panel,
.content-panel,
.post-card,
.tag-index,
.topic-section,
.footer-panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel {
  max-width: var(--content-width);
  margin: 0 auto 24px;
  padding: 42px;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 107, 87, 0.18), transparent 70%);
}

.hero-kicker,
.section-kicker,
.post-card-category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 760px;
  margin: 16px 0 10px;
  font-family: "Iowan Old Style", "Georgia", "Noto Serif SC", serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-description {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.hero-meta,
.post-card-meta,
.topic-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.hero-meta {
  margin-top: 18px;
}

.hero-meta span,
.post-meta-pill,
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.content-panel {
  max-width: var(--content-width);
  margin: 0 auto 24px;
  padding: 28px;
  border-radius: var(--radius);
}

.page-content {
  max-width: var(--content-narrow);
}

.page-content > :first-child {
  margin-top: 0;
}

.page-content > :last-child {
  margin-bottom: 0;
}

.home-overview {
  display: grid;
  gap: 24px;
}

.home-overview-copy h2,
.section-heading h2,
.topic-section-title,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: "Iowan Old Style", "Georgia", "Noto Serif SC", serif;
  line-height: 1.18;
}

.home-overview-copy h2,
.section-heading h2,
.topic-section-title {
  margin: 0;
}

.home-overview-copy p,
.post-card-summary,
.spotlight-summary {
  margin: 0;
  color: var(--ink-soft);
}

.home-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.home-stat strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.05;
}

.home-stat span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading > div {
  display: grid;
  gap: 8px;
}

.spotlight-card {
  display: grid;
  gap: 14px;
}

.spotlight-title,
.post-card-title {
  margin: 0;
  font-family: "Iowan Old Style", "Georgia", "Noto Serif SC", serif;
  line-height: 1.15;
  color: var(--ink);
}

.spotlight-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.post-card-title {
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
}

.spotlight-title a,
.post-card-title a {
  color: inherit;
}

.spotlight-summary {
  max-width: 760px;
  font-size: 1rem;
}

.post-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-card {
  padding: 24px 24px 22px;
  border-radius: 20px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  animation: card-enter 420ms ease both;
}

.post-card:hover,
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(31, 42, 36, 0.12);
}

.topic-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.topic-card strong {
  font-family: "Iowan Old Style", "Georgia", "Noto Serif SC", serif;
  font-size: 1.1rem;
}

.topic-card span {
  color: var(--ink-soft);
}

.section-footer {
  margin-top: 20px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #f7f3eb;
}

.primary-link:hover {
  color: #fff;
  background: var(--accent-strong);
}

.pager {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}

.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  color: var(--accent-strong);
  background: rgba(28, 107, 87, 0.08);
}

.post-shell {
  display: grid;
  gap: 24px;
}

.post-content {
  padding: 28px;
  border-radius: 20px;
  background: var(--paper-strong);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content > :last-child {
  margin-bottom: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  scroll-margin-top: 96px;
}

.post-content p,
.post-content li,
.post-content blockquote {
  color: var(--ink);
}

.post-content ul,
.post-content ol {
  padding-left: 1.4rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  overflow: hidden;
}

.post-content th,
.post-content td {
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.post-content th {
  background: rgba(28, 107, 87, 0.08);
  text-align: left;
}

.post-content pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 16px;
  background: #1f2623;
  color: #f6f2ea;
}

.post-content code {
  padding: 0.08em 0.35em;
  border-radius: 8px;
  background: rgba(28, 107, 87, 0.08);
}

.post-content pre code {
  padding: 0;
  background: transparent;
}

.post-content blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: rgba(28, 107, 87, 0.08);
}

.post-content iframe,
.post-content video {
  max-width: 100%;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.post-nav a {
  flex: 1 1 280px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink);
}

.post-nav-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tag-index,
.topic-section {
  background: rgba(255, 255, 255, 0.74);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.topic-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tag-post-list {
  display: grid;
  gap: 12px;
}

.topic-post-item {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.topic-post-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.redirect-panel {
  max-width: 640px;
  text-align: center;
}

.footer-wrap {
  padding: 0 16px 36px;
}

.footer-panel {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 28px;
  border-radius: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copy {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

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

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  color: var(--ink);
}

.page-fullscreen .site-main {
  min-height: 70vh;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero-panel,
  .content-panel,
  .footer-panel {
    padding: 24px;
  }

  .home-overview-stats,
  .post-grid,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav {
    border-radius: 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-main,
  .site-nav-wrap,
  .footer-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .hero-panel,
  .content-panel,
  .post-card,
  .post-content,
  .footer-panel {
    padding: 18px;
  }

  .home-overview-stats,
  .post-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }
}
