:root {
  --paper: #f7f7f4;
  --surface: #fcfcfa;
  --ink: #161815;
  --muted: #6d716a;
  --faint: #989d94;
  --line: #dedfd9;
  --line-soft: #e9eae5;
  --accent: #53685a;
  --accent-soft: #e7ece7;
  --sidebar: 340px;
  --reading: 720px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Noto Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; padding: .75rem 1rem; background: var(--ink); color: var(--surface); border-radius: .25rem; }
.skip-link:focus { top: 1rem; }

.reading-progress { position: fixed; z-index: 60; left: var(--sidebar); right: 0; top: 0; height: 2px; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .1s linear; }
.site-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); display: flex; flex-direction: column; padding: 34px 28px 24px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 20px; letter-spacing: -.025em; }
.brand span { color: var(--muted); font-family: var(--serif); font-size: 13px; letter-spacing: .04em; }
.sidebar-actions { display: flex; align-items: center; gap: 8px; }
.language-link { display: inline-flex; min-height: 32px; align-items: center; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.language-link:hover, .language-link:focus-visible { border-color: var(--line); color: var(--ink); }
[data-menu-close] { display: none; border: 0; background: none; color: var(--ink); }
.site-nav { min-height: 0; overflow: hidden auto; padding-right: 7px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.about-link { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 20px; padding: 0 10px 0 13px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; font-size: 14px; }
.about-link:hover { background: var(--paper); }
.about-link.is-active { border-left-color: var(--accent); background: var(--accent-soft); font-weight: 620; }
.nav-arrow { opacity: 0; transform: translateX(-5px); transition: .2s ease; }
.about-link:hover .nav-arrow, .about-link.is-active .nav-arrow { opacity: 1; transform: none; }
.search-box { position: relative; display: flex; align-items: center; height: 40px; margin-bottom: 27px; color: var(--faint); }
.search-box > svg { position: absolute; left: 11px; width: 16px; pointer-events: none; }
.search-box input { width: 100%; height: 100%; padding: 0 50px 0 36px; border: 1px solid var(--line-soft); border-radius: 5px; outline: none; background: var(--paper); color: var(--ink); font-size: 13px; transition: border-color .2s, background .2s; }
.search-box input:focus { border-color: var(--accent); background: var(--surface); }
.search-box kbd { position: absolute; right: 9px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; font: 10px var(--sans); color: var(--faint); }
.nav-eyebrow, .content-kicker { margin: 0 0 14px; color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.nav-group { padding: 0 0 9px; }
.category-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 9px 5px 9px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-align: left; }
.category-toggle:hover { color: var(--ink); }
.category-toggle svg { width: 14px; transition: transform .2s; }
.category-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-group ul { margin: 0; padding: 0; list-style: none; }
.nav-group li { margin: 1px 0; }
.nav-group li a { position: relative; display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 7px 7px 18px; border-radius: 4px; color: #555951; font-size: 13px; line-height: 1.45; }
.nav-group li a::before { content: ""; position: absolute; left: 4px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--line); transform: translateY(-50%); }
.nav-group li a:hover { background: var(--paper); color: var(--ink); }
.nav-group li a.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 620; }
.nav-group li a.is-active::before { height: 16px; border-radius: 2px; background: var(--accent); }
.article-marks { display: flex; gap: 4px; }
.article-marks small, .article-marks i { padding: 1px 4px; border: 1px solid var(--line); border-radius: 2px; color: var(--faint); font-size: 8px; font-style: normal; font-weight: 600; white-space: nowrap; }
.article-marks small { border-color: #bec9c0; color: var(--accent); }
.search-empty { padding: 16px 12px; color: var(--muted); font-size: 12px; }
.sidebar > footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 17px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 10px; }

main { min-height: 100vh; margin-left: var(--sidebar); background: var(--paper); }
.content-wrap { width: min(calc(100% - 80px), var(--reading)); margin: 0 auto; padding: 94px 0 112px; }
.content-wrap.is-loading { opacity: .38; transition: opacity .18s; }
.profile-hero { padding-bottom: 52px; border-bottom: 1px solid var(--line); }
.profile-hero h1 { margin: 0; font-size: clamp(48px, 6vw, 78px); font-weight: 620; letter-spacing: -.065em; line-height: .98; }
.profile-english { margin: 12px 0 0; color: var(--muted); font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
.slogan { max-width: 580px; margin: 55px 0 0; font-family: var(--serif); font-size: clamp(24px, 3vw, 35px); line-height: 1.55; letter-spacing: -.02em; }
.profile-intro { display: grid; grid-template-columns: 1fr 1.8fr; gap: 46px; padding: 54px 0; border-bottom: 1px solid var(--line); }
.profile-intro p { margin: 0; color: #40433e; font-family: var(--serif); font-size: 17px; line-height: 1.9; }
.profile-intro .lead { color: var(--ink); font-family: var(--sans); font-size: 20px; font-weight: 560; line-height: 1.65; }
.profile-section { padding: 50px 0; border-bottom: 1px solid var(--line); }
.profile-section h2 { margin: 0 0 28px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.focus-list { margin: 0; padding: 0; list-style: none; }
.focus-list li { display: grid; grid-template-columns: 42px 1fr; align-items: baseline; padding: 15px 0; border-top: 1px solid var(--line-soft); font-family: var(--serif); font-size: 21px; }
.focus-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.focus-list span { color: var(--faint); font: 10px var(--sans); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.contact-grid a, .contact-grid button { position: relative; display: flex; min-height: 120px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 20px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-align: left; transition: background .2s; }
.contact-grid a:hover, .contact-grid button:hover { background: var(--surface); }
.contact-grid span { color: var(--faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.contact-grid strong { max-width: calc(100% - 30px); font-size: 14px; font-weight: 560; overflow-wrap: anywhere; }
.contact-grid svg { position: absolute; right: 18px; bottom: 18px; width: 17px; transition: transform .2s; }
.contact-grid a:hover svg, .contact-grid button:hover svg { transform: translate(3px, -3px); }
.site-note p { max-width: 560px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: 16px; line-height: 1.8; }

.article-header { padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; margin-bottom: 34px; }
.back-link:hover { color: var(--accent); }
.article-header h1, .empty-view h1 { margin: 0; font-family: var(--serif); font-size: clamp(36px, 5vw, 54px); font-weight: 560; letter-spacing: -.035em; line-height: 1.23; text-wrap: balance; }
.article-summary { margin: 26px 0 0; color: var(--muted); font-family: var(--serif); font-size: 19px; line-height: 1.75; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 30px; color: var(--faint); font-size: 11px; letter-spacing: .02em; }
.toc { margin: 34px 0 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.32); }
.toc summary { padding: 15px 0; cursor: pointer; font-size: 12px; font-weight: 620; letter-spacing: .04em; }
.toc summary span { margin-left: 5px; color: var(--faint); }
.toc ol { margin: 0; padding: 0 0 18px 22px; color: var(--muted); font: 14px/1.8 var(--serif); }
.toc a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body { padding-top: 48px; color: #282b27; font-family: var(--serif); font-size: 17px; line-height: 1.9; overflow-wrap: break-word; }
.toc + .markdown-body { padding-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { position: relative; color: var(--ink); font-family: var(--sans); font-weight: 620; letter-spacing: -.02em; line-height: 1.35; scroll-margin-top: 24px; }
.markdown-body h1 { margin: 2.4em 0 .8em; font-size: 32px; }
.markdown-body h2 { margin: 2.7em 0 .85em; font-size: 27px; }
.markdown-body h3 { margin: 2.2em 0 .7em; font-size: 21px; }
.markdown-body h4 { margin: 2em 0 .6em; font-size: 17px; }
.markdown-body h1:first-child, .markdown-body h2:first-child { margin-top: 0; }
.heading-anchor { position: absolute; left: -1.25em; opacity: 0; color: var(--faint); font-weight: 400; }
.markdown-body h2:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.markdown-body p { margin: 0 0 1.45em; }
.markdown-body strong { color: var(--ink); font-weight: 700; }
.markdown-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1.55em; padding-left: 1.35em; }
.markdown-body li { margin: .38em 0; padding-left: .35em; }
.markdown-body blockquote { margin: 2.2em 0; padding: 2px 0 2px 24px; border-left: 2px solid var(--accent); color: #4d554e; font-size: 19px; font-style: italic; }
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body hr { height: 1px; margin: 3.4em 0; border: 0; background: var(--line); }
.markdown-body code { padding: .15em .35em; border: 1px solid var(--line-soft); border-radius: 3px; background: var(--surface); font: .83em ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body pre { margin: 2em 0; padding: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: #20231f; color: #eef0eb; line-height: 1.65; }
.markdown-body pre code { padding: 0; border: 0; background: transparent; color: inherit; }
.table-wrap { margin: 2em 0; overflow-x: auto; border: 1px solid var(--line); }
.markdown-body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; line-height: 1.6; }
.markdown-body th, .markdown-body td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--surface); font-weight: 650; }
.markdown-body tr:last-child td { border-bottom: 0; }
.markdown-body figure { margin: 2.5em 0; }
.article-image-button { width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: auto; }
.markdown-body figcaption { margin-top: 10px; color: var(--faint); font: 12px/1.6 var(--sans); text-align: center; }
.article-footer { margin-top: 68px; padding-top: 30px; border-top: 1px solid var(--line); }
.article-footer > p { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.article-footer > p span { color: var(--faint); font-size: 10px; text-transform: uppercase; }
.article-footer > p a { color: var(--accent); overflow-wrap: anywhere; }
.share-button { display: inline-flex; align-items: center; gap: 9px; margin: 26px 0 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.share-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.share-button svg { width: 16px; }
.article-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.article-pagination a { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.article-pagination a:last-child { text-align: right; }
.article-pagination small { color: var(--faint); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.article-pagination strong { font-family: var(--serif); font-size: 15px; font-weight: 560; line-height: 1.5; }
.article-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.empty-view { padding-top: 18vh; }
.empty-view > p:not(.content-kicker) { max-width: 540px; margin: 28px 0; color: var(--muted); font-family: var(--serif); font-size: 18px; line-height: 1.8; }
.empty-view > a { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 13px; }

.mobile-header { display: none; }
.drawer-backdrop { display: none; }
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(17,19,16,.72); backdrop-filter: blur(3px); }
.image-dialog, .qr-dialog { max-width: min(92vw, 920px); max-height: 90vh; padding: 40px; border: 0; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.image-dialog > button, .qr-dialog > button { position: absolute; right: 8px; top: 8px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; background: transparent; cursor: pointer; }
.image-dialog img { display: block; max-width: 100%; max-height: calc(90vh - 80px); }
.qr-dialog { width: min(90vw, 400px); text-align: center; }
.qr-dialog > p { margin: 0 0 20px; font-weight: 620; }
.qr-frame { display: grid; min-height: 280px; place-items: center; border: 1px solid var(--line); background: white; color: var(--muted); font-size: 13px; }
.qr-frame img { display: block; max-width: 280px; max-height: 280px; }
.toast { position: fixed; z-index: 100; left: calc(var(--sidebar) + (100vw - var(--sidebar)) / 2); bottom: 28px; padding: 10px 16px; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1000px) and (min-width: 741px) {
  :root { --sidebar: 290px; }
  .sidebar { padding-inline: 20px; }
  .content-wrap { width: min(calc(100% - 64px), 680px); }
  .profile-intro { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 740px) {
  .reading-progress { left: 0; top: 59px; }
  .mobile-header { position: sticky; z-index: 35; top: 0; display: flex; height: 60px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(252,252,250,.94); backdrop-filter: blur(12px); }
  .mobile-header > a { display: flex; flex-direction: column; }
  .mobile-header strong { font-size: 15px; }
  .mobile-header small { color: var(--muted); font-family: var(--serif); font-size: 9px; }
  .mobile-header > div { display: flex; align-items: center; gap: 5px; }
  .mobile-header button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; background: transparent; }
  .sidebar { width: min(88vw, 360px); padding: 24px 22px; box-shadow: 14px 0 50px rgba(0,0,0,.12); transform: translateX(-105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { transform: none; }
  [data-menu-close] { display: grid; width: 36px; height: 36px; place-items: center; }
  .drawer-backdrop { position: fixed; z-index: 30; inset: 0; display: block; background: rgba(16,18,15,.36); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  main { margin-left: 0; }
  .content-wrap { width: auto; padding: 54px 22px 86px; }
  .profile-hero { padding-bottom: 40px; }
  .profile-hero h1 { font-size: 48px; }
  .slogan { margin-top: 42px; font-size: 25px; }
  .profile-intro { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .profile-intro p { font-size: 16px; }
  .profile-intro .lead { font-size: 18px; }
  .profile-section { padding: 40px 0; }
  .focus-list li { font-size: 18px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid a, .contact-grid button { min-height: 102px; }
  .article-header h1, .empty-view h1 { font-size: 32px; }
  .article-summary { font-size: 17px; }
  .article-meta { gap: 8px 16px; }
  .markdown-body { font-size: 16.5px; line-height: 1.85; }
  .markdown-body h2 { font-size: 23px; }
  .markdown-body h3 { font-size: 19px; }
  .heading-anchor { display: none; }
  .markdown-body blockquote { padding-left: 18px; font-size: 17px; }
  .article-pagination { grid-template-columns: 1fr; gap: 24px; }
  .article-pagination a:last-child { text-align: left; }
  .toast { left: 50%; bottom: 18px; }
  .image-dialog, .qr-dialog { padding: 34px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .sidebar, .mobile-header, .reading-progress, .share-button, .back-link { display: none !important; }
  main { margin: 0; }
  .content-wrap { width: 100%; padding: 0; }
}

/* Structured rich-text attributes */
.markdown-body .align-center{text-align:center}.markdown-body .align-right{text-align:right}.markdown-body .align-justify{text-align:justify}.markdown-body .text-small{font-size:14px}.markdown-body .text-body{font-size:16px}.markdown-body .text-large{font-size:18px}.markdown-body u{text-decoration-thickness:1px;text-underline-offset:3px}.markdown-body s{color:var(--muted)}
