:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #fff;
  --card: #fff;
  --navy: #00205b;
  --blue: #4169e1;
  --line: #e8e5df;
  --soft-blue: #eef3ff;
  --serif: Georgia, "Times New Roman", "Noto Serif SC", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.72; }
a { color: var(--blue); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--navy); }
.nav { max-width: 1120px; height: 68px; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { color: white; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.navlinks { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.navlinks a { color: rgba(255,255,255,.82); text-decoration: none; font-size: .94rem; }
.navlinks a:hover, .navlinks a[aria-current="page"] { color: white; font-weight: 650; }
.lang { border: 1px solid var(--line); background: white; padding: 6px; border-radius: 999px; display: flex; gap: 2px; }
.lang button { border: 0; border-radius: 999px; padding: 5px 10px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: .82rem; }
.lang button.active { color: white; background: var(--navy); }
.article-meta { align-items: center; }
.article-lang { margin-left: 4px; padding: 3px; background: transparent; }
.article-lang button { padding: 3px 9px; font-size: .76rem; }
.wrap { max-width: 1120px; margin: auto; padding: 0 24px; }
.hero { padding: 96px 0 72px; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 64px; align-items: end; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 760; }
.hero h1 { margin: 12px 0 18px; max-width: 760px; font: 600 clamp(2.8rem, 7vw, 5.8rem)/.98 var(--serif); letter-spacing: -.055em; }
.hero p { margin: 0; max-width: 680px; color: var(--muted); font-size: 1.08rem; }
.hero-note { padding: 20px 0 2px 24px; border-left: 2px solid var(--navy); color: var(--muted); font-size: .92rem; }
.section-label { border-top: 1px solid var(--line); padding: 26px 0 18px; color: var(--muted); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.post-card { display: grid; grid-template-columns: 1fr 240px; gap: 48px; padding: 42px 0 70px; }
.post-card h2 { margin: 12px 0 14px; max-width: 760px; font: 600 clamp(2rem, 4vw, 3.6rem)/1.08 var(--serif); letter-spacing: -.035em; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--blue); }
.dek { color: var(--muted); max-width: 720px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .83rem; }
.tag { color: var(--blue); background: var(--soft-blue); border-radius: 999px; padding: 4px 10px; }
.post-aside { align-self: center; border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--card); }
.post-aside strong { display: block; font: 600 1.35rem var(--serif); margin-bottom: 8px; }
.post-aside span { color: var(--muted); font-size: .88rem; }
.article-shell { width: min(100%, 2100px); margin: 0 auto; padding: 60px clamp(18px, 1.8vw, 28px) 0; display: grid; grid-template-columns: 340px minmax(0, 1120px) minmax(235px, 290px); column-gap: clamp(16px, 1.4vw, 24px); justify-content: center; }
.article-main { min-width: 0; }
.article-head { padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: 14px 0 18px; max-width: none; font: 600 clamp(1.75rem, 2.4vw, 2.25rem)/1.08 var(--serif); letter-spacing: -.035em; white-space: nowrap; }
.article-head .dek { max-width: 840px; font-size: 1.06rem; line-height: 1.68; }
.article { padding: 34px 0 96px; font-family: var(--serif); font-size: 1.07rem; line-height: 1.74; }
.article h1, .article h2, .article h3 { color: var(--ink); scroll-margin-top: 90px; }
.article h1 { margin: 2.8em 0 .7em; font-size: 2rem; }
.article h1#references { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.article h1#references ~ p { margin: .85rem 0; padding-left: 1.6rem; text-indent: -1.6rem; color: #4d576b; font: .84rem/1.62 var(--sans); }
.article h2 { margin: 2.2em 0 .65em; font-size: 1.5rem; }
.article p { margin: 1em 0; }
.article li { margin: .35em 0; }
.article blockquote { margin: 1.7em 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--blue); color: var(--muted); }
.article img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; }
.article figure { width: fit-content; max-width: 100%; margin: 2.2rem auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.article figure.lead-figure { width: 58%; max-width: 620px; }
.article figure img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; border: 0; border-radius: 7px; }
.article figcaption { padding: 12px 4px 0; color: var(--muted); font: .82rem/1.5 var(--sans); text-align: center; }
.article p.figure-note { max-width: 88%; margin: -1.25rem auto 2.2rem; color: var(--muted); font: .82rem/1.55 var(--sans); text-align: center; }
.article figure + p > em:only-child { display: none; }
.article code { font-size: .88em; background: #f0eee9; padding: .1em .35em; border-radius: 4px; }
.math-block { margin: 1.8rem 0; overflow-x: auto; overflow-y: hidden; text-align: center; }
.math-block mjx-container { min-width: max-content; }
.bibtex-section { margin-top: 4.6rem; padding: 2.4rem 0 1.8rem; border-top: 1px solid var(--line); font-family: var(--sans); }
.bibtex-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.article .bibtex-heading h1 { margin: 0; font: 600 1.5rem/1.25 var(--serif); }
.article .bibtex-heading p { margin: .45rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.bibtex-copy { flex: none; min-height: 36px; padding: 7px 12px; border: 1px solid var(--navy); border-radius: 6px; background: var(--navy); color: white; cursor: pointer; font: 650 .8rem/1 var(--sans); transition: background .16s ease, border-color .16s ease; }
.bibtex-copy:hover { background: var(--blue); border-color: var(--blue); }
.bibtex-copy:focus-visible { outline: 3px solid #aebfff; outline-offset: 2px; }
.bibtex-code { margin: 1.4rem 0 0; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #f7f8fb; color: #263248; font: .82rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article .bibtex-code code { padding: 0; background: transparent; font: inherit; white-space: pre; }
.article p.bibtex-status { min-height: 1.4em; margin: .45rem 0 0; color: var(--muted); font: .76rem/1.4 var(--sans); }
.comments-section { margin-top: 4.6rem; padding: 2.4rem 0 1.7rem; border-top: 1px solid var(--line); font-family: var(--sans); }
.article .comments-section h1 { margin: 0 0 .55rem; font-family: var(--serif); }
.comments-thread { min-height: 118px; margin-top: 1.5rem; }
.comments-thread:empty { min-height: 0; margin-top: 0; }
.comments-thread .giscus, .comments-thread .giscus-frame { width: 100%; }
.comments-setup { margin: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f7; color: var(--muted); font: .88rem/1.6 var(--sans); }
.toc { position: sticky; top: 96px; width: 100%; max-width: 240px; justify-self: end; align-self: start; max-height: calc(100vh - 120px); padding: 10px 8px 24px 0; overflow-y: auto; scrollbar-width: thin; }
.toc-title { font-size: .84rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.toc a { display: block; margin: 8px 0; padding: 3px 0 3px 12px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.4; overflow-wrap: anywhere; transition: color .16s ease, border-color .16s ease; }
.toc a.toc-subsection { padding-left: 24px; font-size: .82rem; }
.toc a:hover, .toc a.active { color: var(--blue); border-left-color: var(--blue); }
.citation-rail { position: relative; align-self: stretch; min-width: 0; }
.citation-note { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: 1.3rem minmax(0, 1fr); gap: 8px; padding: 2px 0 11px; border-bottom: 1px solid var(--line); color: #667085; font: .8rem/1.52 var(--sans); overflow-wrap: anywhere; transition: color .16s ease, border-color .16s ease; }
.citation-note.active { color: #364152; border-bottom-color: #aebfff; }
.citation-number { display: grid; width: 1.2rem; height: 1.2rem; place-items: center; margin-top: .08rem; border: 1px solid #c8cfdb; border-radius: 50%; color: #697386; font-size: .62rem; font-weight: 700; line-height: 1; transition: color .16s ease, border-color .16s ease; }
.citation-note.active .citation-number { color: var(--blue); border-color: var(--blue); }
.citation-copy { min-width: 0; }
.citation-note em { color: var(--ink); }
.citation-note a { display: block; width: fit-content; margin-top: 5px; color: var(--blue); font-size: .75rem; font-weight: 650; text-decoration: none; }
.citation-note a:hover { text-decoration: underline; }
.article a[data-citation] { text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article a[data-citation]::after { content: attr(data-citation); display: inline-grid; width: 1.05rem; height: 1.05rem; place-items: center; margin-left: .16rem; border: 1px solid #c8cfdb; border-radius: 50%; color: #697386; font: 650 .55rem/1 var(--sans); vertical-align: super; text-decoration: none; }
.article a[data-citation].citation-active { color: var(--navy); }
.article a[data-citation].citation-active::after { color: var(--blue); border-color: var(--blue); }
.footer { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--muted); font-size: .86rem; }
.blog-list { min-height: calc(100vh - 167px); padding-top: 56px; padding-bottom: 88px; }
.blog-list h1 { margin: 0 0 30px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--ink); font: 600 2.2rem/1.2 var(--sans); }
.blog-entry { display: grid; grid-template-columns: 150px minmax(0, 760px); gap: 34px; padding: 28px 0 36px; border-bottom: 1px solid var(--line); }
.entry-date { color: var(--muted); font-size: .9rem; padding-top: 7px; }
.blog-entry h2 { margin: 0 0 10px; font: 650 1.55rem/1.3 var(--sans); }
.blog-entry h2 a { color: var(--blue); text-decoration: none; }
.blog-entry h2 a:hover { text-decoration: underline; }
.blog-entry p { margin: 0 0 14px; color: #4d576b; }
[data-i18n] { transition: opacity .15s ease; }
@media (max-width: 1260px) {
  .article-shell { padding-left: 16px; padding-right: 16px; grid-template-columns: 256px minmax(0, 1fr) 230px; column-gap: 16px; }
  .toc { max-width: 220px; }
  .toc a { font-size: .83rem; }
  .toc a.toc-subsection { padding-left: 18px; font-size: .78rem; }
  .citation-note { font-size: .76rem; }
}
@media (max-width: 960px) {
  .article-shell { width: min(100%, 920px); grid-template-columns: minmax(150px, 180px) minmax(0, 700px); gap: 32px; }
  .citation-rail { display: none; }
}
@media (max-width: 860px) {
  .nav { padding: 0 16px; gap: 10px; }
  .navlinks { gap: 14px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 68px 0 52px; }
  .hero-note { max-width: 460px; }
  .post-card { grid-template-columns: 1fr; gap: 24px; }
  .post-aside { max-width: 360px; }
  .article-shell { grid-template-columns: minmax(0, 1fr); padding: 48px 24px 0; }
  .article-head h1 { white-space: normal; text-wrap: balance; }
  .blog-entry { grid-template-columns: 1fr; gap: 8px; }
  .toc { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .hero h1 { font-size: 2.8rem; }
  .article { font-size: 1rem; }
  .bibtex-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .bibtex-copy { align-self: start; }
  .bibtex-code { padding: 15px 16px; font-size: .76rem; }
  .article figure { margin-left: auto; margin-right: auto; padding: 8px; }
  .article figure.lead-figure { width: 82%; max-width: 620px; }
}
