@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-upright-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg-canvas: #fff;
  --bg-subtle: #f6f9f8;
  --ink-primary: #161a18;
  --ink-secondary: #4a5550;
  --ink-tertiary: #626f69;
  --jade-primary: #16cf8c;
  --jade-ink: #08774f;
  --jade-surface: #e3fbf1;
  --whale-accent: #08774f;
  --whale-logo: #2fcf9e;
  --border-hairline: rgba(18,26,23,.09);
  --border-control: #cbd8d0;
  --action-fill: #181b1a;
  --action-ink: #fff;
  --action-hover: #304139;
  --shadow-stage: 0 24px 64px -16px rgba(14,24,20,.09), 0 4px 16px rgba(14,24,20,.04);
  /* 页首、章节与页脚对齐；横向橱窗也沿用同一条起始线。 */
  --site-max-width: 70rem;
  --site-gutter: clamp(1rem, 4vw, 3rem);
  --site-width: min(var(--site-max-width), 100% - 2 * var(--site-gutter));
  --site-inset: max(var(--site-gutter), (100% - var(--site-max-width)) / 2);
  --site-title-size: clamp(1.625rem, 1.25rem + 1.75vw, 2.625rem);
  --site-section-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --site-subheading-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  --header-height: 64px;
  --site-font: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-family: var(--site-font);
  color: var(--ink-primary);
  background: var(--bg-canvas);
  scrollbar-color: #aebbb4 var(--bg-canvas);
  caret-color: var(--jade-ink);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #141c23;
  --bg-subtle: #1b252e;
  --ink-primary: #edf2f3;
  --ink-secondary: #becbd1;
  --ink-tertiary: #9aaeb9;
  --jade-primary: #64dcb0;
  --jade-ink: #82e3b9;
  --jade-surface: #203c35;
  --whale-accent: #64dcb0;
  --border-hairline: #34424c;
  --border-control: #546773;
  --action-fill: #b6eed6;
  --action-ink: #113527;
  --action-hover: #d2f6e5;
  --shadow-stage: 0 22px 60px -18px rgb(3 9 13 / .54);
  scrollbar-color: #657c88 var(--bg-canvas);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: .23em; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
[id] { scroll-margin-top: calc(var(--header-height) + 20px); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--whale-accent); outline-offset: 3px; }
::selection { color: #103327; background: #b0efd3; }
.site-icon { display: inline-block; flex: none; width: 1.13em; height: 1.13em; vertical-align: -.16em; }
.skip-link { position: fixed; z-index: 120; top: 6px; left: 10px; padding: 8px 15px; background: var(--bg-canvas); border-radius: 4px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; z-index: 50; top: 0; background: color-mix(in srgb, var(--bg-canvas) 95%, transparent); border-bottom: 1px solid var(--border-hairline); backdrop-filter: blur(14px); }
.site-bar { width: var(--site-width); height: calc(var(--header-height) - 1px); margin: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; }
.site-brand { display: inline-flex; width: max-content; min-height: 44px; align-items: center; gap: 7px; font-weight: 650; font-size: 1.0625rem; letter-spacing: -.015em; text-decoration: none; white-space: nowrap; }
.site-brand img { width: 1.75rem; height: auto; }
.site-navigation { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 36px); height: 100%; }
.site-navigation a, .site-actions a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; font-size: 15px; text-decoration: none; font-weight: 560; }
.site-navigation a { position: relative; height: 100%; color: var(--ink-secondary); }
.site-navigation a[aria-current] { color: var(--ink-primary); font-weight: 700; }
.site-navigation a[aria-current]::after { content: ""; height: 3px; border-radius: 2px; background: var(--jade-primary); position: absolute; bottom: 12px; left: 0; right: 0; }
.site-actions { justify-self: end; display: flex; align-items: center; gap: 21px; }
.site-actions .site-github { padding: 0 14px; color: var(--ink-primary); border: 1px solid var(--border-control); border-radius: 30px; font-weight: 650; }
.theme-switch {
  display: none;
  flex: none;
  align-items: center;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}
