/* Hallmark · genre: editorial · macrostructure: Ticket Album · theme: Ticket
 * enrichment: perforation + aged paper · nav: N11 (ticket strip)
 * footer: Ft11 (stub row)
 * axes: paper=warm aged yellow · display=serif (Newsreader)
 * accent=vermilion · motion=tickets pull out, hover tilt
 */
:root {
  --color-paper: oklch(95% 0.02 85);
  --color-paper-2: oklch(90% 0.025 85);
  --color-rule: oklch(82% 0.025 80);
  --color-neutral: oklch(56% 0.02 75);
  --color-muted: oklch(42% 0.025 70);
  --color-ink: oklch(26% 0.035 55);
  --color-ink-body: oklch(34% 0.03 60);
  --color-accent: oklch(50% 0.2 28);
  --color-accent-ink: oklch(98% 0.01 85);
  --color-accent-soft: oklch(50% 0.2 28 / 0.1);
  --color-focus: oklch(54% 0.19 28);

  --font-display: "Newsreader", Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --font-body: "Inter Tight", -apple-system, "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.5rem, 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(18% 0.02 80);
  --color-paper-2: oklch(22% 0.022 80);
  --color-rule: oklch(30% 0.022 80);
  --color-neutral: oklch(58% 0.015 80);
  --color-muted: oklch(72% 0.015 80);
  --color-ink: oklch(94% 0.01 80);
  --color-ink-body: oklch(84% 0.012 80);
  --color-accent: oklch(68% 0.18 30);
  --color-accent-ink: oklch(14% 0.02 80);
  --color-accent-soft: oklch(68% 0.18 30 / 0.14);
  --color-focus: oklch(70% 0.17 30);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"],
  html:not([data-theme]) {
    --color-paper: oklch(18% 0.02 80);
    --color-paper-2: oklch(22% 0.022 80);
    --color-rule: oklch(30% 0.022 80);
    --color-neutral: oklch(58% 0.015 80);
    --color-muted: oklch(72% 0.015 80);
    --color-ink: oklch(94% 0.01 80);
    --color-ink-body: oklch(84% 0.012 80);
    --color-accent: oklch(68% 0.18 30);
    --color-accent-ink: oklch(14% 0.02 80);
    --color-accent-soft: oklch(68% 0.18 30 / 0.14);
    --color-focus: oklch(70% 0.17 30);
  }
}

* { 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.7;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--color-accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
::selection { background: var(--color-accent-soft); }

/* ---------- 票头导航（N11 ticket strip） ---------- */
.tk-header {
  border-bottom: 2px dashed var(--color-ink);
  background: var(--color-paper);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
}
.tk-header__main {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  max-width: 76rem;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
}
.tk-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: 0.04em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.tk-brand:hover { color: var(--color-accent); }
.tk-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-md);
  align-items: baseline;
}
.tk-nav .nav-link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.tk-nav .nav-link__num { font-family: var(--font-mono); font-size: 0.72em; color: var(--color-accent); margin-right: 0.35em; }
.tk-nav .nav-link:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.tk-nav .nav-link.active { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.tk-actions { display: flex; align-items: center; gap: var(--space-sm); }
.tk-actions__inline { display: flex; align-items: center; gap: var(--space-sm); }
.tk-header__serial {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
  padding: 0 var(--space-md) var(--space-2xs);
  max-width: 76rem;
}

/* ---------- 主题 / 语言切换 ---------- */
.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;
  background: transparent;
  color: var(--color-muted);
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.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); }
.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__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__arrow { display: inline-block; transition: transform 200ms var(--ease-out); }
.lang-drawer__panel-inner { display: flex; flex-direction: column; }
.lang-drawer__btn {
  padding: 8px 12px;
  font-family: var(--font-body);
  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: 2px; 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: 2px;
  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);
}

/* ---------- 票册 ---------- */
main { padding: 0 0 var(--space-2xl); }
.tk-album {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}
.tk-album--root { min-height: 88vh; }
.tk-cover {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-bottom: 2px dashed var(--color-ink);
}
.tk-cover::before,
.tk-cover::after {
  content: '';
  position: absolute;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-paper);
  border: 2px solid var(--color-ink);
}
.tk-cover::before { left: -7px; }
.tk-cover::after { right: -7px; }
.tk-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-sm);
}
.tk-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-xs);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
.tk-role {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-md);
}
.tk-lede {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.35;
  max-width: 30ch;
  margin: 0 0 var(--space-sm);
  color: var(--color-ink);
}
.tk-intro { max-width: 60ch; margin: 0 0 var(--space-sm); }
.tk-skills { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-muted); margin: 0; }

