/* Hallmark · genre: editorial · macrostructure: Long Document · theme: Newsprint
 * enrichment: none · nav: N6 (masthead: issue-line=below · wordmark=3xl · rule=double)
 * footer: Ft4 (family=mono · layout=log-style · includes=date+style)
 * pre-emit critique: P5 H4 E4 S5 R4 V4 · contrast: pass (40-41) · slop: pass (42-45)
 * axes: paper=light(96.5) · display=serif · accent=oxblood
 */
:root {
  --color-paper: oklch(96.5% 0.012 85);
  --color-paper-2: oklch(93.5% 0.014 85);
  --color-rule: oklch(84% 0.012 85);
  --color-neutral: oklch(58% 0.015 60);
  --color-muted: oklch(40% 0.02 60);
  --color-ink: oklch(18% 0.02 45);
  --color-ink-body: oklch(27% 0.02 45);
  --color-accent: oklch(48% 0.13 25);
  --color-accent-ink: oklch(97% 0.01 60);
  --color-accent-soft: oklch(48% 0.13 25 / 0.08);
  --color-focus: oklch(60% 0.15 55);

  --font-display: "Newsreader", Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
    "Noto Sans Mono CJK SC", Consolas, monospace;

  --text-xs: 0.72rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-md: 1.2rem;
  --text-lg: 1.5rem;
  --text-xl: 1.875rem;
  --text-2xl: 2.34rem;
  --text-display: clamp(2.3rem, 6vw + 0.8rem, 4.6rem);

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 420ms;

  --rule-hair: 1px;
  --z-sticky: 200;
  --z-sticky-nav: 300;
  --z-dropdown: 400;
}

html[data-theme="dark"] {
  --color-paper: oklch(15% 0.012 85);
  --color-paper-2: oklch(18% 0.014 85);
  --color-rule: oklch(26% 0.012 85);
  --color-neutral: oklch(58% 0.01 85);
  --color-muted: oklch(72% 0.01 85);
  --color-ink: oklch(94% 0.01 85);
  --color-ink-body: oklch(82% 0.01 85);
  --color-accent: oklch(72% 0.13 30);
  --color-accent-ink: oklch(14% 0.01 85);
  --color-accent-soft: oklch(72% 0.13 30 / 0.12);
  --color-focus: oklch(70% 0.14 55);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"],
  html:not([data-theme]) {
    --color-paper: oklch(15% 0.012 85);
    --color-paper-2: oklch(18% 0.014 85);
    --color-rule: oklch(26% 0.012 85);
    --color-neutral: oklch(58% 0.01 85);
    --color-muted: oklch(72% 0.01 85);
    --color-ink: oklch(94% 0.01 85);
    --color-ink-body: oklch(82% 0.01 85);
    --color-accent: oklch(72% 0.13 30);
    --color-accent-ink: oklch(14% 0.01 85);
    --color-accent-soft: oklch(72% 0.13 30 / 0.12);
    --color-focus: oklch(70% 0.14 55);
  }
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--color-accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
::selection { background: var(--color-accent-soft); }

.masthead {
  text-align: center;
  padding: var(--space-sm) var(--space-sm) 0;
  position: relative;
  z-index: var(--z-sticky-nav);
}
.mast-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.mast-name {
  display: inline-block;
  margin-top: var(--space-2xs);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  text-decoration: none;
}
.mast-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-xs) 0 var(--space-2xs);
}
.mast-nav .nav-link {
  color: var(--color-ink);
  text-decoration: none;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.mast-nav .nav-link__num {
  font-family: var(--font-mono);
  font-size: 0.68em;
  color: var(--color-muted);
  margin-right: 0.35em;
}
.mast-nav .nav-link:hover { border-bottom-color: var(--color-accent); }
.mast-nav .nav-link.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.mast-nav__actions { display: none; }
.mast-rule {
  border: 0;
  border-top: var(--rule-hair) solid var(--color-ink);
  border-bottom: var(--rule-hair) solid var(--color-ink);
  height: 4px;
  margin: 0;
}
.mast-actions { position: absolute; top: var(--space-sm); right: var(--space-sm); display: flex; gap: var(--space-sm); align-items: center; }
.mast-actions__inline { display: flex; align-items: center; gap: var(--space-sm); }

main {
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  max-width: 72rem;
  margin: 0 auto;
}

/* ---------- 主题切换 / 语言切换 ---------- */
.theme-switch { display: inline-flex; border: 1px solid var(--color-rule); }
.theme-choice {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
  color: var(--color-muted);
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
}
.theme-choice + .theme-choice { border-left: 1px solid var(--color-rule); }
.theme-choice[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-ink); }
.theme-choice:active { background: var(--color-paper-2); }
.theme-choice[aria-pressed="true"]:active { background: var(--color-accent); opacity: 0.85; }
.lang-switch-group { display: inline-flex; gap: var(--space-2xs); }
.lang-switch {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
}
.lang-switch:hover { color: var(--color-accent); }
.lang-switch--current { color: var(--color-ink); text-decoration: underline; text-underline-offset: 3px; }
.lang-drawer { position: relative; display: none; }
.lang-drawer__toggle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  color: var(--color-ink);
  padding: 5px 8px;
  cursor: pointer;
}
.lang-drawer__toggle:active { background: var(--color-paper-2); }
.lang-drawer__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
  z-index: var(--z-dropdown);
  min-width: 9rem;
  display: none;
}
.lang-drawer.is-open .lang-drawer__panel { display: block; }
.lang-drawer.is-open .lang-drawer__arrow { transform: rotate(180deg); }
.lang-drawer__panel-inner { display: flex; flex-direction: column; }
.lang-drawer__btn {
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.lang-drawer__btn:hover { background: var(--color-paper-2); }
.lang-drawer__btn--current { color: var(--color-accent); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-rule);
  width: 38px;
  height: 34px;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.nav-toggle span { display: block; width: 18px; height: 1px; background: var(--color-ink); }
.nav-toggle:active { background: var(--color-paper-2); }
.bp-drawer-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-rule);
  width: 38px;
  height: 34px;
  cursor: pointer;
  padding: 6px;
  align-items: center;
  justify-content: center;
}
.bp-drawer-toggle__dots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.bp-drawer-toggle__dots span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--color-ink);
}
.bp-drawer-toggle:active { background: var(--color-paper-2); }
.bp-drawer {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  width: min(19rem, calc(100vw - 2rem));
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
  padding: var(--space-sm);
  z-index: var(--z-dropdown);
}
.bp-drawer[hidden] { display: none; }
.bp-drawer__group + .bp-drawer__group {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-rule);
}
.bp-drawer__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-2xs);
}

