/* /assets/css/site-preferences.css */
:root {
  --site-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-site-font="anthropic-serif"] {
  --site-font-family: "Roboto Slab", "Iowan Old Style", "Palatino Linotype", "Songti SC", STSong, serif;
}

/* Anthropic Sans / Anthropic Mono：站长持有授权的自托管字体（站长决定 2026-10-01，见 AGENTS.md）。
   只有选了「Anthropic Sans」才会下载；它只含拉丁字母，中文由后面的系统字体接上。 */
@font-face {
  font-family: "Anthropic Sans";
  src: url("/assets/fonts/anthropic/anthropic-sans-roman.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Sans";
  src: url("/assets/fonts/anthropic/anthropic-sans-italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Mono";
  src: url("/assets/fonts/anthropic/anthropic-mono-roman.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Mono";
  src: url("/assets/fonts/anthropic/anthropic-mono-italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

html[data-site-font="anthropic-sans"] {
  --site-font-family: "Anthropic Sans", Roboto, "Avenir Next", Avenir, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-site-font="system"] {
  --site-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-site-font="dyslexic"] {
  --site-font-family: "Atkinson Hyperlegible", OpenDyslexic, Verdana, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 霞鹜文楷：正文和标题（--function-serif）都换成它，缺字或没加载到时退回系统楷体。 */
html[data-site-font="wenkai"] {
  --site-font-family: "LXGW WenKai", "霞鹜文楷", "Kaiti SC", STKaiti, KaiTi, "楷体", "AR PL UKai CN", serif;
  --function-serif: var(--site-font-family);
}

html[data-site-font] body,
html[data-site-font] button,
html[data-site-font] input,
html[data-site-font] select,
html[data-site-font] textarea {
  font-family: var(--site-font-family);
}

html[data-site-font="wenkai"] body {
  letter-spacing: 0.02em;
}

html[data-site-font="dyslexic"] body {
  letter-spacing: 0.012em;
  word-spacing: 0.025em;
}

.site-page-loader {
  align-items: center;
  background: var(--global-bg-color, #fff);
  color: var(--global-text-color, #111);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition:
    opacity 120ms ease-out,
    visibility 0s linear 120ms;
  visibility: hidden;
  z-index: 100000;
}

html.js[data-page-loading="true"] .site-page-loader {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
  visibility: visible;
}

.site-page-loader__text {
  animation: site-thinking-pulse 1.15s ease-in-out infinite;
  color: inherit;
  font-family: var(--site-font-family);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.015em;
}

.site-page-loader__text::before {
  content: "Thinking...";
}

html[data-loading-copy="loading"] .site-page-loader__text::before {
  content: "Loading...";
}

html[data-loading-copy="thinking-zh"] .site-page-loader__text::before {
  content: "正在思考...";
}

html[data-loading-copy="loading-zh"] .site-page-loader__text::before {
  content: "正在载入...";
}

@keyframes site-thinking-pulse {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 1;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .site-page-loader {
    background: var(--global-bg-color, #111);
    color: var(--global-text-color, #f3f3f3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-page-loader {
    transition: none;
  }

  .site-page-loader__text {
    animation: none;
  }
}

/* /assets/css/dialog-interactions.css */
html[data-site-dialog-open],
html[data-site-dialog-open] body {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog {
  overscroll-behavior: contain;
}

dialog :is(button, a, summary):focus-visible {
  outline: 2px solid var(--global-theme-color);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  dialog *,
  dialog *::before,
  dialog *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* /assets/css/owner-ui.css */
html:not([data-owner-verified="true"][data-owner-mode="true"]) .owner-only-control {
  display: none !important;
}

html[data-owner-restore="true"]:not([data-owner-verified="true"]) .site-author-nav.owner-only-control {
  display: flex !important;
  pointer-events: none;
  visibility: hidden;
}

/* 铅笔只在站长模式下出现；「返回访客模式」后页面与访客看到的一致，重新进入站长模式用导航栏的齿轮。 */
html[data-owner-verified="true"][data-owner-mode="true"] .site-author-nav.owner-only-control {
  display: flex !important;
}

.site-author-nav {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  top: calc(57px + 0.55rem);
  z-index: 1075;
}

.site-author-nav[data-positioned="true"] {
  right: auto;
}

#site-inline-editor-toggle {
  align-items: center;
  appearance: none;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--global-bg-color) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--global-text-color) 15%, transparent);
  border-radius: 50%;
  box-shadow: 0 0.35rem 1rem color-mix(in srgb, #000 10%, transparent);
  color: var(--global-text-color);
  cursor: grab;
  display: inline-flex;
  font: inherit;
  height: 2.6rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  touch-action: none;
  transition:
    background 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out,
    color 140ms ease-out,
    transform 140ms ease-out;
  width: 2.6rem;
}

.site-author-nav[data-dragging="true"] #site-inline-editor-toggle {
  cursor: grabbing;
  transform: none;
  transition: none;
  user-select: none;
}

#site-inline-editor-toggle:hover,
#site-inline-editor-toggle:focus-visible,
#site-inline-editor-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--global-theme-color) 10%, var(--global-bg-color));
  border-color: color-mix(in srgb, var(--global-theme-color) 52%, transparent);
  color: var(--global-theme-color);
}

#site-inline-editor-toggle:hover {
  box-shadow: 0 0.45rem 1.2rem color-mix(in srgb, #000 14%, transparent);
  transform: translateY(-1px);
}

#site-inline-editor-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--global-theme-color) 52%, transparent);
  outline-offset: 3px;
}

#site-inline-editor-toggle i {
  color: inherit;
  font-size: 0.95rem;
}

.site-author-menu {
  background: color-mix(in srgb, var(--global-bg-color) 96%, transparent);
  border: 1px solid var(--global-divider-color);
  border-radius: 0.65rem;
  box-shadow: 0 0.65rem 2rem color-mix(in srgb, #000 15%, transparent);
  min-width: 12.5rem;
  padding: 0.4rem;
  position: absolute;
  max-height: min(70vh, 30rem);
  overflow-y: auto;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(17rem, calc(100vw - 1.5rem));
  z-index: 1080;
}

.site-author-nav[data-menu-horizontal="left"] .site-author-menu {
  left: 0;
  right: auto;
}

.site-author-nav[data-menu-vertical="above"] .site-author-menu {
  bottom: calc(100% + 0.5rem);
  top: auto;
}

.site-author-menu[hidden] {
  display: none;
}

.site-author-menu > p {
  color: var(--global-text-color-light);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0;
  padding: 0.45rem 0.6rem 0.3rem;
  text-transform: uppercase;
}

.site-author-menu > button,
.site-author-menu > a {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0.42rem;
  color: var(--global-text-color);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 0.78rem;
  gap: 0.65rem;
  grid-template-columns: 1rem 1fr;
  padding: 0.58rem 0.62rem;
  text-align: left;
  width: 100%;
}

.site-author-menu > a {
  text-decoration: none;
}

.site-author-menu > .site-author-menu__exit {
  border-top: 1px solid var(--global-divider-color);
  border-radius: 0 0 0.42rem 0.42rem;
  color: var(--global-text-color-light);
  margin-top: 0.35rem;
}

.site-author-menu > button i,
.site-author-menu > a i {
  color: var(--global-text-color-light);
  text-align: center;
}

.site-author-menu > button:hover,
.site-author-menu > button:focus-visible,
.site-author-menu > a:hover,
.site-author-menu > a:focus-visible {
  background: color-mix(in srgb, var(--global-theme-color) 8%, var(--global-bg-color));
  outline: 0;
}

.site-author-menu > button:hover i,
.site-author-menu > button:focus-visible i,
.site-author-menu > a:hover i,
.site-author-menu > a:focus-visible i {
  color: var(--global-theme-color);
}

.activity-feed__edit {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--global-text-color-light);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.72rem;
  height: 2.25rem;
  justify-content: center;
  margin-left: 0.35rem;
  opacity: 0.72;
  padding: 0;
  transition:
    background 120ms ease-out,
    color 120ms ease-out,
    opacity 120ms ease-out;
  vertical-align: middle;
  width: 2.25rem;
}

.activity-feed__edit:hover,
.activity-feed__edit:focus-visible {
  background: color-mix(in srgb, var(--global-theme-color) 8%, transparent);
  color: var(--global-theme-color);
  opacity: 1;
  outline: 0;
}

.site-admin-load-status {
  background: color-mix(in srgb, var(--global-bg-color) 96%, transparent);
  border: 1px solid var(--global-divider-color);
  border-radius: 0.65rem;
  bottom: 1rem;
  box-shadow: 0 0.65rem 2rem color-mix(in srgb, #000 15%, transparent);
  color: var(--global-text-color);
  font-size: 0.78rem;
  left: 50%;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.7rem 0.9rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1200;
}

.site-admin-load-status[hidden] {
  display: none;
}

.site-admin-load-status[data-state="error"] {
  border-color: color-mix(in srgb, #c62828 45%, var(--global-divider-color));
  color: color-mix(in srgb, #c62828 78%, var(--global-text-color));
}

@media (max-width: 575.98px) {
  .site-author-nav {
    right: max(0.65rem, env(safe-area-inset-right));
    top: calc(57px + 0.4rem);
  }

  #site-inline-editor-toggle {
    height: 2.5rem;
    width: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #site-inline-editor-toggle {
    transition: none;
  }

  #site-inline-editor-toggle:hover {
    transform: none;
  }
}

/* 铅笔停靠进导航栏：停靠位在齿轮右边，和导航按钮一样大。 */
.function-page #navbar .function-author-dock {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.function-page #navbar .function-author-dock[hidden] {
  display: none !important;
}
.site-author-nav[data-docked="true"] #site-inline-editor-toggle {
  box-shadow: none;
}
/* 拖到齿轮附近时给出「可以放下」的提示 */
.site-author-nav[data-dock-ready="true"] #site-inline-editor-toggle {
  border-color: var(--global-theme-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--global-theme-color) 22%, transparent);
  color: var(--global-theme-color);
}

/* /assets/css/turbo-mode.css */
/* Turbo 模式：克制的「疾行」。
   鼠标拖出一条渐隐的长曝光光迹，光标是一个小圆点加一圈跟随的细环，点击漾开一圈涟漪。
   颜色是站点强调色（紫）过渡到暖金，没有霓虹、网格和 HUD。画布只在鼠标动过之后才重绘。 */
:root {
  --turbo-accent: #6434b2;
  --turbo-warm: #e08a3c;
}

html[data-theme="dark"] {
  --turbo-accent: #a58bff;
  --turbo-warm: #ffb066;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --turbo-accent: #a58bff;
    --turbo-warm: #ffb066;
  }
}

/* ---------- 光标：小圆点 + 跟随的细环 ---------- */
.turbo-cursor {
  --turbo-cursor-core-x: 50vw;
  --turbo-cursor-core-y: 50vh;
  --turbo-cursor-ring-x: 50vw;
  --turbo-cursor-ring-y: 50vh;
  color: var(--turbo-accent);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 120ms ease;
  visibility: hidden;
  z-index: 2147483645;
}

.turbo-cursor[data-visible="true"] {
  opacity: 1;
  visibility: visible;
}

.turbo-cursor__lock,
.turbo-cursor__core {
  color: inherit;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  will-change: transform;
}

.turbo-cursor__lock {
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1.5px solid color-mix(in srgb, currentColor 52%, transparent);
  border-radius: 50%;
  height: 1.7rem;
  transform: translate3d(var(--turbo-cursor-ring-x), var(--turbo-cursor-ring-y), 0) translate(-50%, -50%);
  transition:
    transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 160ms ease,
    border-color 160ms ease;
  width: 1.7rem;
}

.turbo-cursor__core {
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--global-bg-color) 78%, transparent);
  height: 0.34rem;
  transform: translate3d(var(--turbo-cursor-core-x), var(--turbo-cursor-core-y), 0) translate(-50%, -50%);
  transition: transform 120ms ease;
  width: 0.34rem;
}

