/* ============================================================
   木禾小店 · 站点样式
   纸感、墨色、朱砂印章；五列瀑布流拼图。
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --paper: #f4efe5;
  --paper-deep: #ece4d5;
  --surface: #fbf7ee;
  --surface-2: #efe7d8;
  --ink: #1d1812;
  --ink-soft: #3d362b;
  --muted: #655a49;
  --faint: #716553;
  --line: rgba(29, 24, 18, 0.12);
  --line-strong: rgba(29, 24, 18, 0.22);
  --accent: #b23a2b;
  --accent-strong: #972d20;
  --accent-soft: rgba(178, 58, 43, 0.09);
  --gold: #96743c;
  --shadow-sm: 0 1px 2px rgba(52, 38, 18, 0.05);
  --shadow-md: 0 22px 44px -28px rgba(52, 38, 18, 0.45);
  --shadow-lg: 0 34px 70px -34px rgba(52, 38, 18, 0.5);
  --radius: 4px;
  --radius-lg: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "STSong",
    "SimSun", Georgia, serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 68px;
  --gap: 26px;
  --code-bg: #201b15;
  --code-bg-2: #2a231b;
  --code-ink: #e9e0ce;
  --container: 1800px;
  --pad: clamp(20px, 3.2vw, 46px);
}

html[data-theme="dark"] {
  --paper: #14110d;
  --paper-deep: #0f0d0a;
  --surface: #1c1812;
  --surface-2: #241f17;
  --ink: #ece3d2;
  --ink-soft: #cfc3ae;
  --muted: #a0937d;
  --faint: #9a8e7b;
  --line: rgba(236, 227, 210, 0.12);
  --line-strong: rgba(236, 227, 210, 0.24);
  --accent: #e06a4f;
  --accent-strong: #ef8268;
  --accent-soft: rgba(224, 106, 79, 0.13);
  --gold: #c6a667;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 24px 48px -28px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 36px 72px -34px rgba(0, 0, 0, 0.8);
  --code-bg: #191510;
  --code-bg-2: #221d16;
  --code-ink: #e6dcc8;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.5;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

html[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: 0.35;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--accent);
  color: #fdf8ee;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.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;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  transform: translateY(-150%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  transition: box-shadow 0.25s, background 0.25s;
}

.site-header.is-scrolled {
  box-shadow: 0 12px 30px -24px rgba(40, 28, 14, 0.55);
}

.site-header__inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__seal {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fbf3e4;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.brand:hover .brand__seal {
  transform: rotate(-6deg) scale(1.04);
}

.brand__seal--small {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__text strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand__text small {
  margin-top: 3px;
  font-size: 8.5px;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.nav__link {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

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

.nav__link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  background: var(--accent);
  border-radius: 50%;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  background: var(--paper);
}

.icon-btn--sm {
  height: 32px;
  padding: 0 10px;
}

.icon-btn--sm svg {
  width: 15px;
  height: 15px;
}

.icon-btn--theme {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.theme-icon {
  display: inline-flex;
}

.theme-icon svg {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .theme-icon--light,
html:not([data-theme="dark"]) .theme-icon--dark {
  display: none;
}

.icon-btn--github {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.icon-btn--menu {
  display: none;
  width: 38px;
  padding: 0;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(36px, 4.6vw, 62px) var(--pad) clamp(34px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 78% 20%, var(--accent-soft), transparent 58%),
    radial-gradient(90% 80% at 8% 90%, rgba(150, 116, 60, 0.08), transparent 60%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero__title {
  margin: 16px 0 18px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(52px, 5.8vw, 86px);
  line-height: 0.98;
  letter-spacing: 0.02em;
}

.hero__period {
  color: var(--accent);
}

.hero__desc {
  max-width: 560px;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.95;
  color: var(--muted);
}

.hero__stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 26px 0 24px;
  width: fit-content;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero__stat {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 13px 26px;
  border-right: 1px solid var(--line);
}

.hero__stat:first-child {
  padding-left: 0;
}

.hero__stat:last-child {
  border-right: 0;
}

.hero__stat strong {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero__stat em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--accent);
  box-shadow: 0 14px 26px -18px var(--accent);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn--sm {
  height: 36px;
  padding: 0 16px;
  font-size: 12.5px;
}

.hero__art {
  position: relative;
  height: clamp(300px, 26vw, 366px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__book {
  position: relative;
  width: clamp(218px, 17vw, 262px);
  height: 100%;
  max-height: 356px;
  background: linear-gradient(160deg, var(--surface), var(--paper-deep));
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  box-shadow: var(--shadow-lg), inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--line);
  transform: rotate(-4.5deg);
  overflow: hidden;
}

.hero__book::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.hero__book-line {
  position: absolute;
  right: clamp(18px, 1.7vw, 26px);
  top: clamp(20px, 1.8vw, 28px);
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.2vw, 31px);
  letter-spacing: 0.28em;
  line-height: 1.3;
  color: var(--ink);
}

.hero__book-caption {
  position: absolute;
  left: clamp(18px, 1.7vw, 26px);
  top: clamp(20px, 1.8vw, 28px);
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.24em;
  line-height: 1.5;
  color: var(--muted);
}

.hero__book-mark {
  position: absolute;
  left: clamp(18px, 1.7vw, 26px);
  bottom: clamp(18px, 1.8vw, 26px);
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  writing-mode: vertical-rl;
  border-radius: 2px;
  opacity: 0.9;
}

.hero__stamp {
  position: absolute;
  top: 4%;
  left: 1%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  transform: rotate(-12deg);
}

.hero__stamp svg {
  width: 18px;
  height: 18px;
}

/* ---------- Sections ---------- */
main {
  display: block;
}

