/* Yong 的博客 · 样式
   taste-skill 2.5.1 发牌：palette rose-grey-green（暖石灰底、绿色强调），type onest，radius soft。
   中文回落到系统黑体；Onest 自托管，只含拉丁字符。 */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(/static/fonts/onest-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(/static/fonts/onest-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(/static/fonts/onest-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --p-bg: #ebe5e3; --p-surface: #e1dad7; --p-ink: #2b2622; --p-muted: #655c58;
  --p-accent: #0f7d45; --p-accent-ink: #ffffff;
  --p-inv-bg: #2b2622; --p-inv-surface: #36312d; --p-inv-ink: #ebe5e3; --p-inv-muted: #a29c99;
  --p-line: color-mix(in oklab, var(--p-ink) 14%, transparent);
  --font: "Onest", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --read: 680px;
  --gutter: clamp(20px, 5vw, 56px);
  --r-sm: 8px; --r-md: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--p-bg); color: var(--p-ink);
  font: 400 17px/1.75 var(--font); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: color-mix(in oklab, var(--p-accent) 22%, transparent); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 50; background: var(--p-ink); color: var(--p-bg); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 3px; border-radius: 4px; }

/* ── 顶栏 ── */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--p-bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.is-stuck { border-bottom-color: var(--p-line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -.01em; min-height: 44px; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--p-ink); color: var(--p-bg); display: grid; place-items: center; font-size: 15px; font-weight: 600; transition: background .2s var(--ease), transform .2s var(--ease); }
.brand:hover .brand-mark { background: var(--p-accent); transform: rotate(-8deg); }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--p-muted); transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--p-ink); background: var(--p-surface); }
.nav-links a[aria-current="page"] { color: var(--p-ink); }

/* ── 首屏 ── */
.hero { padding: clamp(72px, 14vh, 150px) 0 clamp(56px, 9vh, 96px); }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--p-accent); letter-spacing: .02em; margin: 0 0 22px; display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--p-accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--p-accent) 18%, transparent); }
.hero h1 { font-size: clamp(44px, 7.4vw, 96px); line-height: 1.04; font-weight: 500; letter-spacing: -.04em; margin: 0; max-width: 13em; }
.hero h1 .soft { color: var(--p-muted); }
.hero-lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--p-muted); max-width: 34em; margin: 28px 0 0; line-height: 1.7; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 40px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--p-muted); }
.hero-meta b { color: var(--p-ink); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 6px; }

/* 首屏入场：只播一次 */
[data-enter] > * { animation: enter .8s var(--ease) both; }
[data-enter] > *:nth-child(2) { animation-delay: .08s; }
[data-enter] > *:nth-child(3) { animation-delay: .16s; }
[data-enter] > *:nth-child(4) { animation-delay: .24s; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── 区块 ── */
.section { padding: clamp(40px, 7vh, 80px) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--p-ink); padding-top: 18px; margin-bottom: 8px; }
.section-head h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.section-head a { font-size: 15px; color: var(--p-muted); }

/* ── 文章列表 ── */
.posts { list-style: none; margin: 0; padding: 0; }
.post-row { border-bottom: 1px solid var(--p-line); }
.post-row a { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px 32px; align-items: baseline; padding: 26px 0; text-decoration: none; transition: transform .25s var(--ease); }
.post-row a:hover { transform: translateY(-2px); }
.post-row time { font-size: 14px; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.post-row h3 { font-size: clamp(20px, 2vw, 25px); font-weight: 500; line-height: 1.35; letter-spacing: -.015em; margin: 0; }
.post-row h3 span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease); padding-bottom: 2px; }
.post-row a:hover h3 span { background-size: 100% 1.5px; }
.post-row p { grid-column: 2; margin: 2px 0 0; color: var(--p-muted); font-size: 16px; line-height: 1.65; max-width: 40em; }
.post-row .arrow { grid-row: 1; grid-column: 3; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--p-surface); transition: background .2s, color .2s, transform .25s var(--ease); }
.post-row a:hover .arrow { background: var(--p-accent); color: var(--p-accent-ink); transform: translateX(3px); }
.tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 13px; font-weight: 500; color: var(--p-muted); background: var(--p-surface); padding: 3px 10px; border-radius: 999px; text-decoration: none; }
a.tag { transition: background .15s, color .15s; }
a.tag:hover { background: var(--p-ink); color: var(--p-bg); }

.year { font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.03em; margin: 48px 0 4px; font-variant-numeric: tabular-nums; }
.year:first-child { margin-top: 0; }

/* ── 页面标题 ── */
.page-head { padding: clamp(56px, 10vh, 110px) 0 clamp(24px, 4vh, 40px); }
.page-head h1 { font-size: clamp(36px, 5.2vw, 64px); line-height: 1.1; font-weight: 500; letter-spacing: -.035em; margin: 0; }
.page-head p { color: var(--p-muted); margin: 16px 0 0; font-size: 18px; max-width: 34em; }