/* 悬在可点击的东西上：细环像是把它轻轻托起来 */
.turbo-cursor[data-state="locked"] .turbo-cursor__lock {
  background: color-mix(in srgb, currentColor 11%, transparent);
  border-color: color-mix(in srgb, var(--turbo-warm) 70%, transparent);
  transform: translate3d(var(--turbo-cursor-ring-x), var(--turbo-cursor-ring-y), 0) translate(-50%, -50%) scale(1.32);
}

.turbo-cursor[data-state="locked"] .turbo-cursor__core {
  transform: translate3d(var(--turbo-cursor-core-x), var(--turbo-cursor-core-y), 0) translate(-50%, -50%) scale(0.8);
}

.turbo-cursor[data-pressed="true"] .turbo-cursor__lock {
  transform: translate3d(var(--turbo-cursor-ring-x), var(--turbo-cursor-ring-y), 0) translate(-50%, -50%) scale(0.74);
}

.turbo-cursor[data-pressed="true"] .turbo-cursor__core {
  transform: translate3d(var(--turbo-cursor-core-x), var(--turbo-cursor-core-y), 0) translate(-50%, -50%) scale(1.5);
}

/* 系统光标始终保留：细环只是跟随的装饰。
   若隐藏系统光标，用户看到的「鼠标」就是一个由 JS 移动的元素，天然比真实指针慢一拍。 */