/* ---------- 首页：头版 ---------- */
.front-lead {
  padding-bottom: var(--space-xl);
  border-bottom: 2px double var(--color-rule);
  margin-bottom: var(--space-2xl);
}
.front-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-sm);
}
.front-head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-sm);
  max-width: 22ch;
  overflow-wrap: anywhere;
  min-width: 0;
  color: var(--color-ink);
}
.front-lede { font-size: var(--text-lg); line-height: 1.5; max-width: 58ch; margin: 0 0 var(--space-sm); }
:lang(en) .front-lede::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  float: left;
  font-size: 2.9em;
  line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
  color: var(--color-accent);
}
:lang(zh) .front-lede::first-letter,
:lang(ja) .front-lede::first-letter {
  float: none;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
}
.front-skills { color: var(--color-muted); max-width: 58ch; }
.front-skills strong { color: var(--color-accent); font-weight: 500; }

.front-section { padding-bottom: var(--space-2xl); }
.front-section + .front-section { border-top: 2px double var(--color-rule); padding-top: var(--space-2xl); }
.front-section__head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.1;
  margin: 0 0 var(--space-md);
  color: var(--color-ink);
}
.front-column { max-width: 46rem; }
.front-text { max-width: 58ch; }
.front-more { margin: var(--space-sm) 0 0; }

/* ---------- 列表行（作品/博客/长文） ---------- */
.rows { border-top: 1px solid var(--color-rule); }
.row {
  display: grid;
  gap: var(--space-sm);
  align-items: baseline;
  border-bottom: 1px solid var(--color-rule);
  padding: var(--space-sm) 0;
  text-decoration: none;
  color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.row:hover { background: var(--color-paper-2); }
.row--work { grid-template-columns: 3.5ch 6ch minmax(0, 1fr) auto; }
.row--post { grid-template-columns: 10ch minmax(0, 1fr) auto; }
.row__num { font-family: var(--font-mono); color: var(--color-muted); font-size: var(--text-sm); }
.row__date { font-family: var(--font-mono); color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); line-height: 1.25; color: var(--color-ink); }
.row:hover .row__title { color: var(--color-accent); }
.row__summary, .row__excerpt { color: var(--color-muted); font-size: var(--text-sm); }
.row__meta { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.row__role { color: var(--color-muted); font-size: var(--text-sm); }
.row__tags { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); text-align: right; }

/* ---------- 页面头（列表/关于/联系/档案） ---------- */
.page-head { padding-bottom: var(--space-md); border-bottom: 2px double var(--color-rule); margin-bottom: var(--space-lg); }
.page-head__kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-2xs);
}
.page-head__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.05;
  margin: 0 0 var(--space-xs);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
.page-head__intro { color: var(--color-muted); max-width: 60ch; margin: 0; }
.archive-rule { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--color-muted); margin: var(--space-xs) 0 0; }

/* ---------- 文章页 ---------- */
.article-head { padding-bottom: var(--space-md); border-bottom: 2px double var(--color-rule); margin-bottom: var(--space-lg); }
.article-head__kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-2xs);
}
.article-head__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-sm);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
.article-head__standfirst { font-size: var(--text-lg); line-height: 1.5; max-width: 56ch; color: var(--color-ink-body); }
.article-head__meta { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin: var(--space-sm) 0 0; }
.article-head__meta div { display: flex; gap: var(--space-2xs); font-size: var(--text-sm); }
.article-head__meta dt { color: var(--color-muted); }
.article-head__meta dd { margin: 0; }
.article-head__links { margin: var(--space-sm) 0 0; }
.article-foot { border-top: 1px solid var(--color-rule); margin-top: var(--space-2xl); padding-top: var(--space-md); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); align-items: baseline; }

.essay-layout, .poster-essay-layout, .term-essay-layout {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--space-xl);
}
.essay-toc-wrap { min-width: 0; }
.essay-toc { border-left: 1px solid var(--color-rule); padding-left: var(--space-sm); position: sticky; top: var(--space-sm); }
.essay-toc__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-xs); }
.essay-toc__label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); margin: 0; }
.essay-toc__toggle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: none;
  border: 0;
  color: var(--color-accent);
  cursor: pointer;
  padding: 2px;
}
.toc__list { list-style: none; margin: var(--space-xs) 0 0; padding: 0; }
.toc__list li { margin: 2px 0; }
.toc__list a { color: var(--color-ink-body); text-decoration: none; font-size: var(--text-sm); line-height: 1.4; }
.toc__list a:hover { color: var(--color-accent); }
.toc__list .num { font-family: var(--font-mono); color: var(--color-muted); margin-right: 0.4em; font-size: 0.8em; }
.toc-group-toggle { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); background: none; border: 0; cursor: pointer; padding: 0 0 0 0.4em; }
.toc-subs { list-style: none; padding-left: 1.4em; }
.toc-progress { margin-top: var(--space-sm); display: flex; align-items: center; gap: var(--space-2xs); }
.toc-progress__track { flex: 1; height: 2px; background: var(--color-rule); }
.toc-progress__bar { display: block; height: 2px; background: var(--color-accent); transform-origin: left; }
.toc-progress__num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }

.essay-cover { margin: 0 0 var(--space-lg); }
.essay-cover img { width: 100%; display: block; border: 1px solid var(--color-rule); }
.essay-end { font-family: var(--font-display); color: var(--color-accent); font-size: var(--text-xl); }

