@charset "UTF-8";

:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fbfaf7;
  --ink: #171714;
  --muted: #6e6d66;
  --line: #cfcec6;
  --soft: #e8e6df;
  --signal: #e84b35;
  --focus: #2467d6;
  --code: #20211f;
  --code-ink: #f3f2ec;
  --max: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151513;
  --surface: #1c1c19;
  --ink: #f0efe9;
  --muted: #a5a49b;
  --line: #3d3d38;
  --soft: #262622;
  --signal: #ff735e;
  --focus: #79a8ff;
  --code: #0d0e0d;
  --code-ink: #efeee9;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; transition: background-color .25s ease, color .25s ease; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; font: inherit; }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 16px; background: var(--ink); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.eyebrow { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; }
.wordmark { display: inline-flex; width: fit-content; min-height: 44px; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.2rem; font-style: italic; font-weight: 600; }
.wordmark img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; transition: transform .3s var(--ease); }
.wordmark:hover img { transform: rotate(-4deg) scale(1.06); }
.page-header { display: grid; width: min(calc(100% - var(--gutter) * 2), var(--max)); min-height: 88px; margin: 0 auto; align-items: center; border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto 1fr; }
.page-header nav { display: flex; gap: 30px; }
.page-header nav a { position: relative; display: flex; min-height: 44px; align-items: center; font-size: .82rem; }
.page-header nav a::after { position: absolute; right: 0; bottom: 7px; left: 0; height: 1px; background: currentColor; content: ""; transform: scaleX(0); transform-origin: right; transition: transform .25s var(--ease); }
.page-header nav a:hover::after, .page-header nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.theme-toggle { position: relative; display: grid; width: 44px; height: 44px; padding: 0; place-items: center; justify-self: end; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; transition: background-color .2s ease, transform .2s var(--ease); }
.theme-toggle:hover { background: var(--ink); color: var(--bg); transform: rotate(8deg); }
.theme-toggle:active { transform: rotate(8deg) scale(.92); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.theme-icon { position: absolute; display: grid; place-items: center; transition: transform .25s var(--ease), opacity .2s ease; }
.theme-icon--moon { opacity: 0; transform: rotate(-45deg) scale(.7); }
[data-theme="dark"] .theme-icon--sun { opacity: 0; transform: rotate(45deg) scale(.7); }
[data-theme="dark"] .theme-icon--moon { opacity: 1; transform: none; }

/* 首页：图片与文字保持等权分栏，交互只改变透明度和位移。 */
.home-page { width: min(calc(100% - var(--gutter) * 2), var(--max)); margin: 0 auto; }
.home-intro { display: grid; min-height: 280px; padding: 58px 0 46px; align-content: end; border-bottom: 1px solid var(--line); grid-template-columns: 1fr; gap: clamp(40px, 8vw, 120px); overflow-anchor: none; }
.home-intro .eyebrow { grid-column: 1 / -1; }
.home-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(3.8rem, 9vw, 7.8rem); font-style: italic; font-weight: 400; line-height: .8; }
.home-typewriter { display: inline-flex; width: var(--typewriter-min-width); height: .8em; min-height: .8em; max-height: .8em; align-items: flex-end; contain: layout; overflow-anchor: none; white-space: nowrap; }
.home-typewriter > span { display: inline-block; line-height: .8; white-space: nowrap; }
.home-typewriter > i { display: inline-block; width: 2px; height: .68em; margin-left: .035em; background: var(--signal); opacity: .9; transform: skewX(-8deg); animation: typewriter-caret .72s steps(1, end) infinite; }
@keyframes typewriter-caret { 50% { opacity: .15; } }
.home-intro > p:last-child { max-width: 360px; margin: 0; align-self: end; color: var(--muted); }
.home-columns { display: grid; grid-template-columns: 1fr 1fr; }
.image-column, .writing-column { min-width: 0; padding-block: 38px 100px; }
.image-column { padding-right: clamp(28px, 5vw, 72px); border-right: 1px solid var(--line); }
.writing-column { padding-left: clamp(28px, 5vw, 72px); }
.column-heading { display: flex; height: 50px; align-items: start; justify-content: space-between; }
.column-heading h2 { margin: 0; font-size: .82rem; font-weight: 600; }
.column-heading span { color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.image-stage { position: sticky; top: 24px; height: min(68vh, 720px); min-height: 470px; overflow: hidden; background: var(--soft); }
.image-preview { position: absolute; display: block; opacity: 0; pointer-events: none; inset: 0; transform: scale(1.025); transition: opacity .4s ease, transform .65s var(--ease); }
.image-preview.is-active { opacity: 1; pointer-events: auto; transform: none; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview::after { position: absolute; background: linear-gradient(transparent 65%, rgba(0,0,0,.55)); content: ""; inset: 0; }
.image-preview > span { position: absolute; z-index: 1; right: 20px; bottom: 18px; left: 20px; color: #fff; font-size: .84rem; }
.image-index { position: absolute; z-index: 2; top: 14px; right: 14px; display: flex; gap: 4px; }
.image-index button { width: 44px; height: 44px; padding: 0; border: 0; background: rgba(20,20,18,.55); color: rgba(255,255,255,.65); cursor: pointer; font-family: var(--mono); font-size: .62rem; backdrop-filter: blur(8px); transition: background-color .2s ease, color .2s ease; }
.image-index button:hover, .image-index button.is-active { background: #f6f5ef; color: #171714; }
.image-empty { display: grid; height: 100%; place-items: center; color: var(--muted); }
.writing-list { border-top: 1px solid var(--line); }
.writing-item { border-bottom: 1px solid var(--line); }
.writing-item > a { position: relative; display: block; min-height: 188px; padding: 22px 58px 22px 0; transition: padding .3s var(--ease); }
.writing-item > a:hover { padding-left: 14px; }
.writing-meta { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: .65rem; }
.writing-item h3 { margin: 23px 0 8px; font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 500; line-height: 1.3; }
.writing-item p { margin: 0; color: var(--muted); font-size: .84rem; }
.writing-arrow { position: absolute; right: 5px; bottom: 26px; display: grid; width: 44px; height: 44px; place-items: center; transition: transform .25s var(--ease); }
.writing-arrow svg, .archive-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.writing-item a:hover .writing-arrow { transform: translate(5px, -5px); }
.archive-link { display: inline-flex; min-height: 48px; margin-top: 28px; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); font-size: .8rem; }

/* 列表、标签和项目页共享首页版心。 */
.listing-page, .simple-page { width: min(calc(100% - var(--gutter) * 2), var(--max)); min-height: 60dvh; margin: 0 auto; padding-bottom: 110px; }
.listing-hero { display: grid; min-height: 240px; padding: 46px 0 34px; align-content: end; border-bottom: 1px solid var(--line); }
.listing-hero h1 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(3.4rem, 7vw, 5.8rem); font-style: italic; font-weight: 400; line-height: .9; }
.compact-list { border-top: 1px solid var(--line); margin-top: 42px; }
.compact-list a { display: grid; min-height: 96px; padding: 18px 12px; align-items: center; border-bottom: 1px solid var(--line); grid-template-columns: 60px 1fr auto; gap: 20px; transition: padding .25s var(--ease), background-color .2s ease; }
.compact-list a:hover { padding-inline: 24px; background: var(--ink); color: var(--bg); }
.compact-list__number, .compact-list time { color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.compact-list__title { font-size: clamp(1.08rem, 1.7vw, 1.45rem); }
.tag-index { display: grid; border-top: 1px solid var(--line); margin-top: 42px; grid-template-columns: repeat(2, 1fr); }
.tag-index a { display: flex; min-height: 132px; padding: 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); transition: background-color .2s ease, padding .25s var(--ease); }
.tag-index a:nth-child(odd) { border-right: 1px solid var(--line); }
.tag-index a:hover { padding-inline: 34px; background: var(--ink); color: var(--bg); }
.tag-index span { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 3.2rem); }
.tag-index sup { font-family: var(--mono); }
.project-grid { display: grid; margin-top: 42px; border-top: 1px solid var(--line); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card { min-width: 0; padding: 32px 0 44px; border-bottom: 1px solid var(--line); }
.project-card:nth-child(odd) { padding-right: clamp(24px, 4vw, 56px); border-right: 1px solid var(--line); }
.project-card:nth-child(even) { padding-left: clamp(24px, 4vw, 56px); }
.project-card__content { display: block; }
.project-card__content > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(.75); transition: filter .3s ease, transform .5s var(--ease); }
.project-card__content:hover > img { filter: saturate(1); transform: scale(.985); }
.project-card__body { padding-top: 24px; }
.project-card__meta { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.project-card h2 { margin: 28px 0 8px; font-size: 2rem; font-weight: 500; }
.project-card p { color: var(--muted); }
.project-card__stack { display: flex; margin: 22px 0; flex-wrap: wrap; gap: 6px 18px; }
.project-card__stack span { color: var(--muted); font-size: .72rem; }
.project-card__action { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; border-bottom: 1px solid currentColor; font-size: .8rem; }
.project-card__action > span { transition: transform .25s var(--ease); }
.project-card__content:hover .project-card__action > span { transform: translate(3px, -3px); }
.project-empty { display: flex; min-height: 220px; margin-top: 42px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.project-empty span { font-family: var(--mono); font-size: .68rem; }
.project-empty p { margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.6rem); font-style: italic; }

/* 文章页保留目录能力，视觉收敛为连续纸面。 */
.reading-frame { display: none; }
.article-back { position: fixed; z-index: 20; top: 18px; left: 24px; display: flex; min-height: 44px; align-items: center; gap: 8px; }
.is-article > .theme-toggle { position: fixed; z-index: 20; top: 18px; right: 24px; }
.article-shell, .article-shell--image { display: grid; width: min(calc(100% - var(--gutter) * 2), 1100px); margin: 86px auto 70px; align-items: start; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); }
.article-shell--image { width: min(calc(100% - var(--gutter) * 2), 1280px); }
.paper { padding: clamp(42px, 7vw, 86px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.article-header__meta { display: flex; margin-bottom: 36px; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: .68rem; }
.article-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 4.8rem); font-weight: 400; line-height: 1.08; }
.article-deck { max-width: 660px; margin: 24px 0; color: var(--muted); font-size: 1.05rem; }
.article-tags { display: flex; flex-wrap: wrap; gap: 18px; }
.article-tags a { border-bottom: 1px solid var(--line); font-size: .74rem; }
.article-cover { overflow: hidden; margin: 48px 0; }
.article-cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.article-content { max-width: 700px; margin: 58px auto 0; font-family: var(--serif); font-size: 1.06rem; line-height: 1.9; }
.article-content h2, .article-content h3 { margin: 2.4em 0 .8em; font-family: var(--sans); line-height: 1.3; }
.article-content h2 { font-size: 1.9rem; }.article-content h3 { font-size: 1.35rem; }
.article-content a { border-bottom: 1px solid var(--signal); }
.article-content img { height: auto; margin: 36px auto; }
.article-content blockquote { margin: 36px 0; padding: 18px 24px; border-left: 2px solid var(--signal); background: var(--soft); }
.article-content > pre, .article-content .highlight { overflow: auto; padding: 22px; background: var(--code); color: var(--code-ink); font-family: var(--mono); font-size: .82rem; }
.article-content .highlight pre { overflow: visible; margin: 0; padding: 0; background: transparent; color: inherit; font: inherit; }
.article-content .highlight table { width: max-content; border-collapse: collapse; }
.article-content .highlight .gutter { padding-right: 16px; color: color-mix(in srgb, var(--code-ink) 45%, transparent); text-align: right; user-select: none; }
.toc { position: sticky; top: 108px; padding-block: 18px; border-block: 1px solid var(--line); }
.toc__label { display: block; margin-bottom: 18px; color: var(--muted); font-family: var(--mono); font-size: .62rem; }
.toc__toggle { display: none; }
.toc__list { display: flex; flex-direction: column; gap: 4px; }
.toc__list a { position: relative; display: flex; min-height: 36px; align-items: center; color: var(--muted); font-size: .76rem; transition: color .2s ease, transform .2s var(--ease); }
.toc__list a::before { width: 0; height: 1px; margin-right: 0; background: var(--signal); content: ""; transition: width .2s var(--ease), margin-right .2s var(--ease); }
.toc__list a:hover, .toc__list a.is-active { color: var(--ink); transform: translateX(2px); }
.toc__list a.is-active::before { width: 14px; margin-right: 7px; }
.toc__list a[data-level="3"] { padding-left: 16px; color: var(--muted); font-size: .7rem; }
.simple-page article { max-width: 760px; margin: 70px auto; }.simple-page h1 { font-family: var(--serif); font-size: clamp(3rem, 8vw, 6rem); font-weight: 400; }

.site-footer { width: min(calc(100% - var(--gutter) * 2), var(--max)); margin: 0 auto; padding: 42px 0 28px; border-top: 1px solid var(--line); }
.site-footer__main { display: grid; min-height: 110px; align-items: start; grid-template-columns: 1fr 1fr auto; gap: 40px; }
.site-footer__main p { margin: 0; color: var(--muted); font-size: .82rem; }
.site-footer nav { display: flex; gap: 24px; }.site-footer nav a { min-height: 44px; font-size: .78rem; }
.site-footer__meta { display: flex; padding-top: 20px; border-top: 1px solid var(--line); justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: .62rem; }
.site-footer__records { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 20px; }
.site-footer__records a { transition: color .2s ease; }.site-footer__records a:hover { color: var(--ink); }
.custom-cursor { display: none; }
.has-js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.has-js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .article-shell, .article-shell--image { display: flex; width: calc(100% - 20px); margin-top: 72px; flex-direction: column; gap: 0; }
  .toc { position: static; display: block; width: 100%; margin-bottom: 22px; padding: 0; border: 0; }
  .toc__label { display: none; }
  .toc__toggle { display: flex; width: 100%; min-height: 48px; padding: 0 16px; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
  .toc__list { display: none; padding: 12px 16px 16px; border: 1px solid var(--line); border-top: 0; background: var(--surface); flex-direction: column; gap: 2px; }.toc.is-open .toc__list { display: flex; }
  .toc__list a { min-height: 40px; }.toc__list a[data-level="3"] { padding-left: 18px; }
}
@media (max-width: 720px) {
  .wordmark { gap: 8px; font-size: 1.08rem; }.wordmark img { width: 26px; height: 26px; flex-basis: 26px; }
  .page-header { min-height: 72px; grid-template-columns: 1fr auto; }.page-header nav { position: fixed; z-index: 50; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; justify-content: space-around; padding: 4px 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }.page-header nav a { padding: 0 10px; }.page-header .theme-toggle { grid-column: 2; grid-row: 1; }
  .home-intro { min-height: 240px; padding-top: 42px; grid-template-columns: 1fr; gap: 24px; }.home-intro .eyebrow { grid-column: auto; }.home-intro h1 { font-size: clamp(3.6rem, 18vw, 5.6rem); }.home-intro > p:last-child { justify-self: start; }
  .home-columns { grid-template-columns: 1fr; }.image-column { padding-right: 0; border-right: 0; }.writing-column { padding: 40px 0 90px; border-top: 1px solid var(--line); }.image-stage { position: relative; top: auto; height: min(66vh, 580px); min-height: 420px; }
  .listing-hero { min-height: 210px; }.listing-hero h1 { font-size: clamp(3rem, 14vw, 4.2rem); }.compact-list a { grid-template-columns: 42px 1fr; }.compact-list time { display: none; }
  .tag-index, .project-grid { grid-template-columns: 1fr; }.tag-index a:nth-child(odd), .project-card:nth-child(odd) { border-right: 0; }.project-card:nth-child(odd), .project-card:nth-child(even) { padding-inline: 0; }
  .paper { width: 100%; padding: 62px 22px 48px; }.article-header h1 { font-size: 2rem; line-height: 1.15; overflow-wrap: anywhere; }.article-content { font-size: 1rem; }.article-content h2 { font-size: 1.5rem; }.article-content h3 { font-size: 1.2rem; }.article-content > pre, .article-content .highlight { width: calc(100% + 44px); margin-inline: -22px; padding: 18px 16px; }.article-back { top: 12px; left: 14px; }.article-back span { display: none; }.is-article > .theme-toggle { top: 10px; right: 14px; }
  .site-footer { padding-bottom: 92px; }.site-footer__main { grid-template-columns: 1fr; gap: 18px; }.site-footer nav { flex-wrap: wrap; }.site-footer__meta { gap: 12px; flex-direction: column; }.site-footer__records { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }.has-js [data-reveal] { opacity: 1; transform: none; }.home-typewriter > i { opacity: 0; }
}