/* ---------- 光迹画布：盖在页面上、不挡操作 ---------- */
.turbo-canvas {
  height: 100vh;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 320ms ease;
  visibility: hidden;
  width: 100vw;
  z-index: 1000;
}

html[data-turbo="on"] .turbo-canvas {
  opacity: 1;
  visibility: visible;
}

/* ---------- 开机：一圈柔和的光从按钮处漾开，没有文字 ---------- */
.turbo-boot {
  inset: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  visibility: hidden;
  z-index: 100002;
}

.turbo-boot::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--turbo-accent) 20%, transparent) 0,
    color-mix(in srgb, var(--turbo-warm) 11%, transparent) 30%,
    transparent 62%
  );
  border-radius: 50%;
  content: "";
  height: 220vmax;
  left: var(--turbo-boot-x, 50%);
  position: absolute;
  top: var(--turbo-boot-y, 4rem);
  transform: translate(-50%, -50%) scale(0.02);
  width: 220vmax;
}

html[data-turbo-boot="true"] .turbo-boot {
  animation: turbo-boot-fade 1000ms ease-out forwards;
  visibility: visible;
}

html[data-turbo-boot="true"] .turbo-boot::before {
  animation: turbo-bloom 900ms cubic-bezier(0.16, 0.8, 0.2, 1) forwards;
}

/* ---------- 主题按钮：长按的进度环、开启后的小圆点、悬停提示 ---------- */
#light-toggle[data-turbo-trigger] {
  isolation: isolate;
  position: relative;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

#light-toggle[data-turbo-trigger]::before {
  background: conic-gradient(from -90deg, transparent 0 10%, var(--turbo-accent) 34%, var(--turbo-warm) 68%, transparent 92%);
  border-radius: 50%;
  content: "";
  inset: -0.52rem;
  opacity: 0;
  padding: 2px;
  pointer-events: none;
  position: absolute;
  transform: scale(0.72) rotate(-90deg);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