/* ---------- 正文 ---------- */
.prose { max-width: 65ch; }
.prose p { margin: 0 0 1.1em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.15;
  margin: 1.8em 0 0.6em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  margin: 1.5em 0 0.5em;
  color: var(--color-ink);
}
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: 0.3em 0; }
.prose a { text-underline-offset: 3px; }
.prose blockquote {
  margin: 0 0 1.1em;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: var(--text-md);
}
.prose hr { border: 0; border-top: 2px double var(--color-rule); margin: var(--space-xl) 0; }
.prose mark { background: var(--color-accent-soft); color: inherit; padding: 0 0.2em; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-paper-2);
  padding: 0.1em 0.35em;
}
.prose pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  padding: var(--space-sm);
  overflow-x: auto;
}
.table-wrap { overflow-x: auto; margin: 0 0 1.1em; }
.prose table { border-collapse: collapse; font-size: var(--text-sm); width: 100%; }
.prose th, .prose td { border: 1px solid var(--color-rule); padding: 6px 10px; text-align: left; }
.prose th { background: var(--color-paper-2); font-family: var(--font-mono); font-weight: 500; }

/* Rich article blocks (Hallmark · component: article-prose · theme: Newsprint) */
.prose .prose-figure { margin: var(--space-lg) 0; }
.prose .prose-figure img { display: block; width: 100%; border: 1px solid var(--color-rule); }
.prose .prose-figure figcaption {
  margin-top: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-muted);
  text-align: center;
}
.prose .callout {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-rule);
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-soft);
}
.prose .callout--tip { border-left-width: 2px; }
.prose .callout--warning {
  border-left-width: 4px;
  background: var(--color-paper-2);
}
.prose .callout__label {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.prose .callout--warning .callout__label { color: var(--color-ink); }
.prose .callout__body p { margin: 0 0 var(--space-2xs); }
.prose .callout__body p:last-child { margin-bottom: 0; }
.prose li.task-list-item {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.prose li.task-list-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--color-accent);
  transform: translateY(2px);
}
.prose pre[data-lang] { position: relative; padding-top: calc(var(--space-sm) + 1.1rem); }
.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.prose h2, .prose h3 { position: relative; }
.prose .heading-anchor {
  display: inline-block;
  margin-left: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.7em;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease-out);
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose .heading-anchor:focus-visible { opacity: 1; }

.text-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- 联系行 ---------- */
.contact-rows, .t-contact .contact-rows { display: grid; }
.contact-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: baseline;
  border-bottom: 1px solid var(--color-rule);
  padding: var(--space-sm) 0;
  text-decoration: none;
  color: var(--color-ink);
  max-width: 42rem;
}
.contact-row:hover .contact-row__value { color: var(--color-accent); }
.contact-row__label { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }
.contact-row__value { font-family: var(--font-display); font-size: var(--text-md); }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.pager__item { text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.pager__item--next { text-align: right; }
.pager__label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.pager__title { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; }
.pager__item:hover .pager__title { color: var(--color-accent); }

/* ---------- 风格档案卡片 ---------- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-lg);
}
.style-card { position: relative; border-top: 2px double var(--color-rule); padding-top: var(--space-sm); }
.style-card__preview { display: block; border: 1px solid var(--color-rule); line-height: 0; }
.style-card__preview img { width: 100%; display: block; }
.style-card__meta { display: flex; flex-direction: column; gap: var(--space-2xs); padding-top: var(--space-sm); }
.style-card__week { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; color: var(--color-muted); margin: 0; }
.style-card__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); margin: 0; color: var(--color-ink); }
.style-card__summary { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }
.style-card__link { margin-top: var(--space-2xs); }
.style-card__badge {
  position: absolute;
  top: -1px;
  right: 0;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  padding: 3px 8px;
}

/* ---------- 页脚 ---------- */
.colophon {
  border-top: 2px double var(--color-ink);
  margin-top: var(--space-2xl);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  text-align: center;
}
.colophon__dense {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-muted);
  max-width: 60rem;
  margin: 0 auto;
  line-height: 1.8;
}
.colophon__dense a { color: var(--color-accent); }
.colophon__admin, .colophon__icp { margin-left: 0.6em; }

.to-top {
  position: fixed;
  right: var(--space-sm);
  bottom: var(--space-sm);
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-rule);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-md);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
  z-index: var(--z-sticky);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }
.to-top:active { transform: translateY(0); }

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform-origin: left;
  z-index: 500;
}

/* ---------- 动效：印刷上版 / 滚动显现 / hover ---------- */
.mast-line,
.mast-name,
.mast-nav {
  opacity: 0;
  animation: np-rise-in 0.6s var(--ease-out) forwards;
}
.mast-line { animation-delay: 0.05s; }
.mast-name { animation-delay: 0.15s; }
.mast-nav { animation-delay: 0.25s; }
.mast-rule {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  animation: np-rule-draw 0.55s var(--ease-out) 0.42s forwards;
}

.front-lead > * {
  opacity: 0;
  animation: np-rise-in 0.65s var(--ease-out) forwards;
}
.front-kicker { animation-delay: 0.35s; }
.front-lead__body { animation-delay: 0.55s; }
.front-head {
  opacity: 0;
  transform: translateY(0.2em);
  animation: np-press-in 0.72s cubic-bezier(0.22, 1.32, 0.36, 1) 0.46s forwards;
}

.js-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* 栏目标题：墨线拉出 */
.front-section__head {
  position: relative;
  padding-bottom: 0.4rem;
}
.front-section__head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4.5rem;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.front-section__head.is-inview::after {
  animation: np-rule-draw 0.6s var(--ease-out) 0.18s both;
}

/* 文章 / 列表页头：日期滑入 + 标题压印 */
.page-head.is-inview .page-head__kicker,
.article-head.is-inview .article-head__kicker {
  animation: np-kicker-in 0.42s var(--ease-out) both;
}
.page-head.is-inview .page-head__title,
.article-head.is-inview .article-head__title {
  animation: np-press-in 0.62s cubic-bezier(0.22, 1.32, 0.36, 1) 0.08s both;
}

.row {
  position: relative;
  transition: background-color var(--dur-micro) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}
.row:hover { transform: translateX(4px); }
.row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur-short) var(--ease-out);
}
.row:hover::before { transform: scaleY(1); }
.row__title {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: color var(--dur-micro) var(--ease-out),
    background-size var(--dur-long) var(--ease-out);
}
.row:hover .row__title { background-size: 100% 1px; }