.content-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(30px, 3vw, 44px) var(--pad) clamp(60px, 7vw, 110px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}

.section-title {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.section-note {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

/* ---------- Filters ---------- */
.filters {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  margin: 0 calc(var(--pad) * -1) 24px;
  padding: 11px var(--pad) 10px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s;
}

.filters.is-stuck {
  box-shadow: 0 16px 30px -26px rgba(40, 28, 14, 0.5);
}

.filters__row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.filters__row--top {
  justify-content: space-between;
}

.filters__row--tags {
  margin-top: 10px;
  gap: 12px;
  align-items: flex-start;
}

.filters__label {
  flex-shrink: 0;
  padding-top: 5px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.segmented__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.segmented__btn span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

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

.segmented__btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.segmented__btn.is-active span {
  color: color-mix(in srgb, var(--paper) 78%, var(--ink));
}

.filters__tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.text-btn:hover {
  color: var(--accent);
}

.text-btn svg {
  width: 14px;
  height: 14px;
}

.filters__clear {
  color: var(--accent);
}

.grid-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.grid-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.grid-search__icon {
  display: inline-flex;
  color: var(--faint);
}

.grid-search__icon svg {
  width: 14px;
  height: 14px;
}

.grid-search__input {
  width: 176px;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.grid-search__input::placeholder {
  color: var(--faint);
}

.grid-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  transition: all 0.18s;
  white-space: nowrap;
}

.chip span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--faint);
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf7ec;
}

.chip.is-active span {
  color: rgba(253, 247, 236, 0.7);
}

.chip--more {
  border-style: dashed;
  gap: 4px;
}

.chip--more svg {
  width: 12px;
  height: 12px;
}

.filters__status {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
  min-height: 0;
}

.filters__status:empty {
  display: none;
}

/* ---------- Masonry grid ---------- */
.masonry {
  --cols: 5;
  --gap: 26px;
  column-count: var(--cols);
  column-gap: var(--gap);
}

.masonry .card {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

.masonry.is-masonry {
  column-count: initial;
  position: relative;
}

.masonry.is-masonry .card {
  position: absolute;
  margin: 0;
}

.masonry.is-masonry:not(.is-laid-out) .card {
  visibility: hidden;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s,
    border-color 0.35s, opacity 0.5s;
}

.js .card {
  opacity: 0;
  transform: translateY(16px);
}

.js .card.is-in {
  opacity: 1;
  transform: translateY(0);
}

.card:hover,
.js .card.is-in:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card__media {
  position: relative;
  display: block;
  aspect-ratio: var(--ratio, 4 / 5);
  overflow: hidden;
  background: var(--surface-2);
}

.card__media--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s;
}

.card:hover .card__media--image img {
  transform: scale(1.045);
}

.card__media--typo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 80% 10%, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), var(--surface-2) 62%),
    repeating-linear-gradient(135deg, transparent 0 13px, color-mix(in srgb, var(--accent) 5%, transparent) 13px 14px);
}