#light-toggle[data-turbo-trigger].is-turbo-charging::before {
  animation: turbo-charge-ring 680ms cubic-bezier(0.15, 0.75, 0.2, 1) forwards;
  opacity: 1;
}

html[data-turbo="on"] #light-toggle[data-turbo-trigger] {
  color: var(--turbo-accent);
}

html[data-turbo="on"] #light-toggle[data-turbo-trigger]::after {
  animation: turbo-breathe 2.6s ease-in-out infinite;
  background: var(--turbo-warm);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--global-bg-color);
  content: "";
  height: 0.3rem;
  position: absolute;
  right: -0.34rem;
  top: -0.14rem;
  width: 0.3rem;
}

.turbo-trigger-hint {
  background: color-mix(in srgb, var(--global-bg-color) 96%, transparent);
  border: 1px solid var(--global-divider-color);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(20, 20, 19, 0.1);
  color: var(--global-text-color-light);
  font-size: 0.72rem;
  left: 50%;
  letter-spacing: 0.02em;
  opacity: 0;
  padding: 0.36rem 0.62rem;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  transform: translate(-50%, -0.2rem);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  visibility: hidden;
  white-space: nowrap;
}

#light-toggle[data-turbo-trigger]:hover .turbo-trigger-hint,
#light-toggle[data-turbo-trigger]:focus-visible .turbo-trigger-hint {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

/* ---------- 提示：一枚平实的小药丸 ---------- */
.turbo-status {
  align-items: center;
  background: color-mix(in srgb, var(--global-bg-color) 95%, transparent);
  border: 1px solid var(--global-divider-color);
  border-radius: 999px;
  bottom: 1.2rem;
  box-shadow: 0 8px 28px rgba(20, 20, 19, 0.12);
  color: var(--global-text-color);
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.55rem;
  left: 1.2rem;
  max-width: min(25rem, calc(100vw - 2.4rem));
  opacity: 0;
  padding: 0.55rem 1rem 0.55rem 0.85rem;
  pointer-events: none;
  position: fixed;
  transform: translateY(0.7rem);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  visibility: hidden;
  z-index: 100003;
}

.turbo-status::before {
  background: linear-gradient(135deg, var(--turbo-accent), var(--turbo-warm));
  border-radius: 50%;
  content: "";
  flex: none;
  height: 0.5rem;
  width: 0.5rem;
}