@keyframes np-rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes np-rule-draw {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}
@keyframes np-press-in {
  0% { opacity: 0; transform: translateY(0.2em); }
  62% { opacity: 1; transform: translateY(-0.015em); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-kicker-in {
  from { opacity: 0; transform: translateX(-0.8rem); }
  to { opacity: 1; transform: none; }
}

@media print {
  .masthead, .to-top, .reading-progress, .nav-toggle, .lang-drawer { display: none !important; }
  .mast-line, .mast-name, .mast-nav, .mast-rule,
  .front-lead > *,
  .js-reveal, .js-reveal.is-inview,
  .front-section__head::after,
  .page-head.is-inview .page-head__kicker,
  .page-head.is-inview .page-head__title,
  .article-head.is-inview .article-head__kicker,
  .article-head.is-inview .article-head__title {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .row::before { display: none; }
  body { background: #fff !important; color: #000 !important; }
  .front-page, .index-page__body, .article-page { max-width: none; }
  .mast-line, .mast-name, .mast-nav, .mast-rule,
  .front-lead > *,
  .js-reveal, .js-reveal.is-inview {
    opacity: 1 !important;
    transform: none !important;
  }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
}

/* ---------- 根目录页 ---------- */
.root-page { max-width: 46rem; margin: 0 auto; padding: var(--space-xl) var(--space-md); }
.root-links { display: flex; flex-direction: column; margin-top: var(--space-lg); }
.root-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  border-bottom: 1px solid var(--color-rule);
  padding: var(--space-sm) 0;
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
}
.root-link:hover { color: var(--color-accent); }
.root-link .num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.root-link .arrow { color: var(--color-accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 40rem) {
  .masthead {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-sm);
    text-align: left;
    padding: var(--space-sm);
  }
  .mast-line { display: none; }
  .mast-name {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    font-size: var(--text-md);
    white-space: nowrap;
  }
  .mast-nav {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0 var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    scrollbar-width: none;
  }
  .mast-nav::-webkit-scrollbar { display: none; }
  .mast-nav .nav-link {
    flex: 0 0 auto;
    padding: 2px 0;
    border-bottom: 1px solid transparent;
  }
  .mast-actions {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
    padding: 0;
  }
  .mast-actions__inline { display: none; }
  .bp-drawer-toggle { display: flex; }
  .bp-drawer { display: block; }
  .bp-drawer .theme-switch { width: 100%; }
  .bp-drawer .theme-choice { flex: 1; text-align: center; }
  .bp-drawer .lang-switch-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .bp-drawer .lang-switch,
  .bp-drawer .lang-switch--current {
    display: block;
    padding: var(--space-2xs) 0;
    border-bottom: 1px solid var(--color-rule);
    text-decoration: none;
  }
  .bp-drawer .lang-switch:last-child,
  .bp-drawer .lang-switch--current:last-child { border-bottom: 0; }
  .mast-rule { grid-column: 1 / -1; }
  main { padding: var(--space-lg) var(--space-sm) var(--space-xl); }
  .row--work { grid-template-columns: 3.5ch minmax(0, 1fr); row-gap: var(--space-3xs); }
  .row--work .row__date { display: none; }
  .row--work .row__body { grid-column: 2; grid-row: 1; }
  .row--work .row__meta { grid-column: 2; grid-row: 2; justify-items: start; text-align: left; }
  .row--post { grid-template-columns: minmax(0, 1fr); }
  .row--post .row__num { display: none; }
  .row--post .row__tags { grid-column: 1; grid-row: 2; text-align: left; white-space: normal; }
  .row__meta { align-items: flex-start; }
  .essay-layout, .poster-essay-layout, .term-essay-layout { grid-template-columns: minmax(0, 1fr); }
  .essay-toc-wrap { order: -1; }
  .essay-toc { position: static; }
  .front-head { font-size: clamp(1.9rem, 8vw, 2.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .mast-line, .mast-name, .mast-nav, .mast-rule,
  .front-lead > *,
  .js-reveal, .js-reveal.is-inview {
    opacity: 1 !important;
    transform: none !important;
  }
  .front-section__head::after,
  .page-head.is-inview .page-head__kicker,
  .page-head.is-inview .page-head__title,
  .article-head.is-inview .article-head__kicker,
  .article-head.is-inview .article-head__title {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .row::before { display: none; }
}

/* ==========================================================================
 * 动效升级 ·「印刷机开动」（2026-08-31 redesign）
 * Hallmark · redesign: newsprint motion layer · genre: editorial
 * macrostructure: Long Document · theme: Newsprint · enrichment: Tier-A CSS
 * (ink blot / register mark / printer's seal)
 * motion vocabulary: ink-draw · press · rise · stamp · shift
 * pre-emit critique: P5 H4 E5 S5 R4 V4 · contrast: pass (40-41)
 * nav: N6 · footer: Ft4 · slop: pass (42-45) · honest: pass (46)
 * chrome: pass (47) · tokens: pass (48) · responsive: pass (49)
 * mobile: pass (34, 49, 50-57) · reduced-motion: collapse to static
 * print: force visible
 * ========================================================================== */

/* ---------- 排版润色 ---------- */
.mast-name,
.front-head,
.front-section__head,
.page-head__title,
.article-head__title,
.row__title,
.prose h2,
.prose h3,
.pager__title,
.style-card__name {
  text-wrap: balance;
  font-optical-sizing: auto;
}
.mast-line,
.page-head__kicker,
.article-head__kicker,
.row__num,
.row__date,
.toc-progress__num,
.colophon__dense,
.style-card__week {
  font-variant-numeric: tabular-nums;
}

/* ---------- 刊头：压印 + 套准标记 ---------- */
.mast-name {
  animation-name: np-press-in;
  animation-duration: 0.7s;
  animation-delay: 0.15s;
  animation-timing-function: cubic-bezier(0.22, 1.2, 0.36, 1);
}
.mast-rule { position: relative; }
.mast-rule::after {
  content: '';
  position: absolute;
  right: 0.65rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--color-accent);
  opacity: 0;
  transform: translateY(-50%) rotate(45deg) scale(0.6);
  animation: np-register-in 0.45s var(--ease-out) 0.9s forwards;
}

/* 导航链接：墨线下画线（替代整条边框变色） */
.mast-nav .nav-link { position: relative; }
.mast-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-short) var(--ease-out);
}
.mast-nav .nav-link:hover,
.mast-nav .nav-link.active {
  border-bottom-color: transparent;
}
.mast-nav .nav-link:hover::after,
.mast-nav .nav-link.active::after,
.mast-nav .nav-link:focus-visible::after {
  transform: scaleX(1);
}

/* ---------- 头版：墨渍晕开 + 首段上版 ---------- */
.front-lead__body { position: relative; }
.front-lead__body::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.8rem;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-soft), transparent 66%);
  opacity: 0;
  transform: scale(0.35);
  animation: np-blot-in 0.85s var(--ease-out) 0.85s forwards;
  pointer-events: none;
}

