:root {
  color-scheme: light dark;
  --bg: #fff;
  --text: #171717;
  --muted: #626262;
  --line: #dedede;
  --soft: #f7f7f7;
  --syntax: #864100;
  --string: #276333;
  --keyword: #6942a0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.8 Arial, "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
.wrapper { width: calc(100% - 48px); max-width: 680px; margin-inline: auto; padding: 0; }
a, a:visited { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--muted); }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 20px; top: -100px; }
.skip-link:focus { top: 8px; background: var(--bg); z-index: 2; }
.site-header { border-top: 0; border-bottom: 1px solid var(--line); min-height: 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 20px; }
.site-title, .site-title:visited { float: none; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-decoration: none; margin: 0; }
.author-nav { display: flex; gap: 24px; font-size: 15px; flex-wrap: wrap; }
.author-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); }
.author-nav a[aria-current] { color: var(--text); text-decoration: underline; }
.page-content { padding: 56px 0 96px; }
h1, .post-title { font-size: 28px; line-height: 1.35; letter-spacing: -.6px; font-weight: 600; overflow-wrap: anywhere; }
h2 { font-size: 23px; line-height: 1.4; font-weight: 600; }
h3 { font-size: 19px; line-height: 1.5; font-weight: 600; }
.post-header { margin-bottom: 36px; }
.post-meta { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.post-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; margin-left: 4px; vertical-align: middle; }
.post-tag { color: inherit; line-height: 1.6; text-underline-offset: 3px; overflow-wrap: anywhere; }
.post-tag:hover, .post-tag:focus-visible { text-decoration: underline; }
.post-content { margin-bottom: 0; overflow-wrap: anywhere; }
.post-content h2 { font-size: 23px; margin: 40px 0 20px; }
.post-content h3 { font-size: 19px; margin: 32px 0 16px; }
.post-content h4 { font-size: 17px; margin-top: 28px; }
.post-content :is(h2,h3,h4), .footnotes li { scroll-margin-top: 24px; }
p { margin: 0 0 1.25em; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-left: 0; }
.post-content li > ul, .post-content li > ol { margin-bottom: 0; }
blockquote { border-left: 3px solid var(--line); padding-left: 24px; margin: 28px 0; color: var(--muted); font-size: inherit; font-style: normal; letter-spacing: normal; }
hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
code, pre { font-family: Consolas, "Liberation Mono", monospace; font-size: 14px; background: var(--soft); border: 0; }
code { padding: .15em .3em; border-radius: 3px; }
pre { padding: 16px; overflow-x: auto; line-height: 1.65; white-space: pre; overflow-wrap: normal; }
pre code { padding: 0; border-radius: 0; }
.highlight, .highlighter-rouge .highlight { background: var(--soft); }
.highlight * { color: inherit; background: transparent; }
.highlight :is(.c,.c1,.cm,.cp,.cs,.gh,.go,.gp) { color: var(--muted); }
.highlight :is(.k,.kc,.kd,.kn,.kp,.kr,.kt,.ow,.nt) { color: var(--keyword); }
.highlight :is(.s,.s1,.s2,.sb,.sc,.sd,.se,.sh,.si,.sr,.ss,.sx,.na) { color: var(--string); }
.highlight :is(.m,.mf,.mh,.mi,.mo,.il,.nf,.nb,.nc,.no) { color: var(--syntax); }
.table-scroll { width: 100%; overflow-x: auto; margin-bottom: 24px; }
.table-scroll table { margin: 0; min-width: 100%; width: max-content; max-width: none; }
table { color: var(--text); border: 1px solid var(--line); text-align: left; font-size: 15px; }
table th, table td { border: 1px solid var(--line); padding: 10px 14px; max-width: 32em; }
table th, table tr:nth-child(even) { background: var(--soft); }
table th { border-bottom-color: var(--line); }
.post-content img { max-width: 100%; height: auto; }
.archive-screenshot { width: fit-content; max-width: 100%; margin: 24px auto 32px; }
.archive-screenshot svg { display: block; max-width: 100%; height: auto; overflow: hidden; }
.screenshot-open { display: block; padding: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--soft); cursor: zoom-in; }
.archive-screenshot figcaption { margin-top: 8px; text-align: center; font-size: 12px; }
.screenshot-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 24px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.screenshot-dialog::backdrop { background: rgb(0 0 0 / .65); }
.screenshot-dialog > button { float: right; font: inherit; padding: 6px 12px; background: var(--soft); color: var(--text); border: 1px solid var(--line); cursor: pointer; }
.screenshot-dialog > p { padding-right: 80px; }
.screenshot-detail { overflow: auto; clear: both; }
.screenshot-detail svg { display: block; width: 100%; height: auto; overflow: hidden; }
figure { margin: 24px 0; }
figcaption, .footnotes { font-size: 14px; color: var(--muted); }
.footnotes { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 40px; }
.article-toc { border-block: 1px solid var(--line); margin-bottom: 32px; padding: 8px 0; font-size: 15px; }
.article-toc summary { cursor: pointer; padding: 8px 0; }
.article-toc ul { list-style: none; margin: 12px 0 16px; padding: 0; }
.article-toc li { margin: 6px 0; }
.article-toc .toc-subheading { padding-left: 20px; }
.article-toc a { text-decoration: none; color: var(--muted); }
.article-toc a[aria-current] { color: var(--text); text-decoration: underline; }
@media (min-width: 1280px) {
  .article-body { display: grid; grid-template-columns: minmax(0, 680px) 220px; gap: 48px; margin-right: -268px; align-items: start; }
  .article-body > .post-content { grid-column: 1; grid-row: 1; min-width: 0; }
  .article-toc { grid-column: 2; grid-row: 1; position: sticky; top: 32px; max-height: calc(100vh - 64px); overflow-y: auto; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 20px; font-size: 13px; }
  .article-toc summary { font-weight: 600; }
}
.heading-anchor { font-size: .7em; font-weight: 400; margin-left: .5em; color: var(--muted); opacity: 0; text-decoration: none; }
:is(h2,h3):hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
.mermaid-diagram { overflow-x: auto; margin: 28px 0; }
.mermaid-diagram svg { display: block; margin: auto; height: auto; }
.article-footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; }
.adjacent { display: flex; gap: 24px; margin-top: 24px; }
.adjacent a { flex: 1; min-width: 0; overflow-wrap: anywhere; text-decoration: none; }
.adjacent a:hover span { text-decoration: underline; }
.adjacent small { display: block; color: var(--muted); font-size: 13px; }
.site-footer { border-top: 1px solid var(--line); padding: 0; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 32px 48px; }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner a { text-decoration: none; }
.writing-intro { margin-bottom: 48px; }
.writing-intro h1 { margin: 0 0 12px; }
.writing-lead, .writing-description { color: var(--muted); }
.writing-lead { margin-bottom: 0; }
.writing-description { font-size: 14px; margin-top: 12px; }
.writing-description p:last-child { margin-bottom: 0; }
.writing-year + .writing-year { margin-top: 48px; }
.writing-year-title { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.35; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.writing-list { list-style: none; margin: 0; padding: 0; }
.writing-list li { border-bottom: 1px solid var(--line); }
.writing-list .writing-link { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 16px 0; text-decoration: none; font-size: 17px; }
.writing-link time { color: var(--muted); font: 13px/2.35 Consolas, monospace; }
.writing-link h3 { font-size: 17px; font-weight: 500; line-height: 1.8; margin: 0; overflow-wrap: anywhere; }
.writing-link p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 6px 0 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.writing-link:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.writing-list div.writing-link:hover h3 { text-decoration: none; }
.placeholder-label { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.writing-preview .writing-intro { margin-bottom: 32px; }
.writing-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.writing-filters button { font: inherit; font-size: 13px; border: 1px solid var(--line); padding: 6px 12px; min-height: 44px; border-radius: 4px; background: var(--bg); color: var(--muted); cursor: pointer; }
.writing-filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.writing-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.featured-writing { margin-top: 64px; }
.featured-writing h2 { margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 16px; font-weight: 400; line-height: 1.5; }
.featured-writing .featured-writing-list { list-style: none; margin: 20px 0 24px; padding: 0; }
.featured-writing-list li { border-bottom: 1px solid var(--line); }
.featured-writing .featured-writing-link { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 20px 0; text-decoration: none; }
.featured-writing-link time { color: var(--muted); font: 15px/1.8 Consolas, monospace; white-space: nowrap; }
.featured-writing-link > span { font-size: 22px; font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; }
.featured-writing-link:hover > span { text-decoration: underline; text-underline-offset: 4px; }
.featured-writing .featured-writing-all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); text-decoration: none; }
.featured-writing-all:hover { text-decoration: underline; }
.project-cards { display: grid; gap: 20px; margin-top: 28px; }
.project-card { min-width: 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; }
.project-card-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-repo-icon { flex: 0 0 auto; color: var(--muted); }
.project-card h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.project-card h2 a, .project-card h2 a:visited { color: #0969da; text-decoration: none; }
.project-card h2 a:hover { text-decoration: underline; }
.project-visibility { padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.8; }
.project-card .project-description { margin: 12px 0; color: var(--muted); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.project-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 14px; line-height: 1.5; }
.project-language, .project-card .project-stars { display: inline-flex; align-items: center; gap: 6px; }
.project-language-dot { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--project-language-color); }
.project-card .project-stars { min-height: 24px; color: var(--muted); text-decoration: none; }
.project-stars:hover { color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --text: #e5e5e5; --muted: #aaa; --line: #383838; --soft: #1c1c1c; --syntax: #e7b67e; --string: #9dcea5; --keyword: #cbb0ed; }
  .project-card h2 a, .project-card h2 a:visited { color: #58a6ff; }
}
@media (max-width: 600px) {
  .wrapper { width: calc(100% - 40px); }
  .header-inner { min-height: 60px; gap: 12px; flex-wrap: wrap; }
  .author-nav { gap: 16px; font-size: 14px; }
  .header-inner { padding-block: 10px 4px; }
  .author-nav { width: 100%; gap: 0 18px; }
  .page-content { padding: 40px 0 64px; }
  h1, .post-title { font-size: 26px; }
  .adjacent, .footer-inner { flex-direction: column; }
  .footer-inner { gap: 12px; padding-block: 24px; }
  .heading-anchor { opacity: 1; }
  .writing-list .writing-link { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 13px 0; }
  .writing-link time { font-size: 12px; }
  .featured-writing { margin-top: 48px; }
  .featured-writing .featured-writing-link { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 18px 0; }
  .featured-writing-link time { font-size: 13px; }
  .featured-writing-link > span { font-size: 19px; }
  .project-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
