:root {
  --paper: #f3f1ee;
  --paper-warm: #e8e1dd;
  --ink: #302528;
  --muted: #746b6b;
  --rose: #86666d;
  --rose-soft: #b69b9e;
  --blue: #6d87a0;
  --blue-soft: #b5c7d0;
  --line: rgba(48, 37, 40, .16);
  --dark: #302528;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "微软雅黑", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
::selection { background: var(--ink); color: var(--paper); }
.site-nav { position: fixed; z-index: 30; inset: 0 0 auto; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: rgba(243,241,238,.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.brand-mark { width: 36px; height: 36px; display: inline-block; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 3px rgba(243,241,238,.9), 0 0 0 4px var(--rose-soft); }
.nav-links { display: flex; gap: 32px; align-items: center; font-size: 14px; color: var(--muted); }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.nav-toggle { display: none; border: 0; background: none; font-size: 24px; cursor: pointer; }
.mobile-menu { position: fixed; z-index: 29; top: 72px; left: 12px; right: 12px; padding: 8px 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(48,37,40,.13); }
.mobile-menu a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mobile-menu a:last-child { border-bottom: 0; }
.progress { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 2px; background: rgba(48,37,40,.08); }
.progress span { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--blue); }
.hero { min-height: 100svh; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 150px 5vw 42px; }
.hero::before { content: ""; position: absolute; inset: 0; background: url('../img/mist.jpg') center / cover; animation: hero-settle 2.4s cubic-bezier(.22,.61,.36,1) both; }
@keyframes hero-settle { from { transform: scale(1.1); filter: saturate(.7); } to { transform: scale(1); filter: saturate(1); } }
.hero-inner { position: absolute; z-index: 1; left: 5vw; bottom: 74px; max-width: 820px; }
.hero-foot { position: absolute; z-index: 1; left: 5vw; right: 5vw; bottom: 34px; }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0; color: var(--muted); font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { color: var(--blue); }
.hero-title { max-width: 980px; margin: 0; font-family: var(--display); font-size: clamp(44px, 7vw, 104px); line-height: .86; letter-spacing: -.08em; font-weight: 700; opacity: 0; transform: translateY(30px); animation: hero-title-in 1.1s cubic-bezier(.16,1,.3,1) .55s both; text-shadow: 0 1px 2px rgba(255,255,255,.9), 0 2px 26px rgba(255,255,255,.95), 0 0 64px rgba(255,255,255,.85); }
@keyframes hero-title-in { to { opacity: 1; transform: none; } }
.hero-word { display: inline-block; margin-left: 0; color: #39262c; font-family: var(--serif); font-style: italic; font-weight: 550; transition: opacity .25s, transform .25s; }
.hero-word.is-changing { opacity: 0; transform: translateY(12px); }
.hero-copy { max-width: 540px; margin: 0; color: rgba(48,37,40,.72); font-family: var(--serif); font-size: clamp(16px, 1.55vw, 22px); line-height: 1.7; }
.hero-foot { display: flex; justify-content: space-between; align-items: end; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.status { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(109,135,160,.16); }
.scroll-cue { display: flex; gap: 14px; align-items: center; color: var(--ink); }
.scroll-cue b { font-size: 18px; font-weight: 400; }
.journal { padding: 104px 5vw 130px; }
.journal-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.journal-head .count { margin: 0; color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.filter-bar { position: sticky; top: 72px; z-index: 12; display: grid; grid-template-columns: minmax(230px, .65fr) 1.35fr; gap: 34px; align-items: center; margin: 0 -5vw; padding: 18px 5vw; background: rgba(243,241,238,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.search-field { display: flex; align-items: center; gap: 9px; min-height: 42px; border-bottom: 1px solid rgba(48,37,40,.36); }
.search-field span { color: var(--blue); font-size: 22px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-field input::placeholder { color: rgba(48,37,40,.43); }
.search-field button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 19px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.chip:hover, .chip.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.ledger { max-width: 1240px; }
.year-mark { display: grid; grid-template-columns: 20.5% 1fr; gap: 28px; align-items: center; padding: 42px 0 14px; color: var(--rose); font: 11px var(--mono); letter-spacing: .1em; }
.year-mark span { text-align: right; padding-right: 14px; }
.year-mark i { display: block; height: 1px; background: var(--line); }
.entry { border-bottom: 1px solid var(--line); }
.entry-link { display: grid; grid-template-columns: 20.5% minmax(0, 1fr) 140px 30px; gap: 28px; padding: 28px 0 31px; transition: background .2s, padding .25s; }
.entry-link:hover { padding-left: 14px; padding-right: 14px; background: rgba(204,181,177,.13); }
.entry-no { padding-top: 5px; text-align: right; padding-right: 14px; color: var(--muted); font: 10px var(--mono); }
.entry-title { margin: 0; font-size: clamp(22px, 3vw, 42px); line-height: 1.06; letter-spacing: -.045em; font-weight: 600; }
.entry-excerpt { max-width: 660px; margin: 13px 0 0; color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.7; }
.entry-side { display: flex; flex-direction: column; gap: 12px; padding-top: 7px; color: var(--muted); font: 12px var(--mono); }
.entry-side em { color: var(--rose); font-style: normal; line-height: 1.5; overflow-wrap: anywhere; }
.entry-arrow { padding-top: 1px; color: var(--blue); font-size: 23px; transition: transform .2s; }
.entry-link:hover .entry-arrow { transform: translate(4px,-4px); }
.empty-state { padding: 70px 0; color: var(--muted); font: 11px var(--mono); text-align: center; }
.site-footer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: center; padding: 34px 5vw; background: var(--dark); border-top: 1px solid rgba(240,233,229,.2); color: rgba(240,233,229,.58); font: 10px var(--mono); }
.brand-light { color: #f0e9e5; }.foot-motto { text-align: center; }.foot-meta { margin: 0; text-align: right; }.foot-meta b { color: var(--rose-soft); font-weight: 400; }
.mini-hero { min-height: clamp(380px, 48svh, 540px); display: flex; flex-direction: column; justify-content: flex-end; padding: 200px 5vw 92px; background: url('../img/mist.jpg') center 46% / cover; border-bottom: 1px solid var(--line); }.page-title { margin: 74px 0 0; font-family: var(--display); font-size: clamp(58px, 10vw, 150px); line-height: .82; letter-spacing: -.08em; font-weight: 600; text-shadow: 0 1px 24px rgba(255,255,255,.55); }.dot-accent { color: var(--blue); }
.post-cover { position: relative; background: var(--dark); color: #f0e9e5; padding: clamp(130px, 17vh, 180px) 5vw 62px; }.post-bg-img { display: none; }.post-cover::after { display: none; }.post-info { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; color: #f0e9e5; }.cover-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0 0 16px; color: rgba(240,233,229,.58); font: 10px var(--mono); letter-spacing: .13em; text-transform: uppercase; }.post-title { max-width: 1050px; margin: 0; font-family: var(--display); font-size: clamp(40px, 6.2vw, 92px); line-height: 1.02; letter-spacing: -.06em; font-weight: 550; }.cover-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 0; }.cover-tags a { padding: 5px 11px; border: 1px solid rgba(245,238,233,.32); border-radius: 999px; font: 9px var(--mono); letter-spacing: .07em; }.cover-tags a:hover { border-color: #f5eee9; }.article-wrap { display: flex; gap: 15px; max-width: 1240px; margin: 0 auto; padding: 36px 15px 64px; }.post-card { width: 73%; min-width: 0; align-self: flex-start; background: var(--cream); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 14px rgba(48,37,40,.07); padding: clamp(36px, 4vw, 50px) clamp(22px, 3.2vw, 44px); }.aside-col { width: 27%; min-width: 240px; padding-left: 15px; }.aside-sticky { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 18px; }.toc { background: var(--cream); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 14px rgba(48,37,40,.07); padding: 24px 20px; }.toc > p { margin: 0 0 14px; color: var(--muted); font: 10px var(--mono); letter-spacing: .14em; }.toc ol ol { margin-top: 2px; }.toc ol { margin: 0; padding: 0; list-style: none; }.toc li + li { margin-top: 3px; }.toc .toc-child { padding-left: 15px; border-left: 1px solid var(--line); margin-left: 8px; }.toc a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; transition: background .15s ease, color .15s ease; }.toc a:hover { color: var(--ink); background: rgba(204,181,177,.18); }.toc a.active { color: #fff; background: var(--blue); }.back-link { display: inline-block; margin-top: 34px; color: var(--blue); font: 10px var(--mono); }.prose { width: 100%; max-width: none; color: #433a3b; font-family: var(--serif); font-size: 16.5px; line-height: 1.95; }.prose > p:first-child { margin-top: 0; color: var(--ink); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.7; }.prose h1,.prose h2,.prose h3,.prose h4 { color: var(--ink); font-family: var(--sans); line-height: 1.25; letter-spacing: -.03em; }.prose h1,.prose h2 { margin: 46px 0 18px; padding-top: 20px; border-top: 1px solid var(--line); font-size: clamp(24px, 2.6vw, 34px); scroll-margin-top: 90px; }.prose h3 { margin: 34px 0 14px; font-size: clamp(20px, 2vw, 26px); scroll-margin-top: 90px; }.prose p { margin: 1em 0; }.prose ul,.prose ol { padding-left: 1.35em; }.prose li { margin: .35em 0; }.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }.prose strong { color: var(--ink); }.prose blockquote { margin: 1.6em 0; padding: 6px 0 6px 20px; border-left: 2px solid var(--rose); color: var(--muted); }.prose code { padding: .13em .4em; background: rgba(109,135,160,.13); border-radius: 4px; font-family: var(--mono); font-size: .84em; word-break: break-all; }.prose pre { overflow-x: auto; padding: 18px 20px; background: var(--dark); color: #f0e9e5; border-radius: 8px; font: 12.5px/1.7 var(--mono); }.prose pre code { padding: 0; background: transparent; border-radius: 0; word-break: normal; }.prose img { display: block; max-width: 100%; height: auto; border-radius: 8px; }.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; }.prose th,.prose td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }.figure { margin: 1.6em 0; text-align: center; }.figcaption { margin-top: 8px; color: var(--muted); font: 11px/1.6 var(--mono); }.pager { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-warm); border-top: 1px solid var(--line); }.pager-item { min-height: 210px; display: flex; flex-direction: column; justify-content: center; padding: 38px 5vw; transition: background .2s; }.pager-item:hover { background: var(--paper); }.pager-item + .pager-item { border-left: 1px solid var(--line); }.pager-item span { margin-bottom: 13px; color: var(--muted); font: 9px var(--mono); }.pager-item strong { max-width: 520px; font-size: clamp(20px, 2.3vw, 34px); line-height: 1.08; font-weight: 500; }.pager-next { align-items: end; text-align: right; }.pager-ghost { color: var(--muted); }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }.is-visible { opacity: 1; transform: none; }
@media (max-width: 900px) { .filter-bar { grid-template-columns: 1fr; gap: 10px; }.entry-link { grid-template-columns: 70px minmax(0,1fr) 28px; }.entry-side { grid-column: 2; grid-row: 2; flex-direction: row; padding-top: 0; }.entry-arrow { grid-column: 3; grid-row: 1; }.entry-no { text-align: left; padding-right: 0; }.article-wrap { flex-direction: column; }.post-card { width: 100%; padding: 34px 22px; }.aside-col { width: 100%; padding-left: 0; order: 2; }.aside-sticky { position: static; }.site-footer { grid-template-columns: 1fr 1fr; }.foot-motto { display: none; } }
@media (max-width: 640px) { .site-nav { height: 64px; padding: 0 20px; }.nav-links { display: none; }.nav-toggle { display: block; }.mobile-menu { top: 64px; }.hero { min-height: 780px; padding: 112px 20px 28px; }.hero::before { background-position: 65% center; }.hero-inner { left: 20px; right: 20px; bottom: 132px; }.hero-foot { left: 20px; right: 20px; bottom: 28px; } }.hero-copy { font-size: 15px; }.hero-foot { font-size: 9px; }.journal { padding: 78px 20px 95px; }.journal-head { display: block; padding-bottom: 27px; }.journal-head .count { margin-top: 18px; }.filter-bar { top: 64px; margin: 0 -20px; padding: 12px 20px 14px; }.year-mark { grid-template-columns: 42px 1fr; gap: 15px; padding-top: 32px; }.year-mark span { text-align: left; padding: 0; }.entry-link { grid-template-columns: 35px minmax(0,1fr) 25px; gap: 14px; padding: 24px 0 28px; }.entry-link:hover { padding-left: 0; padding-right: 0; }.entry-no { font-size: 9px; }.entry-title { font-size: 28px; }.entry-excerpt { font-size: 14px; }.entry-side { grid-column: 2 / 4; font-size: 11px; }.site-footer { display: block; padding: 30px 20px; }.foot-meta { margin-top: 24px; text-align: left; line-height: 1.8; }.mini-hero { padding: 120px 20px 60px; }.page-title { margin-top: 64px; font-size: 70px; }.post-cover { padding: 112px 20px 46px; }.cover-meta { gap: 6px 16px; font-size: 9px; }.post-title { font-size: clamp(30px, 8vw, 52px); }.article-wrap { padding: 22px 10px 50px; }.post-card { padding: 26px 18px; }.toc { padding: 18px 16px; }.back-link { display: block; margin-top: 2px; text-align: center; }.prose { font-size: 16px; line-height: 1.86; }.prose > p:first-child { font-size: 20px; }.prose pre { margin-left: -20px; margin-right: -20px; padding: 20px; }.pager { min-height: 160px; }.pager-item { min-height: 160px; padding: 28px 16px; }.pager-item strong { font-size: 18px; overflow-wrap: anywhere; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* About 页面 */
.about-band { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(30px, 4.5vw, 70px); align-items: center; max-width: 1240px; margin: 0 auto; padding: 92px 5vw 48px; }
.about-avatar { width: clamp(148px, 16vw, 206px); aspect-ratio: 1; object-fit: cover; border-radius: 30%; border: 1px solid var(--rose); }
.about-name { margin: 0 0 16px; font-family: var(--display); font-size: clamp(34px, 4.2vw, 58px); line-height: 1; letter-spacing: -.05em; font-weight: 600; }
.about-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.about-roles li { padding: 8px 13px; border: 1px solid rgba(134,102,109,.42); border-radius: 999px; color: var(--rose); font: 11px var(--mono); letter-spacing: .08em; }
.about-intro { max-width: 580px; margin: 0 0 28px; color: var(--muted); font-family: var(--serif); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.85; }
.about-contact { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); list-style: none; }
.about-contact li { display: flex; align-items: baseline; gap: 12px; font-size: 13px; overflow-wrap: anywhere; }
.about-contact em { color: var(--blue); font: 9px var(--mono); font-style: normal; letter-spacing: .12em; }
.about-contact a { border-bottom: 1px solid var(--rose-soft); }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; max-width: 1240px; margin: 0 auto; padding: 0 5vw 115px; list-style: none; }
.about-stats li { display: flex; flex-direction: column; gap: 12px; padding: 20px 4px 4px; border-top: 1px solid var(--line); }
.about-stats span { color: var(--muted); font: 9px var(--mono); letter-spacing: .14em; }
.about-stats b { font-family: var(--display); font-size: clamp(28px, 3.4vw, 48px); line-height: .95; letter-spacing: -.04em; font-weight: 600; }
@media (max-width: 900px) { .about-stats { grid-template-columns: repeat(2, 1fr); row-gap: 30px; padding-bottom: 92px; } }
@media (max-width: 640px) { .about-band { grid-template-columns: 1fr; align-items: start; padding: 58px 20px 40px; } .about-avatar { width: 116px; } }

/* macOS 风格代码块（红绿灯窗口 + 复制按钮） */
.mac-code { margin: 1.8em 0; border-radius: 10px; overflow: hidden; border: 1px solid rgba(240,233,229,.08); box-shadow: 0 3px 14px rgba(48,37,40,.1); }
.mac-code-head { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; background: #3a2e33; }
.mac-dots { display: flex; gap: 7px; }
.mac-dots i { display: block; width: 11px; height: 11px; border-radius: 50%; }
.mac-dots .r { background: #ff5f57; } .mac-dots .y { background: #febc2e; } .mac-dots .g { background: #28c840; }
.mac-lang { margin-left: auto; color: rgba(240,233,229,.55); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.mac-copy { border: 0; background: rgba(240,233,229,.09); color: rgba(240,233,229,.78); font: 11px var(--mono); padding: 5px 13px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.mac-copy:hover { color: #fff; background: rgba(240,233,229,.18); }
.mac-copy.ok { color: #7fdca4; }
.mac-code-body { background: var(--dark); }
.mac-code-body figure.highlight { margin: 0; }
.mac-code-body table { width: 100%; border-collapse: collapse; font-family: var(--mono); }
.mac-code-body td.gutter { width: 2.6em; padding: 14px 0 14px 16px; text-align: right; color: rgba(240,233,229,.32); font-size: 12.5px; line-height: 1.7; vertical-align: top; user-select: none; -webkit-user-select: none; }
.mac-code-body td.code { padding: 14px 16px 14px 12px; width: auto; max-width: 0; }
.mac-code-body pre { margin: 0 !important; padding: 0 !important; background: transparent !important; border-radius: 0 !important; box-shadow: none !important; font: 12.5px/1.75 var(--mono); overflow-x: auto; }

/* 深色表面上的文本选中效果（避免与深色背景同色导致不可见） */
.post-cover::selection, .post-cover ::selection,
.statement::selection, .statement ::selection,
.site-footer::selection, .site-footer ::selection,
.mac-code::selection, .mac-code ::selection {
  background: rgba(142, 172, 196, .62);
  color: #fdfaf8;
}

/* 友链页 */
.friends-intro { max-width: 1240px; margin: 0 auto; padding: 10px 5vw 6px; }
.friends-intro p { margin: 0; color: var(--muted); font-family: var(--serif); font-size: clamp(15px, 1.4vw, 19px); line-height: 1.8; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; max-width: 1240px; margin: 0 auto; padding: 26px 5vw 110px; }
.friend-card { display: flex; align-items: center; gap: 14px; padding: 20px 18px; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 10px rgba(48,37,40,.05); transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s; }
.friend-card:hover { transform: translateY(-4px); border-color: var(--rose-soft); box-shadow: 0 12px 30px rgba(48,37,40,.11); }
.friend-avatar { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 50%; border: 1px solid var(--rose-soft); }
.friend-fallback { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rose); color: var(--rose); font: 600 20px/1 var(--display); }
.friend-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.friend-body b { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 15px; letter-spacing: -.01em; }
.friend-body b em { padding: 2px 7px; border-radius: 999px; background: rgba(109,135,160,.16); color: var(--blue); font: italic 9px/1.4 var(--serif); }
.friend-body small { color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.55; }
.friend-body code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font: 10px var(--mono); letter-spacing: .04em; }
@media (max-width: 640px) { .friend-grid { gap: 12px; padding-bottom: 80px; } .friend-card { padding: 16px 14px; } }

/* 评论区（Gitalk）融入莫兰迪风格 */
.comments { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.comments-head { margin: 0 0 20px; color: var(--muted); font: 9px var(--mono); letter-spacing: .14em; }
.comments .gt-container .gt-header-textarea { background: var(--paper); border-color: var(--line); }
.comments .gt-container a { color: var(--blue); }
.comments .gt-container .gt-btn { background: var(--blue); border-color: var(--blue); }
.comments .gt-container .gt-btn:hover { background: #6b8399; }
.comments .gt-container .gt-comment-content { background: var(--paper); }
.comments .gt-container .gt-comment-username { color: var(--rose); }

/* ===== 全站动效层 ===== */
/* 导航：滚离顶部后收窄并加深 */
.site-nav { transition: height .3s ease, background .3s ease, box-shadow .3s ease, border-color .3s ease; }
.site-nav.is-scrolled { height: 58px; background: rgba(243,241,238,.9); box-shadow: 0 8px 28px rgba(48,37,40,.08); }
/* 账本条目：交错浮现 + 悬停箭头联动 */
.entry { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1); }
.entry.is-visible { opacity: 1; transform: none; }
.entry-link:hover .entry-title { color: var(--rose); }
.entry-title { transition: color .25s ease; }
/* 年份分隔线绘制动画 */
.year-mark i { transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.16,1,.3,1) .15s; }
.year-mark.is-visible i { transform: scaleX(1); }
/* 卡片与目录悬停微交互 */
.post-card { transition: box-shadow .3s ease, transform .3s ease; }
.post-card:hover { box-shadow: 0 10px 34px rgba(48,37,40,.12); }
.friend-card { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .55s ease, transform .55s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, border-color .25s ease; }
.friend-card.is-visible { opacity: 1; transform: none; }
.friend-card:hover .friend-fallback { transform: rotate(8deg) scale(1.06); }
.friend-fallback { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.toc a { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.toc a.active { padding-left: 14px; }
/* 正文图片悬停放大 */
.prose img { transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease; }
.prose img:hover { transform: scale(1.015); box-shadow: 0 10px 30px rgba(48,37,40,.14); }
/* macOS 代码块入场 */
.mac-code { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1); }
.mac-code.is-visible { opacity: 1; transform: none; }
/* 文章标题字符渐入 */
.post-title { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.16,1,.3,1); }
.post-title.is-visible { opacity: 1; transform: none; }
/* 返回顶部按钮 */
.to-top { position: fixed; right: 26px; bottom: 26px; z-index: 40; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rose-soft); border-radius: 50%; background: rgba(243,241,238,.92); color: var(--rose); font-size: 18px; cursor: pointer; opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .3s ease, transform .3s cubic-bezier(.16,1,.3,1), background .2s, color .2s; backdrop-filter: blur(8px); }
.to-top.is-show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--rose); color: #fff; }
/* 滚动条美化 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(134,102,109,.45); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }
::-webkit-scrollbar-track { background: transparent; }
/* 深色底文章标题同样参与渐入 */
.post-cover .cover-meta, .post-cover .cover-tags { opacity: 0; transform: translateY(14px); transition: opacity .7s ease .15s, transform .7s cubic-bezier(.16,1,.3,1) .15s; }
.post-cover .is-visible.cover-meta, .post-cover .is-visible.cover-tags, .post-cover .cover-meta.is-visible, .post-cover .cover-tags.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .entry, .friend-card, .mac-code, .post-title, .post-cover .cover-meta, .post-cover .cover-tags { opacity: 1 !important; transform: none !important; transition: none !important; } .year-mark i { transform: none !important; } .to-top { display: none; } }

/* ===== 新增动效（替代视差） ===== */
/* 返回顶部按钮：进度环 */
.to-top-ring { position: absolute; inset: -1px; transform: rotate(-90deg); pointer-events: none; }
.to-top-ring circle { stroke: var(--blue); stroke-dashoffset: 999; transition: stroke-dashoffset .1s linear; }
/* 卡片指针光晕 */
.post-card, .friend-card, .toc { position: relative; --glow-x: 50%; --glow-y: 50%; }
.post-card::after, .friend-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(220px circle at var(--glow-x) var(--glow-y), rgba(204,181,177,.14), transparent 65%); opacity: 0; transition: opacity .3s ease; }
.post-card:hover::after, .friend-card:hover::after { opacity: 1; }
/* 章节标题进入时描画下划线 */
.prose h2, .prose h3 { position: relative; }
.prose h2::after, .prose h3::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 44px; height: 2px; background: var(--rose); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.16,1,.3,1) .1s; }
.prose h2.is-seen::after, .prose h3.is-seen::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .hero-title { opacity: 1 !important; transform: none !important; animation: none !important; } .to-top-ring { display: none; } .prose h2::after, .prose h3::after { transform: scaleX(1); } }

/* ===== 手机端体验优化 ===== */
/* 触屏设备关闭悬停效果，避免点击后样式粘住 */
@media (hover: none), (pointer: coarse) {
  .entry-link:hover { padding-left: 0; padding-right: 0; background: transparent; }
  .prose img:hover { transform: none; box-shadow: none; }
  .friend-card:hover { transform: none; box-shadow: 0 2px 10px rgba(48,37,40,.05); border-color: var(--line); }
  .post-card:hover { box-shadow: 0 3px 14px rgba(48,37,40,.07); }
  .post-card::after, .friend-card::after { display: none; }
}
/* 刘海屏 / 灵动岛安全区 */
.site-nav { padding-left: max(5vw, env(safe-area-inset-left)); padding-right: max(5vw, env(safe-area-inset-right)); }
.hero-foot { left: max(5vw, env(safe-area-inset-left)); right: max(5vw, env(safe-area-inset-right)); }
.filter-bar { padding-left: max(5vw, env(safe-area-inset-left)); padding-right: max(5vw, env(safe-area-inset-right)); }
.site-footer { padding-left: max(5vw, env(safe-area-inset-left)); padding-right: max(5vw, env(safe-area-inset-right)); }
.to-top { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); }
/* 触控目标加大：标签胶囊、导航菜单 */
@media (pointer: coarse) {
  .chip { padding: 12px 16px; }
  .mobile-menu a { padding: 16px 10px; }
  .nav-toggle { min-width: 44px; min-height: 44px; }
  .mac-copy { min-width: 52px; min-height: 36px; }
  .to-top { width: 50px; height: 50px; }
}
/* 手机端文章页：正文两侧贴安全区 */
@media (max-width: 900px) {
  .post-card { border-radius: 0; border-left: 0; border-right: 0; }
  .article-wrap { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .pager-item { padding-left: max(5vw, env(safe-area-inset-left)); padding-right: max(5vw, env(safe-area-inset-right)); }
}
/* 手机端长文阅读：字号微调防止 iOS 横向溢出 */
@media (max-width: 640px) {
  .prose pre { max-width: calc(100vw - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right))); }
  .mac-code-body td.code pre { font-size: 11.5px; }
}

/* 手机端浮动目录按钮：长文中快速跳章节 */
.toc-fab { position: fixed; z-index: 41; right: max(20px, env(safe-area-inset-right)); bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rose-soft); border-radius: 50%; background: rgba(243,241,238,.94); color: var(--rose); font-size: 17px; cursor: pointer; box-shadow: 0 4px 18px rgba(48,37,40,.14); backdrop-filter: blur(8px); opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .3s ease, transform .3s cubic-bezier(.16,1,.3,1); }
.toc-fab.is-show { opacity: 1; transform: none; pointer-events: auto; }
.toc-fab:hover { background: var(--rose); color: #fff; }
@media (min-width: 901px) { .toc-fab { display: none !important; } }
/* 目录弹层（手机端）：从底部滑出的章节抽屉 */
.toc-sheet { position: fixed; z-index: 42; left: 0; right: 0; bottom: 0; max-height: 62svh; overflow-y: auto; padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--rose-soft); border-radius: 16px 16px 0 0; box-shadow: 0 -14px 44px rgba(48,37,40,.18); transform: translateY(100%); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.toc-sheet.is-open { transform: none; }
.toc-sheet > p { margin: 0 0 12px; color: var(--muted); font: 10px var(--mono); letter-spacing: .14em; }
.toc-sheet .toc-child { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 8px; }
.toc-sheet li + li { margin-top: 4px; }
.toc-sheet a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.toc-sheet a:active { background: rgba(204,181,177,.25); }
.toc-sheet a.active { background: var(--blue); color: #fff; }
@media (min-width: 901px) { .toc-sheet { display: none; } }

/* ===== 第三批动效：排版细节与过渡质感 ===== */
/* 封面底部幕布：滚动离开首屏时，底部柔光渐隐上收 */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18svh; background: linear-gradient(180deg, transparent, rgba(243,241,238,.5)); opacity: 1; transition: opacity .45s ease; pointer-events: none; }
.hero.is-left { }
.hero.is-left::after { opacity: 0; }
/* 导航链接：下划线从中间向两侧描画 */
.nav-links a { position: relative; padding: 4px 2px; }
.nav-links a::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 1.5px; background: var(--rose); border-radius: 2px; transform: scaleX(0); transition: transform .3s cubic-bezier(.22,.61,.36,1); }
.nav-links a:hover::after, .nav-links a:focus-visible::after { transform: scaleX(1); }
/* 列表条目：悬停时序号同步点亮放大 */
.entry-no { transition: color .25s ease, transform .3s cubic-bezier(.16,1,.3,1); }
.entry-link:hover .entry-no { color: var(--rose); transform: translateX(-3px); }
/* 列表条目：悬停底色扫过（左侧玫瑰渐入） */
.entry-link { position: relative; overflow: hidden; }
.entry-link::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(204,181,177,.16), transparent 55%); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.22,.61,.36,1); pointer-events: none; }
.entry-link:hover::before { transform: scaleX(1); }
/* 正文链接：下划线彩色滑入 */
.prose a { background-image: linear-gradient(var(--rose-soft), var(--rose-soft)); background-size: 100% 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s ease, color .2s ease; }
.prose a:hover { background-size: 0 1.5px; color: var(--rose); }
/* 页脚：文字悬停点亮 */
.site-footer .brand, .foot-meta a { transition: color .25s ease, opacity .25s ease; }
.site-footer .brand:hover { color: #fff; }
/* 友链域名：悬停展开下划线 */
.friend-body code { position: relative; }
.friend-body code::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.friend-card:hover .friend-body code::after { transform: scaleX(1); }
/* 大标题区：字符级渐入（配合 JS 拆字） */
.char-rise { display: inline-block; opacity: 0; transform: translateY(.6em) rotate(2deg); animation: char-rise .7s cubic-bezier(.16,1,.3,1) both; }
@keyframes char-rise { to { opacity: 1; transform: none; } }
/* 上一页/下一页：箭头感悬停位移 */
.pager-item { position: relative; overflow: hidden; }
.pager-item strong { transition: transform .35s cubic-bezier(.16,1,.3,1); }
.pager-item:hover strong { transform: translateX(6px); }
.pager-next:hover strong { transform: translateX(-6px); }
/* 阅读进度条入场 */
.progress span { transition: transform .12s linear; }
@media (prefers-reduced-motion: reduce) { .char-rise { animation: none; opacity: 1; transform: none; } .entry-link::before, .nav-links a::after, .friend-body code::after { display: none; } }

/* ===== 第四批动效：细节质感 ===== */
/* 页面切换：点击站内链接离场时柔光渐隐（view transition 风格降级） */
body.is-leaving { opacity: 0; transition: opacity .18s ease; }
/* 标题光标：眉题后随闪烁光标，终端感 */
.eyebrow::after { content: "▍"; margin-left: 4px; color: var(--rose); animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
/* 目录滚动条：悬停目录时浮现 */
.toc { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .3s; }
.toc:hover { scrollbar-color: rgba(134,102,109,.5) transparent; }
/* 复制按钮成功反馈：涟漪 */
.mac-copy { position: relative; overflow: hidden; }
.mac-copy.ok::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(127,220,164,.35); animation: copy-ripple .55s ease-out both; pointer-events: none; }
@keyframes copy-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
/* 图片揭幕：进入视口时从柔焦+亮度中清晰化 */
.prose img { filter: blur(0); }
.prose img.img-settle { animation: img-settle .8s cubic-bezier(.22,.61,.36,1) both; }
@keyframes img-settle { from { filter: blur(10px) brightness(1.06); transform: scale(1.02); } to { filter: none; transform: none; } }
/* 友链卡序号徽标：进入时弹跳 */
.friend-fallback { animation: fb-pop .55s cubic-bezier(.34,1.56,.64,1) both; animation-delay: .2s; }
@keyframes fb-pop { from { transform: scale(0); } to { transform: scale(1); } }
/* 顶部进度条：到底时变色提示 */
.progress span.is-done { background: var(--rose); }
/* 终端式开场：首次访问的快速三行日志（JS 注入 .boot-log） */
.boot-log { position: fixed; z-index: 60; left: max(20px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); font: 11px/1.7 var(--mono); color: var(--rose); letter-spacing: .05em; pointer-events: none; }
.boot-log span { display: block; opacity: 0; animation: boot-in .3s ease both; }
@keyframes boot-in { from { opacity: 0; transform: translateY(4px); } to { opacity: .85; transform: none; } }
.boot-log.is-out { animation: boot-out .4s ease .9s both; }
@keyframes boot-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .eyebrow::after, .boot-log, .friend-fallback { animation: none; } .friend-fallback { animation: none; } .prose img.img-settle { animation: none; } }