/* ---------- 文章页头：元信息错峰上版 ---------- */
html.np-motion .article-head__meta div { opacity: 0; }
html.np-motion .article-head.is-inview .article-head__meta div {
  animation: np-rise-in 0.45s var(--ease-out) forwards;
}
html.np-motion .article-head.is-inview .article-head__meta div:nth-child(1) { animation-delay: 0.16s; }
html.np-motion .article-head.is-inview .article-head__meta div:nth-child(2) { animation-delay: 0.24s; }
html.np-motion .article-head.is-inview .article-head__meta div:nth-child(3) { animation-delay: 0.32s; }
html.np-motion .article-head.is-inview .article-head__meta div:nth-child(4) { animation-delay: 0.4s; }

/* ---------- 列表行：编号滑入 + hover 墨印 ---------- */
.row.is-inview .row__num {
  animation: np-tab-in 0.4s var(--ease-out) both;
  animation-delay: calc(var(--reveal-delay, 0ms) + 90ms);
}
.row__num {
  transition: color var(--dur-micro) var(--ease-out);
}
.row:hover .row__num,
.row:focus-visible .row__num {
  color: var(--color-accent);
}
.row:hover .row__date,
.row:focus-visible .row__date {
  color: var(--color-ink);
}
.row:hover .row__title,
.row:focus-visible .row__title {
  background-size: 100% 1px;
}
.row:hover::before,
.row:focus-visible::before {
  transform: scaleY(1);
}
.row:hover,
.row:focus-visible {
  transform: translateX(4px);
}

/* ---------- 正文：h2 墨线、引言/代码/标注滚动显现 ---------- */
.prose h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 4.5rem;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.prose h2.is-inview::after {
  animation: np-rule-draw 0.55s var(--ease-out) 0.25s both;
}

.prose blockquote { position: relative; }
.prose blockquote::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
}
.prose blockquote.is-inview::before {
  animation: np-rule-v 0.5s var(--ease-out) 0.18s both;
}

.prose pre { position: relative; }
.prose pre::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
}
.prose pre.is-inview::after {
  animation: np-rule-v 0.5s var(--ease-out) 0.15s both;
}

html.np-motion .prose blockquote,
html.np-motion .prose pre,
html.np-motion .prose .callout,
html.np-motion .prose .prose-figure,
html.np-motion .essay-end,
html.np-motion .article-foot,
html.np-motion .style-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
html.np-motion .prose blockquote.is-inview,
html.np-motion .prose pre.is-inview,
html.np-motion .prose .callout.is-inview,
html.np-motion .prose .prose-figure.is-inview,
html.np-motion .essay-end.is-inview,
html.np-motion .article-foot.is-inview,
html.np-motion .style-card.is-inview {
  opacity: 1;
  transform: none;
}

html.np-motion .prose .callout.is-inview .callout__label {
  animation: np-tab-in 0.4s var(--ease-out) 0.2s both;
}
html.np-motion .essay-end.is-inview {
  animation: np-seal-pop 0.45s var(--ease-out) 0.1s both;
}

.prose code {
  transition: background-color var(--dur-micro) var(--ease-out);
}
.prose code:hover {
  background: var(--color-accent-soft);
}

/* ---------- TOC：当前章节墨标 ---------- */
.toc__list a {
  position: relative;
  display: inline-block;
  padding-left: 0.9em;
  margin-left: -0.9em;
  transition: color var(--dur-micro) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}
.toc__list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur-short) var(--ease-out);
}
.toc__list a:focus-visible::before {
  transform: scaleY(1);
}
.toc__list a:hover {
  transform: translateX(3px);
}
.toc__list .num {
  transition: color var(--dur-micro) var(--ease-out);
}
.toc__list a:hover .num,
.toc__list a.active .num {
  color: var(--color-accent);
}

/* ---------- 联系行：展开位移 ---------- */
.contact-row {
  position: relative;
  transition: transform var(--dur-short) var(--ease-out);
}
.contact-row:hover,
.contact-row:focus-visible {
  transform: translateX(6px);
}
.contact-row:hover .contact-row__label,
.contact-row:focus-visible .contact-row__label {
  color: var(--color-accent);
}

/* ---------- 分页：悬停微抬 ---------- */
.pager__item {
  transition: transform var(--dur-short) var(--ease-out);
}
.pager__item:hover,
.pager__item:focus-visible {
  transform: translateY(-2px);
}

/* ---------- 档案卡片：预览缩放 + 徽章盖落 ---------- */
.style-card__preview { overflow: hidden; }
.style-card__preview img {
  transition: transform 0.45s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .style-card__preview:hover img,
  .style-card__preview:focus-visible img {
    transform: scale(1.035);
  }
}
.style-card.is-inview .style-card__badge {
  animation: np-stamp-in 0.45s var(--ease-out) 0.15s both;
  transform-origin: center;
}

/* ---------- 报尾：印鉴盖落 ---------- */
.colophon { position: relative; }
.colophon::before,
.colophon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -9px;
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%) rotate(-8deg) scale(0.6);
  pointer-events: none;
}
.colophon::before {
  width: 7px;
  height: 7px;
  margin-left: 0;
  border: 1px solid var(--color-accent);
  animation: np-seal-dot-in 0.4s var(--ease-out) 0.75s forwards;
}
.colophon::after {
  width: 34px;
  height: 34px;
  margin-left: 0;
  border: 1.5px solid var(--color-accent);
  animation: np-seal-in 0.5s var(--ease-out) 0.9s forwards;
}