/* ---------- 票页 ---------- */
.tk-sheet { padding: var(--space-2xl) 0; border-bottom: 2px dashed var(--color-rule); }
.tk-sheet__head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 var(--space-md);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
  position: relative;
  padding-bottom: 0.4rem;
}
.tk-sheet__head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4rem;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.tk-sheet__head.is-inview::after { animation: tk-rule 0.6s var(--ease-out) 0.18s both; }
@keyframes tk-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.tk-foreword { max-width: 58ch; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.5; }
.tk-more { margin: var(--space-md) 0 0; }
.tk-list { display: grid; }

/* ---------- 票据行 ---------- */
.row {
  position: relative;
  display: grid;
  align-items: baseline;
  gap: var(--space-sm);
  border-bottom: 2px dashed var(--color-rule);
  padding: var(--space-md) var(--space-xs);
  text-decoration: none;
  color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}
.row:hover { background: var(--color-accent-soft); transform: translateY(-2px) rotate(-0.3deg); }
.row--work { grid-template-columns: 6ch 7ch minmax(0, 1fr) auto; }
.row--post { grid-template-columns: 11ch minmax(0, 1fr) auto; }
.row__num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--color-accent);
}
.row__date { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-muted); 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 { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.row__tags { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); text-align: right; }

/* ---------- 页面头 / 文章页 ---------- */
.tk-head { padding-bottom: var(--space-md); border-bottom: 2px dashed var(--color-ink); margin-bottom: var(--space-lg); }
.tk-head .tk-title { font-size: clamp(2rem, 6vw, 3.6rem); }
.tk-chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-sm) 0 0; }
.tk-chip {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  border: 1px solid var(--color-rule);
  padding: 4px 10px;
  white-space: nowrap;
}
.tk-links { margin: var(--space-sm) 0 0; }
.tk-links a { margin-right: var(--space-sm); }
.tk-foot { border-top: 2px dashed var(--color-rule); margin-top: var(--space-2xl); padding-top: var(--space-md); }
.tk-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: 2px dashed var(--color-rule); padding-left: var(--space-sm); position: sticky; top: 96px; }
.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.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  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: 2px dashed var(--color-ink); }
.essay-end { font-family: var(--font-display); color: var(--color-accent); font-size: var(--text-2xl); text-align: center; }

/* ---------- 联系 / 分页 ---------- */
.contact-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: baseline;
  border-bottom: 2px dashed 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.1em; color: var(--color-muted); }
.contact-row__value { font-family: var(--font-display); font-weight: 600; 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); }

/* ---------- 正文 ---------- */
.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  margin: 1.8em 0 0.6em;
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-rule);
}
.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.2em; }
.prose li { margin: 0.3em 0; }
.prose a { text-underline-offset: 3px; }
.prose blockquote {
  margin: 0 0 1.2em;
  padding: 0.4em 0 0.4em 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 dashed 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.2em; }
.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: Ticket) */
.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-decoration-thickness: 2px;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.text-link:hover { color: var(--color-ink); }

/* ---------- 档案 / 页脚 / 工具 ---------- */
.style-card { position: relative; border: 2px dashed var(--color-rule); padding: var(--space-xs); }
.style-card__preview { display: block; 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-xs); }
.style-card__week { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; color: var(--color-muted); margin: 0; }
.style-card__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); 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: -1px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 3px 8px;
}
.tk-stub {
  border-top: 2px dashed var(--color-ink);
  padding: var(--space-sm) var(--space-md) var(--space-lg);
  text-align: center;
}
.tk-stub p {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.9;
}
.tk-stub a { color: var(--color-accent); }
.tk-stub .colophon__admin, .tk-stub .colophon__icp { margin-left: 0.6em; }

.to-top {
  position: fixed;
  right: var(--space-sm);
  bottom: var(--space-sm);
  width: 42px;
  height: 42px;
  border: 2px dashed var(--color-accent);
  background: var(--color-paper);
  color: var(--color-accent);
  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(-3px) rotate(-2deg); }
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform-origin: left;
  z-index: 500;
}

/* ---------- 根目录 ---------- */
.root-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  border-bottom: 2px dashed var(--color-rule);
  padding: var(--space-md) 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); transform: translateX(4px); }
.root-link .num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); }
.root-link .arrow { font-family: var(--font-mono); color: var(--color-accent); }