.card--note .card__media--typo {
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 17%, var(--surface)), var(--surface) 64%),
    repeating-linear-gradient(90deg, transparent 0 27px, color-mix(in srgb, var(--accent) 7%, transparent) 27px 28px);
}

.card__glyph {
  font-family: var(--font-serif);
  font-size: clamp(72px, 8vw, 118px);
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
  opacity: 0.9;
  transform: translate(-12%, -4%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

.card:hover .card__glyph {
  transform: translate(-9%, -8%) scale(1.03);
}

.card--note .card__glyph--num {
  font-family: var(--font-mono);
  font-size: clamp(46px, 5vw, 76px);
  letter-spacing: -0.05em;
  transform: translate(-10%, -2%);
  opacity: 0.72;
}

.card:hover .card__glyph--num {
  transform: translate(-7%, -6%) scale(1.02);
}

.card__typo-line {
  position: absolute;
  right: 16px;
  top: 16px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 65%, var(--muted));
  max-height: 70%;
  overflow: hidden;
}

.card__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.card--note .card__badge {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.card__issue {
  position: absolute;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 3px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px 17px 16px;
}

.card__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__kicker i {
  font-style: normal;
  color: var(--faint);
  opacity: 0.6;
}

.card__title {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.25vw, 19.5px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__title a {
  transition: color 0.2s;
}

.card:hover .card__title a {
  color: var(--accent);
}

.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 13px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.03em;
}

.card__dot {
  opacity: 0.5;
}

.card__go {
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.25s;
}

.card__go svg {
  width: 15px;
  height: 15px;
}

.card:hover .card__go {
  opacity: 1;
  transform: translateX(0);
}

.card.is-hidden {
  display: none;
}

.card.is-broken .card__media--image img {
  opacity: 0;
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-state__mark {
  font-family: var(--font-serif);
  font-size: 64px;
  color: var(--faint);
  line-height: 1;
  margin-bottom: 16px;
}

.empty-state .btn {
  margin-top: 20px;
}

/* ---------- Page head ---------- */
.page-head {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(52px, 6vw, 88px) var(--pad) clamp(30px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
}

.page-head .section-eyebrow {
  margin-bottom: 12px;
}

.page-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.page-title__count {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.page-desc {
  max-width: 660px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}

.page-head__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.page-head__actions .btn svg {
  width: 15px;
  height: 15px;
}

.year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.year-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: all 0.2s;
}

.year-nav a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- Archives ---------- */
.archive {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(26px, 3vw, 44px) var(--pad) clamp(70px, 8vw, 120px);
}

.archive__group {
  margin-bottom: 54px;
}

.archive__year {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.archive__year h2 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.archive__year span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.archive__item {
  display: grid;
  grid-template-columns: 80px 14px minmax(0, 1fr) 150px 72px;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s, padding 0.2s;
}

.archive__item:hover {
  background: var(--surface);
  padding-left: 16px;
  padding-right: 16px;
}

.archive__item time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.kind-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.kind-dot--note {
  background: var(--accent);
}

.archive__title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive__item:hover .archive__title {
  color: var(--accent);
}

.archive__tags {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.archive__tags span {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.archive__read {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

/* ---------- Tags ---------- */
.tag-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(30px, 3vw, 48px) var(--pad) clamp(70px, 8vw, 120px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.tag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 176px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.tag-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.07;
  transition: transform 0.4s;
}

.tag-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.tag-card:hover::after {
  transform: scale(1.25);
}

.tag-card__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.tag-card__name {
  margin: 18px 0 10px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
}

.tag-card__latest {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.tag-card__meta {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* ---------- Notes shelf ---------- */
.shelf {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(28px, 3vw, 46px) var(--pad) clamp(70px, 8vw, 120px);
}

.shelf__group {
  margin-bottom: 44px;
}

.shelf__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 4px;
}

.shelf__head h2 {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.shelf__head span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

.shelf__list li a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 92px 18px;
  align-items: center;
  gap: 14px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s, padding 0.2s;
}

.shelf__list li a:hover {
  background: var(--surface);
  padding-left: 14px;
  padding-right: 14px;
}

.shelf__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.shelf__title {
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf__list li a:hover .shelf__title {
  color: var(--accent);
}

.shelf__date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  text-align: right;
}

.shelf__go {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s;
}

.shelf__list li a:hover .shelf__go {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- About ---------- */
.about-main {
  max-width: var(--container);
  margin: 0 auto;
}

.about {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 76px);
  padding: clamp(30px, 4vw, 54px) var(--pad) clamp(70px, 9vw, 130px);
  align-items: start;
}

.about__card {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about__avatar {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  filter: saturate(0.9);
}

.about__card h2 {
  margin: 18px 0 8px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 600;
}

.about__card > p {
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about__stats div {
  padding: 12px 0;
  text-align: center;
  border-right: 1px solid var(--line);
}

.about__stats div:last-child {
  border-right: 0;
}

.about__stats dt {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.about__stats dd {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 21px;
}

.about__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about__links a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  transition: color 0.2s;
}

.about__links a:last-child {
  border-bottom: 0;
}

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

.about__links svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.about__body .prose {
  max-width: 760px;
}

.about__colophon {
  max-width: 760px;
  margin-top: 54px;
  padding: 26px 28px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.about__colophon h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
}

.about__colophon p {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--muted);
}

.about__colophon-links {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  color: var(--faint);
}

.about__colophon-links a {
  color: var(--accent);
}

/* ---------- Article ---------- */
.reading-progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 2px;
  background: transparent;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.article-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) var(--pad) clamp(60px, 7vw, 100px);
}

.article__head {
  max-width: 1044px;
  margin: 0 auto;
}

.article__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

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

.article__crumbs span[aria-current] {
  color: var(--muted);
}

.article__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.article__kicker-dot {
  opacity: 0.5;
}

.kind-tag {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--paper);
  background: var(--ink);
}

.kind-tag--note {
  background: var(--accent);
}

.article__title {
  max-width: 880px;
  margin: 18px 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.article__lead {
  max-width: 720px;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.9;
  color: var(--muted);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.article__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.article__meta-sep {
  color: var(--faint);
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--muted);
  transition: all 0.2s;
}

a.tag-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.article__edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  transition: color 0.2s;
}

.article__edit:hover {
  color: var(--accent);
}

.article__edit svg {
  width: 13px;
  height: 13px;
}

.article__cover {
  max-width: 1044px;
  margin: 38px auto 0;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article__cover img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 2px;
  background: var(--paper-deep);
}

.note-source {
  max-width: 1044px;
  margin: 32px auto 0;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: var(--radius);
}

.note-source__main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.note-source__mark {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.note-source__title {
  font-size: 13px;
  font-weight: 600;
}

.note-source__text {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.note-source__text a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.note-source__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.label-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--label-accent) 32%, var(--ink));
  background: color-mix(in srgb, var(--label-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--label-accent) 25%, transparent);
}

.note-source__link {
  font-size: 11.5px;
  color: var(--accent);
  margin-left: 6px;
}

.article__layout {
  max-width: 1044px;
  margin: 46px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 760px) 220px;
  gap: 64px;
  justify-content: center;
}

.article__body {
  min-width: 0;
}

/* ---------- Prose ---------- */
.prose {
  font-size: 17px;
  line-height: 2.05;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 1.15em 0;
}

.prose .prose-h {
  position: relative;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  scroll-margin-top: calc(var(--header-h) + 28px);
}

.prose-h2 {
  margin: 2.2em 0 0.8em;
  padding-bottom: 0.4em;
  font-size: 27px;
  border-bottom: 1px solid var(--line);
}

.prose-h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  background: var(--accent);
  transform: translateY(-2px);
}

.prose-h3 {
  margin: 1.9em 0 0.7em;
  font-size: 21.5px;
}

.prose-h4 {
  margin: 1.6em 0 0.6em;
  font-size: 17.5px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink);
}

.h-anchor {
  position: absolute;
  left: -1.25em;
  top: 0;
  color: var(--accent);
  opacity: 0;
  font-family: var(--font-mono);
  font-size: 0.7em;
  text-decoration: none;
  transition: opacity 0.2s;
}

.prose-h:hover .h-anchor {
  opacity: 0.55;
}

.prose strong {
  font-weight: 650;
  color: var(--ink);
}

.prose em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--accent-soft) 0);
  padding: 0 1px;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

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

.prose blockquote {
  position: relative;
  margin: 1.8em 0;
  padding: 20px 26px 20px 30px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.95;
}

.prose blockquote::before {
  content: "“";
  position: absolute;
  left: 10px;
  top: 2px;
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.22;
}

.prose blockquote p {
  margin: 0.35em 0;
}

.prose blockquote > *:first-child {
  margin-top: 0;
}

.prose blockquote > *:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.45em;
}