/* ── 文章页 ── */
.article-head { padding: clamp(56px, 10vh, 110px) 0 clamp(28px, 5vh, 48px); }
.article-head .back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--p-muted); text-decoration: none; margin-bottom: 20px; transition: color .15s, gap .2s var(--ease); }
.article-head .back:hover { color: var(--p-ink); gap: 12px; }
.article-head h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.12; font-weight: 500; letter-spacing: -.035em; margin: 0; max-width: 16em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 24px; color: var(--p-muted); font-size: 15px; }
.article-meta .tags { margin: 0; }
.cover { margin: 0 0 clamp(32px, 5vh, 56px); border-radius: var(--r-md); overflow: hidden; background: var(--p-surface); }
.cover img { width: 100%; transition: transform .5s var(--ease); }
.cover:hover img { transform: scale(1.02); }

.prose { max-width: var(--read); }
.prose > * + * { margin-top: 1.15em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 27px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; margin: 2.2em 0 0; }
.prose h3 { font-size: 21px; line-height: 1.4; font-weight: 600; margin: 1.8em 0 0; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--p-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-thickness .15s; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--p-muted); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--p-accent); color: var(--p-muted); }
.prose hr { border: 0; border-top: 1px solid var(--p-line); margin: 2.4em 0; }
.prose img { border-radius: var(--r-md); margin: 1.6em 0; }
.prose figure { margin: 1.6em 0; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--p-surface); padding: .12em .4em; border-radius: 5px; }
.prose pre { font-family: var(--mono); font-size: 14px; line-height: 1.65; background: var(--p-inv-bg); color: var(--p-inv-ink); padding: 18px 20px; border-radius: var(--r-md); overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.prose th { font-weight: 600; border-bottom-color: var(--p-ink); }

/* 代码高亮（pygments，暖色深底） */
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .ch { color: #8d8580; font-style: italic; }
.codehilite .k, .codehilite .kn, .codehilite .kd, .codehilite .kc, .codehilite .ow { color: #f0a77a; }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .se, .codehilite .sh { color: #9fd3a8; }
.codehilite .nf, .codehilite .fm, .codehilite .nc { color: #f2d48a; }
.codehilite .mi, .codehilite .mf, .codehilite .m { color: #e8b4a0; }
.codehilite .nb, .codehilite .bp, .codehilite .nv { color: #a9c7e8; }
.codehilite .o, .codehilite .p { color: #d6cfcb; }

.article-foot { max-width: var(--read); margin-top: clamp(48px, 8vh, 80px); border-top: 1px solid var(--p-ink); padding-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.article-foot a { display: block; padding: 18px 0; text-decoration: none; transition: transform .25s var(--ease); min-height: 44px; }
.article-foot a:hover { transform: translateY(-2px); }
.article-foot small { display: block; font-size: 13px; color: var(--p-muted); margin-bottom: 4px; }
.article-foot span { font-weight: 500; }
.article-foot .next { text-align: right; grid-column: 2; }

/* ── 标签云 ── */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--p-surface); text-decoration: none; font-weight: 500; transition: background .15s, color .15s, transform .2s var(--ease); }
.tag-cloud a:hover { background: var(--p-ink); color: var(--p-bg); transform: translateY(-2px); }
.tag-cloud a:active { transform: translateY(0) scale(.98); }
.tag-cloud em { font-style: normal; font-size: 13px; color: var(--p-muted); }
.tag-cloud a:hover em { color: var(--p-inv-muted); }

/* ── 页脚 ── */
.foot { background: var(--p-inv-bg); color: var(--p-inv-ink); margin-top: clamp(64px, 12vh, 120px); }
.foot .wrap { padding-top: 56px; padding-bottom: 40px; }
.foot-big { font-size: clamp(32px, 5vw, 64px); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; margin: 0 0 40px; }
.foot-big a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.foot-big a:hover { background-size: 100% 2px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; color: var(--p-inv-muted); font-size: 14px; border-top: 1px solid var(--p-inv-surface); padding-top: 20px; }
.foot-row nav { display: flex; gap: 20px; }
.foot-row a { color: var(--p-inv-muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; transition: color .15s; }
.foot-row a:hover { color: var(--p-inv-ink); }

.empty { color: var(--p-muted); padding: 32px 0; }

/* ── 窄屏 ── */
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .nav .wrap { height: 60px; }
  .nav-links a { padding: 0 10px; }
  .post-row a { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 22px 0; }
  .post-row time { grid-column: 1 / -1; }
  .post-row h3 { grid-column: 1; }
  .post-row .arrow { grid-row: 2; grid-column: 2; }
  .post-row p, .tags { grid-column: 1 / -1; }
  .article-foot { grid-template-columns: 1fr; }
  .article-foot .next { grid-column: 1; text-align: left; }
}
@media (max-width: 520px) {
  .brand-name { display: none; }
  .nav-links a { padding: 0 11px; }
  .hero h1 .soft { display: block; }
}

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