:root {
  --paper: #f3efe7;
  --paper-2: #fbf8f3;
  --ink: #1c1915;
  --muted: #5f584f;
  --line: rgba(28, 25, 21, 0.12);
  --gold: #8d7044;
  --gold-soft: #c4a574;
  --deep: #241f1b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --song: "FangSong", "STFangsong", "Songti SC", "STSong", "PMingLiU", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 18px 40px rgba(36, 31, 27, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -180px, rgba(196, 165, 116, 0.18), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}
body::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #1c1915, #c4a574 18%, #8d7044 50%, #c4a574 82%, #1c1915);
}
img { max-width: 100%; }
a { color: inherit; }
button, input { font-family: inherit; }
::selection { background: #e7d7c2; color: var(--ink); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.mast {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 22px;
}
.mast-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.mast-kicker {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.22em;
  font-size: 12px;
}
.search-form { display: flex; gap: 8px; }
.search-form input {
  width: 190px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 0;
  outline: none;
}
.search-form input:focus { border-bottom-color: var(--gold); }
.search-form button,
.nav-toggle,
.admin-btn,
.pager a,
.pager-current {
  border: 1px solid transparent;
}
.search-form button {
  border-color: var(--gold);
  background: transparent;
  color: var(--ink);
  letter-spacing: 0.14em;
  padding: 6px 12px;
  cursor: pointer;
}
.search-form button:hover { background: var(--ink); color: var(--paper-2); }
.mast-mid { position: relative; }
.hero h2,
.article h1,
.card h3 { overflow-wrap: break-word; }
.brand {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 22px 0 14px;
}
.brand-en {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  color: var(--gold);
}
.brand-cn {
  display: block;
  margin-top: 6px;
  font-family: var(--song);
  font-size: 46px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  line-height: 1.15;
}
.nav-toggle {
  display: none;
  position: absolute;
  right: 0;
  top: 28px;
  background: transparent;
  border-color: var(--line);
  padding: 6px 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.site-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.site-nav a {
  text-decoration: none;
  padding: 12px 0;
  letter-spacing: 0.24em;
  font-size: 13px;
}
.site-nav a.is-on { color: var(--gold); }
.site-nav a:hover { color: var(--gold); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: end;
  margin: 36px 0 10px;
}
.hero:not(:has(.hero-media.is-ready)) {
  grid-template-columns: minmax(0, 46rem);
}
.hero-media,
.card-media {
  display: none;
  overflow: hidden;
  background: #e7dfd3;
  text-decoration: none;
}
.hero-media.is-ready,
.card-media.is-ready { display: block; }
.hero-media.is-ready { aspect-ratio: 4 / 3; }
.hero-media img,
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-media img { transition: transform 0.7s ease; }
.hero:hover img { transform: scale(1.03); }
.media-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 180px;
  font-family: var(--song);
  letter-spacing: 0.4em;
  color: var(--gold);
  font-size: 28px;
}
.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.28em;
  font-size: 12px;
}
.kicker a { text-decoration: none; }
.hero h2,
.article h1,
.miss h1,
.search-page h1,
.section-head h2 {
  font-family: var(--song);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.28;
}
.hero h2 { margin: 0; font-size: clamp(32px, 4vw, 52px); }
.hero h2 a,
.card h3 a { text-decoration: none; }
.hero h2 a:hover,
.card h3 a:hover { color: var(--gold); }
.lede,
.card-excerpt { color: var(--muted); }
.lede { font-size: 17px; line-height: 1.85; }
.meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 34px 0 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.section-head h2,
.search-page h1 { margin: 0; font-size: 28px; }
.section-head span,
.search-note { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px 22px;
}
.card-media.is-ready { aspect-ratio: 4 / 3; }
.card img { transition: transform 0.6s ease; }
.card:hover img { transform: scale(1.045); }
.card h3 { margin: 8px 0; font-size: 20px; font-weight: 600; line-height: 1.45; letter-spacing: 0.02em; }
.card-excerpt {
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.8em;
}
.card .kicker { margin-top: 12px; }
.prose img.is-broken { display: none; }
.prose p:has(> img.is-broken):not(:has(> :not(img))) { display: none; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 42px 0 10px;
  flex-wrap: wrap;
}
.pager-nums { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager a,
.pager-current,
.pager-gap {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
}
.pager a { border-color: var(--line); padding: 0 10px; }
.pager a:hover,
.pager-current { border-color: var(--ink); background: var(--ink); color: var(--paper-2); }
.pager-arrow { letter-spacing: 0.12em; padding: 0 14px; }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 48px;
  margin-top: 34px;
}
.article-head { max-width: 44rem; }
.article h1 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 48px); }
.prose {
  max-width: 44rem;
  font-size: 17.5px;
  line-height: 1.95;
  color: #26221d;
}
.prose p { margin: 0 0 1.05em; }
.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.4em 0 1.3em;
  background: #e8dfd3;
}
.prose a { color: #6d542e; }
.prose h2,
.prose h3,
.prose h4 { font-family: var(--song); font-weight: 500; line-height: 1.4; }
.rail {
  align-self: start;
  position: sticky;
  top: 18px;
  padding-top: 8px;
}
.rail h2 {
  margin: 0 0 12px;
  font-family: var(--song);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.rail a { text-decoration: none; line-height: 1.45; }
.rail a:hover { color: var(--gold); }
.rail span { color: var(--muted); font-size: 12px; }
.neighbors {
  max-width: 44rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.neighbor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  min-height: 4.5em;
}
.neighbor span { color: var(--gold); letter-spacing: 0.16em; font-size: 12px; }
.neighbor strong { font-weight: 600; line-height: 1.45; }
.neighbor.next { text-align: right; }
.neighbor:hover strong { color: var(--gold); }

.miss { padding: 12vh 0 8vh; max-width: 40rem; }
.miss h1 { font-size: 42px; margin: 0 0 10px; }
.text-link { color: var(--gold); letter-spacing: 0.14em; }
.empty { color: var(--muted); padding: 24px 0 48px; }

.site-footer {
  margin-top: 72px;
  background: var(--deep);
  color: #f3eadf;
}
.footer-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 28px;
}
.footer-brand {
  font-family: var(--song);
  letter-spacing: 0.28em;
  font-size: 28px;
  margin: 0 0 8px;
}
.footer-note,
.footer-copy { color: rgba(243, 234, 223, 0.72); font-size: 13px; }
.footer-copy { letter-spacing: 0.08em; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .rail { position: static; }
}
@media (max-width: 720px) {
  .wrap,
  .mast,
  .footer-inner { width: min(1120px, calc(100% - 28px)); }
  .brand-cn { font-size: 36px; letter-spacing: 0.18em; text-indent: 0.18em; }
  .hero h2 { font-size: 28px; letter-spacing: 0; }
  .mast-top { align-items: stretch; flex-direction: column; }
  .search-form input { width: auto; flex: 1; }
  .mast-top { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .search-form { grid-column: 1 / -1; }
  .nav-toggle { display: inline-flex; position: static; }
  .site-nav { display: none; flex-direction: column; align-items: center; gap: 0; }
  body.nav-open .site-nav { display: flex; }
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-excerpt { min-height: 0; }
  .neighbors { grid-template-columns: 1fr; }
  .neighbor.next { text-align: left; }
  .prose { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media img,
  .card img { transition: none; }
  .hero:hover img,
  .card:hover img { transform: none; }
}