html[data-theme] .theme-switch { display: inline-flex; }
.theme-track {
  display: block;
  position: relative;
  width: 54px;
  height: 28px;
  border: 1px solid #899995;
  border-radius: 16px;
  background: #e4ece7;
}
.theme-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 50%;
  background: #fffcf1;
  box-shadow: 0 1px 3px rgb(40 56 45 / .28);
}
.theme-thumb .site-icon {
  position: absolute;
  inset: 3px;
  width: 16px;
  height: 16px;
  transform-origin: 50% calc(50% + 13px);
}
.theme-thumb svg:first-child { color: #94580d; transform: rotate(var(--sky-turn, 0deg)); }
.theme-thumb svg:last-child { color: #354675; transform: rotate(calc(180deg - var(--sky-turn, 0deg))); }
html[data-theme="dark"] .theme-switch { --sky-turn: 180deg; }
html[data-theme="dark"] .theme-track { background: #34435f; border-color: #7287a5; }
html[data-theme="dark"] .theme-thumb { transform: translateX(26px); background: #e1e8ff; }
.theme-switch:hover .theme-track { border-color: var(--ink-secondary); }
@media (prefers-reduced-motion: no-preference) {
  .theme-switch.is-animated .theme-track { transition: background-color 300ms, border-color 300ms; }
  .theme-switch.is-animated .theme-thumb,
  .theme-switch.is-animated .site-icon { transition: transform 470ms cubic-bezier(.42,0,.22,1), background-color 320ms; }
}
.site-navigation a:hover, .site-actions a:hover, .site-footer nav a:hover { color: var(--jade-ink); }
.site-footer { border-top: 1px solid var(--border-hairline); }
.site-footer-inner { width: var(--site-width); margin: auto; padding: 46px 0 52px; display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.site-footer small { display: block; margin: 7px 0 0; font-size: 13px; color: var(--ink-tertiary); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.site-footer nav a { font-size: 14px; color: var(--ink-secondary); text-decoration: none; }
.site-viewer { padding: 0; inset: 0; width: min(96vw, 1700px); max-width: 96vw; max-height: 95vh; max-height: 95dvh; border: none; border-radius: 12px; color: var(--ink-primary); background: var(--bg-canvas); }
.site-viewer[open] { display: flex; flex-direction: column; }
.site-viewer::backdrop { background: rgb(14 20 18 / .79); }
body:has(.site-viewer[open]) { overflow: hidden; }
.viewer-toolbar { display: flex; align-items: center; padding: 9px 14px; gap: 12px; border-bottom: 1px solid var(--border-hairline); }
.viewer-toolbar p { flex: 1; font-size: 14px; }
.viewer-toolbar a, .viewer-toolbar button { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-secondary); }
.viewer-toolbar button { border: 0; border-radius: 50%; width: 36px; height: 36px; justify-content: center; background: var(--bg-subtle); }
.viewer-scroll { overflow: auto; overscroll-behavior: contain; background: var(--bg-subtle); display: grid; }
.viewer-scroll img { margin: auto; width: 100%; height: auto; object-fit: contain; max-height: 81vh; }
.viewer-scroll img[data-zoom] { cursor: zoom-in; }
.viewer-scroll img.is-zoomed { width: max(1500px, 140%); max-width: none; max-height: none; cursor: zoom-out; }
.site-primary, .site-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 45px; padding: 9px 21px; border-radius: 32px; font-weight: 640; text-decoration: none; }
.site-primary { color: var(--action-ink); background: var(--action-fill); }
.site-primary:hover { background: var(--action-hover); }
.site-secondary { background: var(--bg-canvas); border: 1px solid var(--border-control); }
.site-secondary:hover { border-color: #729081; }
@media (max-width: 760px) {
  :root { --header-height: 90px; }
  .site-bar { grid-template-columns: 1fr auto; grid-template-rows: 45px 44px; gap: 0 12px; }
  .site-brand { font-size: 1rem; gap: 6px; }
  .site-brand img { width: 1.5rem; }
  .site-navigation { grid-column: 1/-1; grid-row: 2; justify-content: space-between; gap: 8px; }
  .site-navigation a[aria-current]::after { bottom: 0; }
  .site-actions { grid-column: 2; grid-row: 1; gap: 12px; }
  .site-actions a { font-size: 14px; }
  .site-actions .site-github { min-height: 32px; padding: 0 10px; }
  .site-footer-inner { display: grid; }
  .viewer-toolbar p { max-height: 4em; overflow: auto; }
}
@media (max-width: 570px) {
  .site-primary, .site-secondary { padding-inline: 15px; }
  .viewer-toolbar { padding: 6px 8px; gap: 6px; }
}

@media (max-width: 400px) {
  .site-actions { gap: 8px; }
  .site-actions a { white-space: nowrap; }
  .site-actions a .site-icon { display: none; }
}
@media (max-width: 360px) {
  .site-bar { column-gap: 6px; }
  .site-header .site-brand { gap: 4px; font-size: .9375rem; }
  .site-header .site-brand img { width: 20px; }
  .site-actions { gap: 6px; }
  .site-actions .site-github { padding-inline: 6px; }
}

/* 等观察器就绪后才启用入屏效果。打印、无脚本与减少动态模式直接呈现原版面。 */
@media screen and (prefers-reduced-motion: no-preference) {
  .home-motion [data-reveal] {
    --entry-rise: 18px;
    --entry-duration: 460ms;
    --entry-delay: 0ms;
    --entry-scale: 1;
    transform-origin: 50% 100%;
  }
  .home-motion .h-lead[data-reveal] { --entry-rise: 10px; }
  .home-motion .h-stage[data-reveal] {
    --entry-rise: 36px;
    --entry-scale: .98;
    --entry-duration: 680ms;
    --entry-delay: 70ms;
  }
  .home-motion .fg-exhibit[data-reveal] { --entry-rise: 24px; --entry-duration: 540ms; }
  .home-motion .fg-types[data-reveal] { --entry-rise: 10px; --entry-delay: 45ms; }
  .home-motion [data-reveal]:not(.is-revealed, :focus-visible, :has(:focus-visible), :target) {
    opacity: 0;
    translate: 0 var(--entry-rise);
    scale: var(--entry-scale);
  }
  .home-motion .is-revealed {
    transition: opacity var(--entry-duration) ease-out var(--entry-delay),
      translate var(--entry-duration) cubic-bezier(.16,1,.3,1) var(--entry-delay),
      scale var(--entry-duration) cubic-bezier(.16,1,.3,1) var(--entry-delay);
  }
  /* 键盘跳转到交互内容后立即呈现焦点环。 */
  .home-motion [data-reveal]:has(:focus-visible) { transition: none; }
}