/* ---------- 动效：抽票 / 票号机 ---------- */
.tk-cover > * { opacity: 0; }
.tk-cover .tk-kicker { animation: tk-serial 0.5s steps(4, end) 0.1s both; }
.tk-cover .tk-title { animation: tk-pull 0.65s var(--ease-out) 0.2s both; }
.tk-cover .tk-role { animation: tk-pull 0.5s var(--ease-out) 0.36s both; }
.tk-cover .tk-lede { animation: tk-pull 0.5s var(--ease-out) 0.46s both; }
.tk-cover .tk-intro { animation: tk-pull 0.5s var(--ease-out) 0.56s both; }
.tk-cover .tk-skills { animation: tk-pull 0.5s var(--ease-out) 0.66s both; }
@keyframes tk-serial {
  from { opacity: 0; transform: translateX(-0.6em); }
  to { opacity: 1; transform: none; }
}
@keyframes tk-pull {
  from { opacity: 0; transform: translateX(0.6em); }
  to { opacity: 1; transform: none; }
}

.js-reveal { opacity: 0; }
.js-reveal.is-inview {
  animation: tk-ticket-in 0.45s cubic-bezier(0.22, 1.25, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes tk-ticket-in {
  from { opacity: 0; transform: translateX(0.7em) rotate(0.5deg); }
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 40rem) {
  .tk-header__main {
    flex-wrap: nowrap;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }
  .tk-brand { flex: 0 0 auto; }
  .tk-nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0 var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tk-nav::-webkit-scrollbar { display: none; }
  .tk-nav .nav-link { flex: 0 0 auto; }
  .tk-actions {
    position: relative;
    flex: 0 0 auto;
  }
  .tk-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; }
  .tk-cover { padding-top: var(--space-2xl); }
  .row--work { grid-template-columns: 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; }
  .tk-essay-layout { grid-template-columns: minmax(0, 1fr); }
  .essay-toc-wrap { order: -1; }
  .essay-toc { position: static; }
}

@media print {
  .tk-header, .to-top, .reading-progress, .nav-toggle, .lang-drawer { display: none !important; }
  .tk-cover > *,
  .js-reveal, .js-reveal.is-inview,
  .tk-sheet__head.is-inview::after { opacity: 1 !important; transform: none !important; animation: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .tk-cover > *,
  .js-reveal, .js-reveal.is-inview,
  .tk-sheet__head.is-inview::after {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
 * 2026-09-02 优化：正文居中 · 分页规范 · 正文块显现 · 防呆加固
 * ========================================================================== */

/* 1. 博客正文页内居中（标题保持票券式排版） */
.prose {
  margin-inline: auto;
}

/* 2. 分页条规范化：上一篇左、下一篇右，长标题格内折行 */
.pager {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md) var(--space-lg);
  margin: var(--space-sm) 0;
}
.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;
  min-width: 0;
}
.pager__title {
  overflow-wrap: anywhere;
}
.pager__item:hover .pager__title,
.pager__item:focus-visible .pager__title {
  color: var(--color-accent);
}
@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. 正文块柔和滚动显现（不套用列表行的抽票动效） */
.prose blockquote.js-reveal,
.prose pre.js-reveal,
.prose .callout.js-reveal,
.prose .prose-figure.js-reveal,
.table-wrap.js-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.prose blockquote.js-reveal.is-inview,
.prose pre.js-reveal.is-inview,
.prose .callout.js-reveal.is-inview,
.prose .prose-figure.js-reveal.is-inview,
.table-wrap.js-reveal.is-inview {
  opacity: 1;
  transform: none;
  animation: none;
}

/* 4. 显现防呆：is-inview 直接显形，不依赖动画填充 */
.js-reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* 5. 入场防呆：默认可见 + backwards 填充 */
.tk-cover > * { opacity: 1; }
.tk-cover .tk-kicker { animation-fill-mode: backwards; }
.tk-cover .tk-title { animation-fill-mode: backwards; }
.tk-cover .tk-role { animation-fill-mode: backwards; }
.tk-cover .tk-lede { animation-fill-mode: backwards; }
.tk-cover .tk-intro { animation-fill-mode: backwards; }
.tk-cover .tk-skills { animation-fill-mode: backwards; }

/* 6. hover / 键盘等价态 */
.row:hover,
.row:focus-visible {
  background: var(--color-accent-soft);
  transform: translateY(-2px) rotate(-0.3deg);
}
.row:hover .row__title,
.row:focus-visible .row__title {
  color: var(--color-accent);
}