/* ---------- 主题/语言切换：按压 ---------- */
.theme-choice {
  transition: background-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}
.theme-choice:hover { color: var(--color-ink); }
.theme-choice:active { transform: scale(0.97); }
.lang-drawer.is-open .lang-drawer__panel {
  animation: np-drop-in 0.18s var(--ease-out);
}
.bp-drawer:not([hidden]) {
  animation: np-drop-in 0.22s var(--ease-out);
}

/* ---------- 根目录页：语言链接错峰上版 ---------- */
.root-link {
  opacity: 0;
  animation: np-rise-in 0.5s var(--ease-out) forwards;
  transition: transform var(--dur-short) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}
.root-link:nth-child(1) { animation-delay: 0.35s; }
.root-link:nth-child(2) { animation-delay: 0.45s; }
.root-link:nth-child(3) { animation-delay: 0.55s; }
.root-link:hover,
.root-link:focus-visible {
  transform: translateX(6px);
}
.root-link .num {
  transition: color var(--dur-micro) var(--ease-out);
}
.root-link:hover .num,
.root-link:focus-visible .num {
  color: var(--color-accent);
}
.root-link .arrow {
  display: inline-block;
  transition: transform var(--dur-short) var(--ease-out);
}
.root-link:hover .arrow,
.root-link:focus-visible .arrow {
  transform: translateX(4px);
}