.prose ul {
  list-style: none;
}

.prose ul > li {
  position: relative;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.95em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.7;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin: 0.4em 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.4em 0;
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 2.6em 0;
  background: var(--line-strong);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.14em 0.4em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
  word-break: break-word;
}

.prose .code-block {
  margin: 1.7em 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 12px 0 15px;
  background: var(--code-bg-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block__lang {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #a99a80;
  text-transform: uppercase;
}

.code-block__copy {
  font-size: 10.5px;
  color: #a99a80;
  padding: 3px 8px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.code-block__copy:hover {
  color: #f1e8d6;
  background: rgba(255, 255, 255, 0.07);
}

.code-block__copy.is-copied {
  color: #9ec97f;
}

.code-block__pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.72;
  scrollbar-width: thin;
}

.code-block__pre code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: var(--code-ink);
  font-size: inherit;
  white-space: pre;
  word-break: normal;
}

.prose table {
  display: block;
  width: 100%;
  margin: 1.8em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.7;
}

.prose table th,
.prose table td {
  padding: 9px 13px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.prose table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.prose .prose-figure {
  margin: 1.8em 0;
}

.prose .prose-img {
  width: auto;
  max-width: 100%;
  margin: 1.6em auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: zoom-in;
}

.prose .prose-figure .prose-img {
  margin: 0 auto;
}

.prose figcaption {
  margin-top: 9px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.img-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 1.6em 0;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--faint);
}

.img-missing span {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--muted);
}