.turbo-status[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@keyframes turbo-bloom {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes turbo-boot-fade {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes turbo-charge-ring {
  from {
    transform: scale(0.72) rotate(-90deg);
  }

  to {
    transform: scale(1) rotate(270deg);
  }
}

@keyframes turbo-breathe {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

@media (max-width: 991.98px) {
  .turbo-trigger-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .turbo-status {
    bottom: 0.9rem;
    left: 0.9rem;
    max-width: calc(100vw - 1.8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .turbo-cursor,
  .turbo-boot {
    display: none;
  }

  .turbo-canvas,
  .turbo-status,
  .turbo-trigger-hint {
    transition: none;
  }

  html[data-turbo="on"] #light-toggle[data-turbo-trigger]::after {
    animation: none;
  }

  #light-toggle[data-turbo-trigger].is-turbo-charging::before {
    animation-duration: 1ms;
  }
}

/* /assets/css/post.css */
/*
 * Article pages, after claude.dev/blog (owner request 2026-09-26).
 * Sizes are claude.dev's measured values at its 18px root, written in px so
 * the site's 16px root and navigation stay untouched.
 *
 * The same rules dress the editor previews: .post-paper carries the palette,
 * .post-paper__title / __summary the hero type, and .post-prose the body, so
 * what the owner sees while writing is what the article page renders.
 */

/* ---------- palette: warm paper, near-black ink ---------- */
html[lang="zh-CN"]:has(.post--article),
.post-paper {
  --global-bg-color: #faf9f5;
  --global-card-bg-color: #faf9f5;
  --global-text-color: #141413;
  --global-text-color-light: #4c4b45;
  --global-divider-color: #e3e1da;
  --global-code-bg-color: #f1efe8;
  --post-ink-rgb: 20, 20, 19;
  --post-ink: #141413;
  --post-ink-2: #4c4b45;
  --post-ink-3: #7b7a72;
  --post-ink-4: #a8a69d;
  --post-line: #14141338;
  --post-line-soft: #1414131c;
}
html[lang="zh-CN"][data-theme="dark"]:has(.post--article),
html[data-theme="dark"] .post-paper {
  --global-bg-color: #141413;
  --global-card-bg-color: #141413;
  --global-text-color: #faf9f5;
  --global-text-color-light: #b0aea5;
  --global-divider-color: #2e2d2a;
  --global-code-bg-color: #1a1a18;
  --post-ink-rgb: 250, 249, 245;
  --post-ink: #faf9f5;
  --post-ink-2: #b0aea5;
  --post-ink-3: #87867f;
  --post-ink-4: #5e5d59;
  --post-line: #faf9f529;
  --post-line-soft: #faf9f517;
}
@media (prefers-color-scheme: dark) {
  html[lang="zh-CN"]:not([data-theme]):has(.post--article),
  html:not([data-theme]) .post-paper {
    --global-bg-color: #141413;
    --global-card-bg-color: #141413;
    --global-text-color: #faf9f5;
    --global-text-color-light: #b0aea5;
    --global-divider-color: #2e2d2a;
    --global-code-bg-color: #1a1a18;
    --post-ink-rgb: 250, 249, 245;
    --post-ink: #faf9f5;
    --post-ink-2: #b0aea5;
    --post-ink-3: #87867f;
    --post-ink-4: #5e5d59;
    --post-line: #faf9f529;
    --post-line-soft: #faf9f517;
  }
}

/* ---------- navigation scrolls away, as on claude.dev ----------
   Elsewhere the site bar is fixed and turns into a floating capsule once the
   page scrolls; over an article that capsule covers the text and the rail. */
html[lang="zh-CN"]:has(.post--article) {
  overflow-x: clip;
  scroll-padding-top: 36px;
}
html:has(.post--article) .function-page #navbar,
html[data-function-scrolled="true"]:has(.post--article) .function-page #navbar {
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  padding-inline: 0;
  position: absolute;
  transition: none;
  width: min(1060px, calc(100% - 96px));
}

.post--article,
.post-paper {
  --post-sans: var(--site-font-family, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif);
  --post-mono: "SF Mono", ui-monospace, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --post-ease: cubic-bezier(0.19, 1, 0.22, 1);
  --post-rail-top: 36px;
}
.post-paper {
  background: var(--global-bg-color);
  color: var(--post-ink);
  font-family: var(--post-sans);
}

/* ---------- frame: break out of the 1060px container ---------- */
.post--article {
  --post-gutter: 36px;
  color: var(--post-ink);
  font-family: var(--post-sans);
  margin-left: calc(50% - 50vw);
  padding: 0 var(--post-gutter) 96px;
  width: 100vw;
}

/* 1px ink hairline at the very top, driven by the scroll timeline */
.post-reading-progress {
  display: none;
}
@supports (animation-timeline: scroll()) {
  .post-reading-progress {
    animation: post-reading-progress linear both;
    animation-timeline: scroll(root block);
    background: var(--post-ink);
    display: block;
    height: 1px;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    transform: scaleX(0);
    transform-origin: left center;
    z-index: 1200;
  }
}
@keyframes post-reading-progress {
  to {
    transform: scaleX(1);
  }
}

/* ---------- hero ---------- */
.post-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: 56px 0 72px;
  position: relative;
}
.post-hero::after {
  background: color-mix(in srgb, rgb(var(--post-ink-rgb)) 9%, var(--global-bg-color));
  bottom: 0;
  content: "";
  height: 1px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 100vw;
}
.post-hero__content {
  grid-column: 5 / 13;
}
.post-chip {
  border: 1px solid var(--post-line-soft);
  color: var(--post-ink-3);
  display: inline-block;
  font-family: var(--post-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 2px 8px;
}
:is(.post--article .post-title, .post-paper__title) {
  color: var(--post-ink);
  font-family: var(--function-serif, var(--post-sans));
  font-size: clamp(27px, 19.8px + 1vw, 36px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
  max-width: 720px;
  text-wrap: balance;
}
:is(.post--article .post-description, .post-paper__summary) {
  color: var(--post-ink-2);
  font-size: 18px;
  line-height: 1.6;
  margin: 13.5px 0 0;
  max-width: 720px;
  text-wrap: balance;
}
.post--article .post-meta {
  display: grid;
  font-family: var(--post-mono);
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin: 30px 0 0;
}
.post--article .post-meta > div {
  grid-column: span 2;
  min-width: 0;
  overflow-wrap: anywhere;
  padding-right: 18px;
}
.post--article .post-meta dt {
  color: var(--post-ink-3);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: normal;
  margin-bottom: 7px;
}
.post--article .post-meta dd {
  color: var(--post-ink);
  font-family: var(--post-sans);
  font-size: 15.75px;
  line-height: 1.5;
  margin: 0;
  padding-left: 1.2em;
  text-indent: -1.2em;
}
.post--article .post-meta dd::before {
  color: var(--post-ink-4);
  content: "└ ";
  display: inline-block;
  font-family: var(--post-mono);
  text-indent: 0;
  width: 1.2em;
}
.post--article .post-tags a {
  color: inherit;
  text-decoration: none;
}
.post--article .post-tags a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- body: rail on 1-4, article on 5-12 ---------- */
.post-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding-top: 72px;
}
.post-rail {
  align-self: start;
  display: flex;
  flex-direction: column;
  font-family: var(--post-mono);
  grid-column: 1 / 5;
  margin: -2px 32px 0 0;
  min-height: calc(100dvh - var(--post-rail-top) - 36px);
  position: sticky;
  top: var(--post-rail-top);
}
.post-rail__title {
  font-family: var(--post-sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  margin-right: -32px;
  max-height: 0;
  max-width: 40ch;
  opacity: 0;
  overflow: hidden;
  text-wrap: balance;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s var(--post-ease),
    max-height 0.4s ease,
    margin 0.4s ease;
}
.post-rail__title.is-on {
  margin-bottom: 24px;
  max-height: 240px;
  opacity: 1;
  transform: none;
}
.post-rail__label {
  color: var(--post-ink-3);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  line-height: normal;
  margin: 0 0 12px;
}
.post-tree a {
  color: var(--post-ink-2);
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  overflow: hidden;
  padding: 2px 0;
  text-decoration: none;
  text-overflow: ellipsis;
  transition:
    color 0.15s,
    transform 0.25s var(--post-ease);
  white-space: nowrap;
}
.post-tree__branch {
  color: var(--post-ink-4);
  margin-right: 10px;
}
.post-tree a:hover,
.post-tree a.is-active {
  color: var(--post-ink);
}
.post-tree a:hover {
  transform: translateX(3px);
}
.post-tree a.is-active .post-tree__branch {
  color: var(--post-ink-2);
}
.post-rail__progress {
  color: var(--post-ink-4);
  font-size: 15.75px;
  margin-top: 26px;
  overflow: hidden;
  white-space: nowrap;
}
.post-rail__progress b {
  color: var(--post-ink);
  font-weight: 400;
}
.post-rail__pct {
  color: var(--post-ink-2);
  margin-left: 8px;
}
.post-rail__hint {
  color: var(--post-ink-3);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  margin: 12px 0 0;
}
.post-rail__share {
  margin-top: auto;
  padding-top: 26px;
}
.post-rail__share a,
.post-rail__share button {
  background: none;
  border: 0;
  color: var(--post-ink-2);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 2px 0;
  text-align: left;
  text-decoration: none;
}
.post-rail__share a::before,
.post-rail__share button::before {
  color: var(--post-ink-4);
  content: "└ ";
}
.post-rail__share a:hover,
.post-rail__share button:hover {
  color: var(--post-ink);
}
.post-rail__share [hidden] {
  display: none;
}

.post-column {
  grid-column: 5 / 13;
  margin-left: -32px;
  max-width: 732px;
  min-width: 0;
  padding-left: 32px;
}

/* ---------- prose ---------- */
:is(.post--article #markdown-content, .post-prose) {
  color: var(--post-ink-2);
  font-size: 18px;
  line-height: 1.7;
}
:is(.post--article #markdown-content, .post-prose) > :first-child {
  margin-top: -2px;
}
:is(.post--article #markdown-content, .post-prose) :is(p, li) {
  color: var(--post-ink-2);
}
:is(.post--article #markdown-content, .post-prose) p {
  margin: 0 0 14px;
  max-width: 660px;
}
:is(.post--article #markdown-content, .post-prose) :is(h2, h3, h4) {
  color: var(--post-ink);
  font-family: var(--post-mono);
  font-size: 15.75px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin: 54px 0 20px;
  scroll-margin-top: var(--post-rail-top);
  text-transform: uppercase;
}
:is(.post--article #markdown-content, .post-prose) > :is(h2, h3):first-child {
  margin-top: -2px;
}
:is(.post--article #markdown-content, .post-prose) h3 {
  margin-top: 36px;
}
:is(.post--article #markdown-content, .post-prose) h2 + h3 {
  margin-top: 0;
}
:is(.post--article #markdown-content, .post-prose) h4 {
  font-size: 13.5px;
  margin: 31.5px 0 12px;
}
:is(.post--article #markdown-content, .post-prose) strong {
  color: var(--post-ink);
  font-weight: 500;
}
:is(.post--article #markdown-content, .post-prose) a {
  color: inherit;
  overflow-wrap: break-word;
  text-decoration: underline;
  text-decoration-color: var(--post-ink-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s;
}
:is(.post--article #markdown-content, .post-prose) a:hover {
  color: var(--post-ink);
}
:is(.post--article #markdown-content, .post-prose) :is(ul, ol) {
  list-style-position: outside;
  margin: 0 0 14px;
  max-width: 660px;
  padding-left: 1.25em;
}
:is(.post--article #markdown-content, .post-prose) li {
  margin: 0 0 6px;
}
:is(.post--article #markdown-content, .post-prose) li::marker {
  color: var(--post-ink-3);
}
:is(.post--article #markdown-content, .post-prose) blockquote {
  border-left: 1px solid var(--post-line);
  margin: 31.5px 0;
  padding: 0 0 0 22.5px;
}
:is(.post--article #markdown-content, .post-prose) blockquote p {
  color: var(--post-ink-2);
  margin: 0;
}
:is(.post--article #markdown-content, .post-prose) :not(pre) > code {
  background: rgba(var(--post-ink-rgb), 0.05);
  border-radius: 0;
  color: var(--post-ink);
  font-family: var(--post-mono);
  font-size: 0.875em;
  padding: 0.0625em 0.25em;
}

/* code: claude.dev's bordered card, header added by post.js */
:is(.post--article #markdown-content, .post-prose) div.highlighter-rouge {
  position: relative;
  background: none;
  border: 1px solid var(--post-line-soft);
  margin: 26px 0;
  max-width: 660px;
}
:is(.post--article #markdown-content, .post-prose) div.highlight,
:is(.post--article #markdown-content, .post-prose) .code-display-wrapper {
  background: none;
  border: 0;
  margin: 0;
  position: static;
}
:is(.post--article #markdown-content, .post-prose) pre.highlight {
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--post-ink-2);
  font-family: var(--post-mono);
  font-size: 13.5px;
  line-height: 1.75;
  margin: 0;
  overflow-x: auto;
  padding: 16px;
}
:is(.post--article #markdown-content, .post-prose) pre.highlight code {
  background: none;
  color: inherit;
  font-size: inherit;
  padding: 0;
}
.post-code__head {
  align-items: center;
  border-bottom: 1px solid var(--post-line-soft);
  color: var(--post-ink-3);
  display: flex;
  font-family: var(--post-mono);
  font-size: 11.25px;
  justify-content: space-between;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  text-transform: uppercase;
}
:is(.post--article #markdown-content, .post-prose) div.highlighter-rouge .copy {
  background: none;
  border: 0;
  color: var(--post-ink-3);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  opacity: 1;
  padding: 0;
  position: absolute;
  right: 14px;
  top: 10px;
}
:is(.post--article #markdown-content, .post-prose) div.highlighter-rouge .copy:hover {
  color: var(--post-ink);
}

/* The editor preview renders plain <pre> blocks; same card, the language
   label comes from data-lang instead of a header element. */
.post-prose pre:not(.highlight) {
  background: none;
  border: 1px solid var(--post-line-soft);
  border-radius: 0;
  color: var(--post-ink-2);
  font-family: var(--post-mono);
  font-size: 13.5px;
  line-height: 1.75;
  margin: 26px 0;
  max-width: 660px;
  overflow-x: auto;
  padding: 0;
}
.post-prose pre:not(.highlight)::before {
  border-bottom: 1px solid var(--post-line-soft);
  color: var(--post-ink-3);
  content: attr(data-lang);
  display: block;
  font-size: 11.25px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  padding: 8px 14px;
  text-transform: uppercase;
}
.post-prose pre:not(.highlight) > code {
  background: none;
  color: inherit;
  display: block;
  font-size: inherit;
  padding: 16px;
}
.post-prose .site-markdown-preview__table-wrap {
  margin: 26px 0;
  max-width: 660px;
  overflow-x: auto;
}
/* Same specificity as the shared table rule it overrides. */
:is(.post--article #markdown-content, .post-prose) .site-markdown-preview__table-wrap > table {
  margin: 0;
}

/* tables: mono header, hairline rules */
/* The theme adds Bootstrap's .table and sometimes a .table-responsive
   wrapper; the outermost of the two carries the spacing. */
:is(.post--article #markdown-content, .post-prose) .table-responsive {
  margin: 26px 0;
  max-width: 660px;
}
:is(.post--article #markdown-content, .post-prose) table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: transparent;
  background: none;
  border-collapse: collapse;
  color: var(--post-ink-2);
  font-size: 15.75px;
  font-variant-numeric: tabular-nums;
  margin: 26px 0;
  max-width: 660px;
  width: 100%;
}
:is(.post--article #markdown-content, .post-prose) .table-responsive > table {
  margin: 0;
}
:is(.post--article #markdown-content, .post-prose) table :is(th, td) {
  background: none;
  border: 0;
  box-shadow: none;
  color: inherit;
  border-bottom: 1px solid var(--post-line-soft);
  padding: 10px 14px 10px 0;
}
:is(.post--article #markdown-content, .post-prose) table th {
  border-bottom: 1px solid var(--post-line);
  color: var(--post-ink-3);
  font-family: var(--post-mono);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding-top: 0;
  white-space: nowrap;
}
:is(.post--article #markdown-content, .post-prose) table td:first-child {
  color: var(--post-ink);
  font-family: var(--post-mono);
  font-size: 14.5px;
}
:is(.post--article #markdown-content, .post-prose) table :is(th, td)[style*="right"] {
  padding-left: 14px;
  padding-right: 0;
}

:is(.post--article #markdown-content, .post-prose) mjx-container[display="true"] {
  margin: 22px 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}
:is(.post--article #markdown-content, .post-prose) img {
  display: block;
  height: auto;
  margin: 26px 0;
  max-width: 100%;
}
:is(.post--article #markdown-content, .post-prose) figcaption {
  color: var(--post-ink-3);
  font-size: 15.75px;
  margin-top: 10px;
}
:is(.post--article #markdown-content, .post-prose) .post-refs {
  font-size: 15.75px;
  line-height: 1.65;
  margin-bottom: 8px;
  padding-left: 2.2em;
  text-indent: -2.2em;
}
:is(.post--article #markdown-content, .post-prose) > hr {
  border: 0;
  border-top: 1px solid var(--post-line-soft);
  margin: 72px 0 22px;
  max-width: 660px;
}
:is(.post--article #markdown-content, .post-prose) > hr ~ p {
  color: var(--post-ink-3);
  font-family: var(--post-mono);
  font-size: 13.5px;
  line-height: 1.7;
}
.post--article #table-of-contents {
  display: none;
}

/* ---------- editor preview paper ---------- */
.post-paper__title {
  margin: 0;
}
.post-paper__summary {
  margin: 13.5px 0 0;
}
/* The article hero ends in a hairline before the body; so does the paper. */
.post-paper > .post-prose {
  border-top: 1px solid var(--post-line-soft);
  margin-top: 36px;
  padding-top: 36px;
}
.post-paper > .post-prose:empty {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* ---------- footer ---------- */
.post-footer-nav {
  border-top: 1px solid var(--post-line-soft);
  font-family: var(--post-mono);
  margin-top: 72px;
  max-width: 660px;
  padding-top: 22px;
}
.post-footer-nav p {
  color: var(--post-ink-3);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}
.post-footer-nav a {
  color: var(--post-ink-2);
  font-size: 13.5px;
  text-decoration: none;
}
.post-footer-nav a:hover {
  color: var(--post-ink);
}
.post--article a:focus-visible,
.post--article button:focus-visible {
  outline: 1px solid var(--post-ink);
  outline-offset: 3px;
}

/* ---------- motion ---------- */
@keyframes post-reveal-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.post--article [data-post-reveal] {
  animation: post-reveal-up 0.7s var(--post-ease) var(--post-reveal-delay, 0s) backwards;
}

/* The reading-preference fonts replace the sans voice everywhere. */
html:is([data-site-font="dyslexic"], [data-site-font="wenkai"])
  :is(.post--article, .post-paper)
  :is(.post-title, .post-description, #markdown-content, .post-paper__title, .post-paper__summary, .post-prose) {
  font-family: var(--site-font-family);
}

/* 选了 Anthropic Sans 时，文章里的小标签和标题连同等宽字体一起换成 Anthropic Mono。 */
html[data-site-font="anthropic-sans"] :is(.post--article, .post-paper) {
  --post-mono: "Anthropic Mono", "SF Mono", ui-monospace, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
}

/* 文楷风格（站长在站点设置里选了「文楷」才会出现）：标题前缀 # 号，加粗文字像荧光笔划过。 */
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) :is(h2, h3, h4) {
  font-family: var(--site-font-family);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) h3 {
  font-size: 19.5px;
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) h4 {
  font-size: 17px;
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) :is(h2, h3, h4)::before {
  color: var(--post-ink-4);
  font-weight: 400;
  margin-right: 0.35em;
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) h2::before {
  content: "#";
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) h3::before {
  content: "##";
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) h4::before {
  content: "###";
}
html[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) strong {
  --post-marker: rgba(255, 196, 82, 0.5);
  background: linear-gradient(transparent 56%, var(--post-marker) 56%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-weight: 700;
  padding: 0 0.12em;
}
html[data-theme="dark"][data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) strong {
  --post-marker: rgba(96, 190, 202, 0.32);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme])[data-site-font="wenkai"] :is(.post--article #markdown-content, .post-prose) strong {
    --post-marker: rgba(96, 190, 202, 0.32);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .post-hero__content,
  .post-column {
    grid-column: 4 / 13;
  }
  .post-rail {
    grid-column: 1 / 4;
    margin-right: 16px;
  }
}
@media (max-width: 820px) {
  .post--article {
    --post-gutter: 20px;
  }
  .post-hero {
    display: block;
    padding: 24px 0 48px;
  }
  :is(.post--article .post-title, .post-paper__title) {
    font-size: 30px;
    line-height: 1.4;
  }
  :is(.post--article .post-description, .post-paper__summary) {
    font-size: 17px;
  }
  .post--article .post-meta {
    align-items: baseline;
    gap: 8px 16px;
    grid-template-columns: max-content minmax(0, 1fr);
  }
  .post--article .post-meta > div {
    display: contents;
  }
  .post--article .post-meta dt {
    margin: 0;
  }
  .post--article .post-meta dd {
    padding-left: 0;
    text-indent: 0;
  }
  .post--article .post-meta dd::before {
    content: none;
  }
  .post-body {
    display: flex;
    flex-direction: column;
    padding-top: 40px;
  }
  .post-column {
    margin-left: 0;
    max-width: none;
    order: 1;
    padding-left: 0;
  }
  .post-rail {
    margin: 40px 0 0;
    min-height: 0;
    order: 2;
    position: static;
  }
  .post-rail__title,
  .post-rail > .post-rail__label,
  .post-tree,
  .post-rail__progress,
  .post-rail__hint {
    display: none;
  }
  :is(.post--article #markdown-content, .post-prose) {
    font-size: 17px;
  }
  /* Without the theme's scroll wrapper a wide table must scroll by itself. */
  :is(.post--article #markdown-content, .post-prose) table {
    display: block;
    overflow-x: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .post-reading-progress {
    animation: none;
    display: none;
  }
  .post--article [data-post-reveal] {
    animation: none;
  }
  .post-rail__title,
  .post-tree a {
    transition: none;
  }
}

/* /assets/third-party/source-serif-4-5.3.0/latin-500.css */
/* @fontsource/source-serif-4@5.3.0 latin-500 (OFL-1.1), self-hosted so the heading font does not depend on a public CDN. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/third-party/source-serif-4-5.3.0/files/source-serif-4-latin-500-normal.woff2) format('woff2');
}