/* ---------- 新关键帧 ---------- */
@keyframes np-register-in {
  0% { opacity: 0; transform: translateY(-50%) rotate(45deg) scale(0.6); }
  55% { opacity: 1; transform: translateY(-50%) rotate(45deg) scale(1.12); }
  100% { opacity: 0.85; transform: translateY(-50%) rotate(45deg) scale(1); }
}
@keyframes np-stamp-in {
  0% { opacity: 0; transform: scale(0.6); }
  55% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0.85; transform: scale(1); }
}
@keyframes np-seal-dot-in {
  0% { opacity: 0; transform: translateX(-50%) rotate(-8deg) scale(0.6); }
  55% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1.12); }
  100% { opacity: 0.85; transform: translateX(-50%) rotate(-8deg) scale(1); }
}
@keyframes np-blot-in {
  0% { opacity: 0; transform: scale(0.35); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes np-tab-in {
  from { opacity: 0; transform: translateX(-0.5rem); }
  to { opacity: 1; transform: none; }
}
@keyframes np-rule-v {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes np-seal-in {
  0% { opacity: 0; transform: translateX(-50%) rotate(-14deg) scale(0.55); }
  60% { opacity: 0.95; transform: translateX(-50%) rotate(-5deg) scale(1.08); }
  100% { opacity: 0.85; transform: translateX(-50%) rotate(-8deg) scale(1); }
}
@keyframes np-seal-pop {
  0% { opacity: 0; transform: scale(0.72); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-drop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- reduced-motion：全部坍缩 ---------- */
@media (prefers-reduced-motion: reduce) {
  html.np-motion .article-head__meta div,
  html.np-motion .prose blockquote,
  html.np-motion .prose pre,
  html.np-motion .prose .callout,
  html.np-motion .prose .prose-figure,
  html.np-motion .essay-end,
  html.np-motion .article-foot,
  html.np-motion .style-card {
    opacity: 1 !important;
    transform: none !important;
  }
  .root-link {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .mast-rule::after,
  .colophon::before,
  .colophon::after,
  .front-lead__body::before {
    display: none !important;
  }
  .row.is-inview .row__num,
  .row:hover .row__num,
  .row:focus-visible .row__num {
    animation: none !important;
    color: var(--color-muted);
  }
  .mast-nav .nav-link::after,
  .toc__list a::before,
  .prose h2::after,
  .prose blockquote::before,
  .prose pre::after {
    display: none !important;
  }
  .row:hover,
  .row:focus-visible,
  .contact-row:hover,
  .contact-row:focus-visible,
  .root-link:hover,
  .root-link:focus-visible {
    transform: none !important;
  }
}

/* ---------- 打印：内容强制显形 ---------- */
@media print {
  html.np-motion .article-head__meta div,
  html.np-motion .prose blockquote,
  html.np-motion .prose pre,
  html.np-motion .prose .callout,
  html.np-motion .prose .prose-figure,
  html.np-motion .essay-end,
  html.np-motion .article-foot,
  html.np-motion .style-card,
  .root-link {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .mast-rule::after,
  .colophon::before,
  .colophon::after,
  .front-lead__body::before {
    display: none !important;
  }
  .mast-nav .nav-link::after,
  .toc__list a::before,
  .prose h2::after,
  .prose blockquote::before,
  .prose pre::after {
    display: none !important;
  }
}

/* ==========================================================================
 * 动效升级 v2 · 冲击力增强（2026-08-31）
 * 新增：全屏墨辊横扫 · 逐字压印首页标题 · 行内墨洗 · 引用大引号
 *      TOC 滑动墨标 · 阅读数据计数 · 阅读进度墨辊 · 卡片 3D 倾斜
 * pre-emit critique: P5 H5 E5 S5 R3 V4（按用户要求提高动效密度）
 * ========================================================================== */

/* ---------- 全屏墨辊横扫（一次） ---------- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 26vw;
  height: 100dvh;
  background: var(--color-accent);
  transform: translateX(-140%) skewX(-12deg);
  opacity: 0;
  animation: np-roller-sweep 0.75s var(--ease-in-out) 0.05s forwards;
  pointer-events: none;
  z-index: 350;
}

/* ---------- 刊头 v2：更硬的压印 ---------- */
.mast-line {
  animation: np-drop-slam 0.45s var(--ease-out) 0.05s both;
}
.mast-name {
  animation-name: np-head-press;
  animation-duration: 0.62s;
  animation-delay: 0.08s;
  animation-timing-function: cubic-bezier(0.22, 1.2, 0.36, 1);
}
.mast-nav {
  opacity: 1 !important;
  animation: none !important;
}
.mast-nav .nav-link {
  opacity: 0;
  animation: np-rise-in 0.42s var(--ease-out) forwards;
}
.mast-nav .nav-link:nth-child(1) { animation-delay: 0.22s; }
.mast-nav .nav-link:nth-child(2) { animation-delay: 0.28s; }
.mast-nav .nav-link:nth-child(3) { animation-delay: 0.34s; }
.mast-nav .nav-link:nth-child(4) { animation-delay: 0.4s; }
.mast-nav .nav-link:nth-child(5) { animation-delay: 0.46s; }
.mast-nav .nav-link:nth-child(6) { animation-delay: 0.52s; }
.mast-actions {
  opacity: 0;
  animation: np-rise-in 0.4s var(--ease-out) 0.55s forwards;
}
.mast-rule {
  animation: np-rule-slam 0.5s cubic-bezier(0.22, 1.15, 0.36, 1) 0.32s forwards;
}
.mast-rule::after {
  animation: np-register-in 0.45s var(--ease-out) 0.58s forwards;
}

/* ---------- 头版 v2：逐字压印 + 更强上版 ---------- */
.front-head.np-chars {
  animation: none;
  opacity: 1;
  transform: none;
}
.front-head .np-char {
  display: inline-block;
  white-space: pre;
  opacity: 0;
  animation: np-char-press 0.45s var(--ease-out) both;
}
.front-kicker {
  animation: np-slide-slam 0.45s var(--ease-out) 0.3s both;
}
.front-lead__body {
  animation: np-rise-strong 0.55s var(--ease-out) 0.52s both;
}
.front-lead__body::before {
  width: 9.5rem;
  height: 9.5rem;
  left: 0.2rem;
  top: 0.6rem;
  animation: np-blot-in 0.9s var(--ease-out) 0.95s forwards;
}

/* ---------- 栏目标题 v2：墨线重锤 ---------- */
.front-section__head.is-inview::after {
  animation: np-rule-slam 0.42s cubic-bezier(0.22, 1.15, 0.36, 1) 0.12s both;
}

/* ---------- 列表行 v2：墨洗横扫 + 编号盖章 ---------- */
html.np-motion .row.js-reveal {
  opacity: 0;
  transform: translateY(22px) rotate(0.35deg);
}
.row { overflow: hidden; }
.row > * { position: relative; z-index: 1; }
.row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-accent-soft);
  transform: translateX(-101%);
  transition: transform 0.4s var(--ease-out);
  z-index: 0;
  pointer-events: none;
}
.row:hover::after,
.row:focus-visible::after {
  transform: translateX(0);
}
.row:hover .row__num,
.row:focus-visible .row__num {
  animation: np-stamp-press 0.32s var(--ease-out);
}
.row:active {
  transform: translateX(2px);
}

/* ---------- 正文 v2：引用大引号 + 代码标注 + 标注栏 + 图注 ---------- */
.prose blockquote::after {
  content: '\201C';
  position: absolute;
  top: -0.4rem;
  right: 0.2rem;
  z-index: -1;
  font-family: var(--font-display);
  font-size: 4.2rem;
  line-height: 1;
  color: var(--color-accent-soft);
  opacity: 0;
  transform: scale(0.55) rotate(-8deg);
  pointer-events: none;
}
.prose blockquote.is-inview::after {
  animation: np-stamp-in 0.5s var(--ease-out) 0.22s both;
}
html.np-motion .prose pre::before {
  opacity: 0;
  transform: translateX(-0.4rem);
}
html.np-motion .prose pre.is-inview::before {
  animation: np-tab-in 0.4s var(--ease-out) 0.2s both;
}
.prose .callout { position: relative; }
.prose .callout::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
}
.prose .callout.is-inview::before {
  animation: np-rule-v 0.5s var(--ease-out) 0.15s both;
}
html.np-motion .prose .prose-figure figcaption {
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: opacity 0.4s var(--ease-out),
    transform 0.4s var(--ease-out);
}
html.np-motion .prose .prose-figure.is-inview figcaption {
  opacity: 1;
  transform: none;
}
.article-head__meta dd,
.row__num,
.row__date,
.pager__label {
  font-variant-numeric: tabular-nums;
}

/* ---------- 文章/列表页头 v2：标题重压 ---------- */
.page-head.is-inview .page-head__title,
.article-head.is-inview .article-head__title {
  animation: np-head-press 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) 0.08s both;
}

/* ---------- TOC v2：滑动墨标 ---------- */
.toc__list { position: relative; }
.toc__list::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: var(--toc-h, 1.1em);
  background: var(--color-accent);
  transform: translateY(var(--toc-y, 0));
  transition: transform 0.25s var(--ease-in-out);
  opacity: 0.9;
  pointer-events: none;
}

/* ---------- 阅读进度 v2：墨辊 ---------- */
.reading-progress { height: 4px; }
.np-ink-dot {
  position: fixed;
  top: 0;
  width: 11px;
  height: 11px;
  margin-top: -3.5px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-paper);
  z-index: 600;
  pointer-events: none;
}

/* ---------- 档案卡片 v2：3D 倾斜 ---------- */
.style-card__preview {
  transform: perspective(900px);
  transition: transform 0.45s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .style-card:hover .style-card__preview {
    transform: perspective(900px) rotateX(4deg) rotateY(-3deg) translateY(-2px);
  }
}
.style-card__preview img {
  transition: none;
}

/* ---------- 根目录 v2：更强上版 ---------- */
.root-link {
  animation-name: np-rise-strong;
  animation-duration: 0.5s;
}
.root-link:nth-child(1) { animation-delay: 0.28s; }
.root-link:nth-child(2) { animation-delay: 0.38s; }
.root-link:nth-child(3) { animation-delay: 0.48s; }

/* ---------- v2 关键帧 ---------- */
@keyframes np-roller-sweep {
  0% { opacity: 0; transform: translateX(-140%) skewX(-12deg); }
  10% { opacity: 0.12; }
  60% { opacity: 0.06; }
  100% { opacity: 0; transform: translateX(210%) skewX(-12deg); }
}
@keyframes np-char-press {
  0% { opacity: 0; transform: translateY(0.32em) scale(1.1) rotate(1.5deg); }
  62% { opacity: 1; transform: translateY(-0.02em) scale(0.99) rotate(-0.4deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-drop-slam {
  0% { opacity: 0; transform: translateY(-0.9rem); }
  62% { opacity: 1; transform: translateY(0.04rem); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-head-press {
  0% { opacity: 0; transform: scale(1.14) rotate(-1deg); }
  58% { opacity: 1; transform: scale(0.985) rotate(0.25deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-slide-slam {
  0% { opacity: 0; transform: translateX(-1.2rem); }
  62% { opacity: 1; transform: translateX(0.05rem); }
  100% { opacity: 1; transform: none; }
}
@keyframes np-rise-strong {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes np-rule-slam {
  0% { opacity: 0; transform: scaleX(0); }
  62% { opacity: 1; transform: scaleX(1.015); }
  100% { opacity: 1; transform: scaleX(1); }
}
@keyframes np-stamp-press {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* ---------- v2 reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body::after,
  .np-ink-dot,
  .toc__list::before {
    display: none !important;
  }
  .mast-nav .nav-link,
  .mast-actions {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
  .front-head .np-char {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  html.np-motion .row.js-reveal,
  .row.js-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .row::after,
  .prose blockquote::after {
    display: none !important;
  }
  .prose .callout::before,
  .prose pre::before {
    display: none !important;
  }
}

/* ---------- v2 打印 ---------- */
@media print {
  body::after,
  .np-ink-dot,
  .toc__list::before,
  .prose blockquote::after {
    display: none !important;
  }
  .front-head .np-char {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .front-head.np-chars {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .mast-nav .nav-link,
  .mast-actions {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
  .row::after,
  .prose .callout::before,
  .prose pre::before {
    display: none !important;
  }
  html.np-motion .row.js-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
 * v3 · 修复与排版（2026-08-31）
 * 1) 修复优先级 bug：列表行 hidden 状态（0,2,1）曾压过 is-inview（0,2,0），
 *    导致作品/博客/长文列表内容永远不可见。
 * 2) 动效防呆：所有入场动画改 backwards 填充 + 默认可见，
 *    即使浏览器禁用 CSS 动画/过渡，内容也不会被隐藏。
 * 3) 排版建议落地：中文行高 1.72 · 正文衬线 · 报头 700 · 英文两行首字下沉。
 * ========================================================================== */

/* ---------- 1. 列表行显现优先级修复 ---------- */
.js-reveal.is-inview,
html.np-motion .row.js-reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* ---------- 2. 动效防呆：默认可见 + backwards 填充 ---------- */
.mast-line {
  opacity: 1;
  animation-fill-mode: backwards;
}
.mast-name {
  opacity: 1;
  animation-fill-mode: backwards;
}
.mast-nav .nav-link {
  opacity: 1;
  animation-fill-mode: backwards;
}
.mast-actions {
  opacity: 1;
  animation-fill-mode: backwards;
}
.mast-rule {
  opacity: 1;
  transform: none;
  animation-fill-mode: backwards;
}
.front-lead > * {
  opacity: 1;
  animation-fill-mode: backwards;
}
.front-head {
  opacity: 1;
  transform: none;
  animation-fill-mode: backwards;
}
.front-head .np-char {
  opacity: 1;
  animation-fill-mode: backwards;
}
.root-link {
  opacity: 1;
  animation-fill-mode: backwards;
}
html.np-motion .article-head__meta div {
  opacity: 1;
}
html.np-motion .article-head.is-inview .article-head__meta div {
  animation-fill-mode: backwards;
}

/* ---------- 3. 排版建议 ---------- */
/* 3a. 中文正文行高：CJK 需要更松的行距 */
:lang(zh) body,
:lang(zh-CN) body {
  line-height: 1.72;
}

/* 3b. 正文改用衬线（报纸气质）：拉丁 Newsreader，中文系统衬线回退 */
:root {
  --font-prose: "Newsreader", "Noto Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, serif;
}
.prose {
  font-family: var(--font-prose);
}
.prose code,
.prose pre,
.prose th {
  font-family: var(--font-mono);
}

/* 3c. 报头字重 700（CJK 有真粗体，拉丁由 400 合成） */
.mast-name {
  font-weight: 700;
}

/* 3d. 英文首字下沉两行高（支持 initial-letter 的浏览器），
      不支持时回退到现有的 float 下沉 */
@supports (initial-letter: 2) {
  :lang(en) .front-lede::first-letter {
    float: none;
    initial-letter: 2;
    padding: 0.04em 0.12em 0 0;
  }
}

/* ==========================================================================
 * v4 · 首页排版与文章页阅读布局（2026-08-31）
 * 1) 博客/作品正文收成居中阅读列（42rem），页头与正文同一轴线。
 * 2) 上下篇分页条规范：上一篇靠左、下一篇靠右，各占 50%，
 *    长标题在格内折行，绝不撑破布局；移动端上下堆叠。
 * 3) 首页大标题居中（报纸头版式），导语保持左对齐形成轴线差。
 * ========================================================================== */

/* ---------- 1. 博客正文居中（标题/页头保持报纸式靠左） ---------- */
.prose {
  margin-inline: auto;
}

/* ---------- 2. 分页条规范化 ---------- */
.article-foot {
  align-items: flex-start;
}
.pager {
  flex: 1 1 auto;
  min-width: min(100%, 26rem);
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md) var(--space-lg);
}
.pager__item {
  flex: 0 1 50%;
  min-width: 0;
}
.pager__item:only-child {
  flex: 0 1 auto;
}
.pager__item:only-child.pager__item--next {
  margin-left: auto;
}
.pager__item:only-child.pager__item--prev {
  margin-right: auto;
}
.pager__item--prev { text-align: left; }
.pager__item--next { text-align: right; }
.pager__label,
.pager__title {
  display: block;
}
.pager__title {
  overflow-wrap: anywhere;
  min-width: 0;
}
@media (max-width: 40rem) {
  .pager {
    flex-direction: column;
    align-items: stretch;
  }
  .pager__item {
    flex: 1 1 auto;
    max-width: 100%;
  }
  .pager__item--next {
    text-align: left;
  }
}

/* ---------- 3. 首页大标题居中 ---------- */
.front-head {
  text-align: center;
}