.img-missing small {
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.prose .math-block {
  margin: 1.6em 0;
  padding: 14px 0;
  overflow-x: auto;
  text-align: center;
}

.prose .katex {
  font-size: 1.02em;
}

.prose .ext-link::after {
  content: "↗";
  display: inline-block;
  margin-left: 2px;
  font-size: 0.75em;
  color: var(--faint);
  text-decoration: none;
}

.prose .task-list-item::before {
  display: none;
}

.prose .task-list-item input {
  margin-right: 8px;
  accent-color: var(--accent);
}

.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.prose .footnotes::before {
  content: "脚注";
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
  color: var(--faint);
}

.prose details {
  margin: 1.4em 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.prose summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

.prose kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--surface);
}

.prose iframe {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* highlight.js · 暖色墨调 */
.hljs-comment,
.hljs-quote {
  color: #97886f;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-formula {
  color: #e0836b;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #b9c98c;
}

.hljs-number,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #d9a95f;
}

.hljs-title,
.hljs-title.function_,
.hljs-section,
.hljs-name {
  color: #9dc0d4;
}

.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name {
  color: #d8b96f;
}

.hljs-meta,
.hljs-deletion {
  color: #b98a8a;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

.hljs-link {
  text-decoration: underline;
}

/* TOC */
.toc {
  min-width: 0;
}

.toc__inner {
  position: sticky;
  top: calc(var(--header-h) + 30px);
  padding-left: 18px;
  border-left: 1px solid var(--line);
  max-height: calc(100vh - var(--header-h) - 70px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc__title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.toc__list {
  margin-top: 12px;
}

.toc__item {
  margin: 2px 0;
}

.toc__item a {
  display: block;
  padding: 4px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  transition: color 0.2s;
}

.toc__item--h3 a {
  padding-left: 12px;
  font-size: 11.5px;
  color: var(--faint);
}

.toc__item a:hover,
.toc__item a.is-active {
  color: var(--accent);
}

.toc__top {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.toc__top:hover {
  color: var(--accent);
}

/* Article footer */
.article__foot {
  max-width: 1044px;
  margin: 64px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.article__foot-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.article__foot-tags > span:first-child {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

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

.postnav__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}

.postnav__item--next {
  text-align: right;
}

a.postnav__item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.postnav__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.postnav__title {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.55;
}

.postnav__meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.postnav__item--empty {
  border-style: dashed;
  background: transparent;
}

.postnav__item--empty .postnav__label,
.postnav__item--empty .postnav__title {
  color: var(--faint);
}

.related {
  margin-top: 54px;
}

.related__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.related__head h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.related__head a {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

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

.related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mini-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 132px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.mini-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.mini-card__kind {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.mini-card__title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-card__meta {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.article__license {
  margin-top: 48px;
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  letter-spacing: 0.02em;
}

.article__license a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

/* ---------- Search ---------- */
.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease;
}

.search-modal__panel {
  position: relative;
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: search-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes search-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.search-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-modal__icon {
  display: inline-flex;
  color: var(--muted);
}

.search-modal__icon svg {
  width: 18px;
  height: 18px;
}

.search-modal__input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  letter-spacing: 0.02em;
}

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

.search-modal__body {
  max-height: min(54vh, 440px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.search-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.search-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
}

.search-result:hover,
.search-result.is-active {
  background: var(--surface-2);
}

.search-result__kind {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 2px 6px;
  border-radius: 2px;
}

.search-result__title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result__title mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 1px;
  border-radius: 2px;
}

.search-result__meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
}

.search-modal__foot {
  display: flex;
  gap: 18px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--faint);
}

.search-modal__foot kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(12, 10, 8, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  background: var(--surface-2);
  padding: clamp(38px, 4vw, 58px) var(--pad) 26px;
}

.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__brand strong {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.site-footer__brand p {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.site-footer__line {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.9;
  color: var(--faint);
  letter-spacing: 0.03em;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.site-footer__links a {
  font-size: 11.5px;
  color: var(--muted);
  transition: color 0.2s;
}

.site-footer__links a:hover {
  color: var(--accent);
}

.site-footer__colophon {
  max-width: var(--container);
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-align: center;
}

/* ---------- To top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s;
  font-size: 15px;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 404 ---------- */
.notfound {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 150px) var(--pad);
  text-align: center;
}

.notfound__code {
  font-family: var(--font-serif);
  font-size: clamp(90px, 16vw, 180px);
  line-height: 1;
  color: var(--accent);
  opacity: 0.9;
}

.notfound h1 {
  margin: 16px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
}

.notfound > p {
  color: var(--muted);
  font-size: 14px;
}

.notfound__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

/* ---------- Responsive ---------- */
@media (min-width: 900px) and (max-height: 900px) {
  .hero {
    padding-top: 28px;
    padding-bottom: 26px;
  }

  .hero__title {
    margin: 10px 0 12px;
    font-size: clamp(46px, 4.8vw, 68px);
  }

  .hero__desc {
    line-height: 1.8;
  }

  .hero__stats {
    margin: 18px 0 16px;
  }

  .hero__stat {
    padding: 9px 20px;
  }

  .hero__art {
    height: 300px;
  }

  .hero__book {
    width: 210px;
    max-height: 290px;
  }

  .hero__book-line {
    font-size: 22px;
  }

  .content-section {
    padding-top: 26px;
  }
}

@media (max-width: 1599px) {
  .masonry {
    --gap: 22px;
  }
}

@media (max-width: 1359px) {
  .masonry {
    --cols: 4;
  }
}

@media (max-width: 1079px) {
  .masonry {
    --cols: 3;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.6fr);
  }

  .hero__book {
    width: 220px;
  }

  .hero__book-line {
    font-size: 22px;
  }

  .article__layout {
    grid-template-columns: minmax(0, 760px);
  }

  .toc {
    display: none;
  }

  .about {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 899px) {
  .masonry {
    --cols: 2;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px var(--pad) 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .site-header.is-open .nav {
    display: flex;
  }

  .nav__link {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }

  .nav__link.is-active::after {
    display: none;
  }

  .icon-btn--menu {
    display: inline-flex;
  }

  .header-actions {
    gap: 4px;
  }

  .icon-btn__text,
  .icon-btn kbd {
    display: none;
  }

  .icon-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .hero {
    padding-top: 40px;
    padding-bottom: 32px;
  }

  .hero__title {
    margin: 14px 0 16px;
  }

  .hero__stats {
    margin: 24px 0 22px;
  }

  .content-section {
    padding-top: 28px;
  }

  .section-head {
    padding-bottom: 14px;
  }

  .section-note {
    display: none;
  }

  .filters {
    margin-bottom: 18px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__art {
    display: none;
  }

  .hero__stats {
    width: auto;
  }

  .hero__stat {
    padding: 11px 16px;
  }

  .filters {
    position: static;
    margin-bottom: 22px;
  }

  .filters__row--top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .filters__tools {
    width: 100%;
    justify-content: space-between;
  }

  .grid-search {
    flex: 1;
  }

  .grid-search__input {
    width: 100%;
  }

  .filters__row--tags {
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .filters__row--tags .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filters__row--tags .chips::-webkit-scrollbar {
    display: none;
  }

  .filters__label {
    display: none;
  }

  .filters__status {
    margin-top: 8px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-head {
    padding-top: 48px;
  }

  .archive__item {
    grid-template-columns: 66px 10px minmax(0, 1fr) 58px;
  }

  .archive__tags {
    display: none;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 18px;
  }

  .site-footer__line {
    text-align: left;
  }

  .site-footer__links {
    justify-content: flex-start;
  }

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

  .about__card {
    position: static;
  }

  .article__head {
    max-width: none;
  }

  .article__cover {
    margin-top: 28px;
  }

  .article__meta {
    gap: 9px;
  }

  .article__edit {
    margin-left: 0;
  }

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

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

  .postnav__item--next {
    text-align: left;
  }

  .shelf__list li a {
    grid-template-columns: 48px minmax(0, 1fr) 14px;
  }

  .shelf__date {
    display: none;
  }
}

@media (max-width: 639px) {
  :root {
    --header-h: 60px;
  }

  .filters__tools {
    display: none;
  }

  .masonry {
    --cols: 2;
    --gap: 14px;
  }

  .masonry .card__excerpt {
    display: none;
  }

  .card__body {
    padding: 12px 13px 13px;
  }

  .card__title {
    font-size: 15.5px;
    -webkit-line-clamp: 3;
  }

  .card__meta {
    font-size: 9.5px;
    padding-top: 10px;
  }

  .card__glyph {
    font-size: 62px;
  }

  .hero__title {
    font-size: 52px;
  }

  .hero__desc {
    font-size: 14.5px;
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .hero__stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
  }

  .hero__stat strong {
    font-size: 18px;
  }

  .hero__actions {
    flex-wrap: wrap;
  }

  .section-title {
    font-size: 28px;
  }

  .archive__item {
    grid-template-columns: 56px 8px minmax(0, 1fr);
    gap: 10px;
  }

  .archive__read {
    display: none;
  }

  .archive__title {
    font-size: 14.5px;
    white-space: normal;
  }

  .tag-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tag-card {
    min-height: 150px;
    padding: 16px;
  }

  .tag-card__name {
    font-size: 21px;
  }

  .tag-card__latest {
    font-size: 11px;
  }

  .prose {
    font-size: 16px;
    line-height: 1.95;
  }

  .prose-h2 {
    font-size: 23px;
  }

  .prose-h3 {
    font-size: 19px;
  }

  .article__title {
    font-size: 30px;
  }

  .article__lead {
    font-size: 14.5px;
  }

  .note-source {
    padding: 14px 16px;
  }

  .note-source__mark {
    display: none;
  }

  .search-modal {
    padding: 4vh 10px 10px;
  }

  .search-result {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .search-result__meta {
    display: none;
  }

  .search-modal__foot {
    display: none;
  }

  .page-title {
    font-size: 38px;
  }

  .site-footer {
    padding-bottom: 20px;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 430px) {
  .masonry {
    --cols: 1;
  }

  .masonry .card__excerpt {
    display: -webkit-box;
  }

  .card__title {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .card {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .filters,
  .toc,
  .to-top,
  .search-modal,
  .reading-progress,
  .article__edit,
  .postnav,
  .related {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .article-main {
    padding: 0;
  }
}
