/* jingxuan.uk: the one stylesheet for the whole site (homepage, blog posts). Tokens first; every page links this file. */
:root {
  /* accent 1 — Imperial-leaning blue */
  --lightest-accent: #E8F0FE;
  --light-accent:    #AECBFA;
  --med-accent:      #4285F4;
  --accent:          #1A73E8;
  /* accent 2 — coral */
  --lightest-accent2: #FCE8E6;
  --light-accent2:    #F6AEA9;
  --med-accent2:      #EA4335;
  --accent2:          #D93025;
  /* accent 3 — plum (bridges the two) */
  --lightest-accent3: #F3E8FD;
  --med-accent3:      #A142F4;
  --accent3:          #8430CE;
  --green:            #1E8E3E;

  --light-gray: #F1F3F4;
  --gray:       #DADCE0;
  --med-gray:   #5F6368;
  --dark-gray:  #3C4043;
  --ink:        #202124;
  --line:       rgba(32, 33, 36, .12);
  --bg:         #FFFFFF;

  /* one sans family for everything; --serif and --serif-zh stay as names so older rules keep working */
  --sans: "Hanken Grotesk", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --serif-zh: var(--sans);
  --mono: "Google Sans Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --shadow-soft: 0 1px 2px rgba(32, 33, 36, .05), 0 16px 32px -18px rgba(32, 33, 36, .24);
  --shadow-lift: 0 4px 10px rgba(32, 33, 36, .06), 0 24px 40px -18px rgba(32, 33, 36, .34);
  --max: 1040px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.65; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: #D2E3FC; }
h1, h2 { margin: 0; font-family: var(--sans); font-weight: 600; letter-spacing: -.015em; color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 3.75rem); }
h2 { font-size: clamp(1.65rem, 1.3rem + 1.3vw, 2.15rem); }
h3 { margin: 0; }
p { margin: 0 0 .5rem; }
p:last-child { margin-bottom: 0; }
a {
  color: var(--dark-gray); text-decoration: underline;
  text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: .25s; cursor: pointer;
}
a:hover { opacity: .55; }
strong, b { font-weight: 700; }
button { font: inherit; }

#app { max-width: var(--max); margin: 0 auto; padding: 4.4rem 2rem 2rem; }
@media (max-width: 600px) { #app { padding: 4.4rem 1.25rem 2rem; } }

/* ============ NAV ============ */
/* name at the left, links at the right in the page's width, a hairline under the bar; the current page underlined in blue */
#nav {
  position: fixed; top: 0; left: 0; z-index: 9999; width: 100%;
  padding: 0 max(1.25rem, calc((100vw - var(--max)) / 2 + 2rem));
  height: 3.6rem; display: flex; align-items: center; gap: 1.6rem;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
#nav-brand { font-size: 1.12rem; font-weight: 600; color: var(--ink) !important; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; margin-right: auto; }
#nav-links { display: flex; gap: 1.5rem; align-items: stretch; height: 100%; }
#nav-links a {
  display: flex; align-items: center; text-decoration: none; font-size: .95rem; font-weight: 500;
  color: var(--dark-gray); border-bottom: 2px solid transparent; padding-top: 2px; transition: color .15s, border-color .15s;
}
#nav-links a:hover { color: var(--ink); opacity: 1; }
#nav-links a.selected { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
/* EN / 中文 for the whole site, at the right end of the bar (the posts use the same setting) */
#nav-lang { display: flex; gap: .55rem; }
#nav-lang .chip { font-size: .85rem; padding: .05rem .1rem; }
html[data-lang="en"] #nav [lang="zh"], html[data-lang="zh"] #nav [lang="en"] { display: none; }
#burger { display: none; background: none; border: 0; padding: .25rem; color: var(--ink); cursor: pointer; order: 3; }
#burger svg { width: 22px; height: 22px; display: block; }
@media (max-width: 767px) {
  #nav { gap: 1rem; }
  #burger { display: block; }
  #nav-links {
    display: none; position: absolute; top: 100%; left: 0; width: 100%; height: auto;
    flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem;
    background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-soft);
  }
  #nav-links.open { display: flex; }
  #nav-links a { padding: .6rem 0; font-size: .95rem; border-bottom: 0; }
  #nav-links a.selected { color: var(--accent); }
}

/* ============ SECTIONS ============ */
section { margin-top: 4.5rem; scroll-margin-top: 4.5rem; }
section:first-child { margin-top: 0; }
@media (max-width: 600px) { section { margin-top: 4rem; } }
section > h2 { margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--light-gray); }
.subheader {
  font-family: var(--sans); text-transform: uppercase;
  font-size: .78rem; font-weight: 400; letter-spacing: .18em; color: var(--dark-gray);
  margin: 3rem 0 .9rem;
}
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.accent  { color: var(--accent); }
.accent2 { color: var(--accent2); }
.accent3 { color: var(--accent3); }
.grad { color: var(--accent); }


/* ============ ABOUT / HERO ============ */
#header {
  display: grid; grid-template-columns: 250px 1fr; column-gap: 3rem; row-gap: 1.5rem;
  align-items: start; padding-top: 1.5rem;
}
#photo {
  grid-row: 1 / span 2; align-self: center;
  width: 250px; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 18%;
  box-shadow: var(--shadow-soft); transition: .3s; display: block; background: var(--light-gray);
}
#photo:hover { transform: translateY(-2px); }
.name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.name-row h1 .zh-wrap { white-space: nowrap; }
.name-row h1 .zh { font-family: var(--sans); font-weight: 600; }
.name-row h1 .dash { color: var(--gray); margin: 0 .15em; }
.email { font-size: 1.02rem; margin: .55rem 0 1rem; width: fit-content; letter-spacing: .01em; }
.icons { display: flex; gap: .9rem; padding-top: .9rem; flex-shrink: 0; }
.icons a { text-decoration: none; display: flex; color: var(--dark-gray); }
.icons a:hover { color: var(--ink); opacity: .6; }
.icons svg { width: 19px; height: 19px; display: block; }
.wechat-copy { position: relative; display: flex; }
.copy-toast { position: absolute; top: calc(100% + 8px); right: 0; white-space: nowrap; font-size: .78rem; padding: .3rem .6rem; border-radius: 6px; background: var(--ink); color: var(--bg, #fff); opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none; z-index: 10; }
.copy-toast.show { opacity: 1; transform: none; }
.bio p { margin-bottom: .75rem; color: #3C4043; }
.bio a { color: var(--dark-gray); }
.bio strong { font-weight: 700; color: var(--ink); }
@media (max-width: 860px) {
  #header { grid-template-columns: 1fr; }
  #photo { grid-row: auto; width: 55%; max-width: 240px; justify-self: start; }
  .name-row { flex-direction: column; gap: .4rem; }
  .icons { padding-top: 0; position: relative; }
  .wechat-copy { position: static; }
  .copy-toast { left: 0; right: auto; }
  }

/* ============ NEWS ============ */
#news-list { margin-top: .2rem; }
.update {
  display: grid; grid-template-columns: 5.6rem 1fr; gap: 1.5rem; align-items: baseline;
  padding: .75rem 0; border-bottom: 1px solid var(--light-gray);
}
.update:last-child { border-bottom: 0; }
.update .date { font-weight: 700; font-size: .92rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.news-venue {
  display: inline-block; margin-bottom: .3rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .03em; line-height: 1.35;
  color: var(--accent); background: var(--lightest-accent);
  padding: .12rem .5rem; border-radius: 999px;
}
.update-tag {
  display: inline-block; margin-top: .35rem;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .03em;
  color: var(--dark-gray); background: var(--light-gray);
  padding: .1rem .45rem; border-radius: .2rem;
}
.update p { margin: 0; }
.update strong { font-weight: 600; }
.news-expand {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; -webkit-appearance: none; appearance: none; transition: color .15s;
}
.news-expand-label { border-bottom: 1px solid var(--light-accent2); transition: border-color .15s; }
.news-expand:hover { color: var(--accent2); }
.news-expand:hover .news-expand-label { border-bottom-color: var(--accent2); }
.news-expand-chev {
  width: .8em; height: .8em; margin-left: .2em; vertical-align: -.05em;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s;
}
.news-expand.open .news-expand-chev { transform: rotate(180deg); }
.news-refs {
  list-style: none; margin: .6rem 0 .2rem; padding: .1rem 0 .1rem 1rem;
  border-left: 2px solid var(--gray); color: #3C4043;
}
.news-refs li { padding: .15rem 0; animation: refIn .18s ease both; }
.news-refs .ref-tag { color: var(--accent2); font-weight: 600; }
.news-refs a { color: var(--ink); text-decoration-color: var(--light-accent2); }
.news-refs a:hover { color: var(--accent2); text-decoration-color: var(--accent2); opacity: 1; }
@keyframes refIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .news-refs li { animation: none; } .news-expand-chev { transition: none; } }
@media (max-width: 600px) { .update { grid-template-columns: 1fr; gap: .15rem; } }

/* ============ RESEARCH ============ */
.research-intro { max-width: 60rem; }
.themes { margin: 1rem 0 .4rem; padding-left: 1.4rem; }
.themes li { margin-bottom: .55rem; padding-left: .2rem; }
.themes li::marker { color: var(--dark-gray); }
.themes .t { font-weight: 700; display: block; }
.themes .b { color: #3C4043; }
.scholar-line { margin-top: 1.1rem; }

#filters {
  margin-top: 1.4rem; padding: .9rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 2rem;
  background: var(--light-gray);
  font-size: .85rem; color: var(--dark-gray);
}
#filters .grp { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
#filters .lbl { font-weight: 700; color: var(--ink); }
.switch {
  position: relative; width: 38px; height: 20px; border-radius: 999px; border: 0; padding: 0;
  background: var(--gray); cursor: pointer; transition: .25s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .25s;
}
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }
.chip {
  border: 0; background: none; cursor: pointer; padding: .1rem .15rem;
  font-size: .85rem; color: var(--med-gray); border-bottom: 2px solid transparent; transition: .2s;
}
.chip:hover { color: var(--ink); }
.chip.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.count { margin-left: auto; font-size: .8rem; color: var(--med-gray); }

#pubs {
  margin-top: 1.4rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.9rem 1.8rem;
}
@media (max-width: 1000px) { #pubs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { #pubs { grid-template-columns: 1fr; } }
.pub {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; box-shadow: var(--shadow-soft); transition: .3s;
  font-size: .9rem;
}
.pub:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.pub .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #fff; display: block; text-decoration: none; }
.pub .thumb:hover { opacity: 1; }
.pub .thumb img, .pub .thumb svg { width: 100%; height: 100%; object-fit: contain; padding: 10px; display: block; }
.pub .body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.pub .vrow { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: .25rem; }
.pub .venue { font-size: .8rem; color: var(--dark-gray); letter-spacing: .01em; }
.pub .venue .ext { color: var(--accent2); font-weight: 600; margin-left: .35rem; }
.pub .title { font-size: 1.04rem; font-weight: 700; line-height: 1.35; color: var(--ink); margin-bottom: .3rem; }
.pub .title a { color: inherit; text-decoration: none; }
.pub .authors { font-size: .84rem; font-weight: 300; color: var(--dark-gray); line-height: 1.5; }
.pub .authors .me { font-weight: 700; color: var(--accent); }
.pub .authors .pending { font-style: italic; color: var(--med-gray); }
.pub .authors sup { font-size: .7em; line-height: 0; }
.pub .authors .equal-note { display: block; margin-top: .15rem; font-size: .76rem; color: var(--med-gray); }
.pub .links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; padding-top: 1rem; }
.linkbtn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; letter-spacing: .02em; text-decoration: none;
  color: var(--med-gray); background: var(--light-gray); padding: .22rem .6rem; transition: .25s;
}
.linkbtn svg { width: 12px; height: 12px; }
.linkbtn:hover { opacity: 1; background: var(--gray); color: var(--ink); }

/* ============ PROJECTS ============ */
#projects-grid { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
@media (max-width: 1000px) { #projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { #projects-grid { grid-template-columns: 1fr; } }
.proj {
  display: flex; flex-direction: column; padding: 1.25rem 1.25rem 1.1rem;
  background: #fff; box-shadow: var(--shadow-soft); transition: .3s; position: relative; overflow: hidden;
}
.proj::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--accent);
  opacity: .85;
}
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.proj .pname { font-family: var(--sans); font-weight: 600; font-size: 1.4rem; color: var(--ink); line-height: 1.2; }
.proj .pmeta { display: flex; gap: 1rem; font-size: .76rem; color: var(--med-gray); margin: .3rem 0 .7rem; }
.proj .pmeta .lang::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lc, var(--med-gray)); margin-right: .35rem; vertical-align: 0;
}
.proj .pblurb { font-size: .92rem; color: #3C4043; line-height: 1.55; }
.proj .links { display: flex; gap: .45rem; margin-top: auto; padding-top: 1.1rem; }

/* ============ WRITING ============ */
.tabs { display: flex; gap: 1.4rem; margin-top: 1rem; border-bottom: 1px solid var(--light-gray); }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: .4rem 0 .55rem;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--med-gray);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent2); }
.tabs .n { margin-left: .35rem; color: var(--med-gray); font-weight: 400; }
.posts { list-style: none; margin: .4rem 0 0; padding: 0; }
.post { border-bottom: 1px solid var(--light-gray); }
.post:last-child { border-bottom: 0; }
.post a {
  display: grid; grid-template-columns: 96px 1fr; gap: 2rem;
  padding: 1.05rem 0; text-decoration: none; color: var(--ink);
}
.post a:hover { opacity: 1; }
.post a:hover .ptitle { color: var(--accent); }
.post .pdate { font-weight: 700; white-space: nowrap; }
.post .ptitle { font-family: var(--sans); font-weight: 600; font-size: 1.2rem; line-height: 1.3; transition: .25s; }
.post .pex { color: var(--dark-gray); font-size: .92rem; margin-top: .2rem; }
.post .pmeta { margin-top: .35rem; font-size: .74rem; color: var(--med-gray); display: flex; gap: .9rem; flex-wrap: wrap; }
.post .pmeta .tg { color: var(--med-gray); }
@media (max-width: 600px) { .post a { grid-template-columns: 1fr; gap: .1rem; } }
.empty { color: var(--med-gray); margin-top: 1rem; }

/* ============ CONTACT ============ */
#contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 1rem; }
@media (max-width: 760px) { #contact-grid { grid-template-columns: 1fr; gap: 1rem; } }
#contact-grid .subheader { margin-top: 1rem; }
.venues-list { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.venues-list span {
  font-size: .82rem; padding: .18rem .65rem; background: var(--light-gray); color: var(--dark-gray);
}
.venues-list span.gold { background: var(--lightest-accent2); color: var(--accent2); font-weight: 600; }
.chat-card {
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-soft);
  border-left: 3px solid var(--accent2);
}
.chat-card p { color: #3C4043; }
.chat-card .cta {
  display: inline-flex; align-items: center; gap: .45rem; margin-top: .8rem;
  font-weight: 600; color: var(--accent2); text-decoration: none;
}
.chat-card .cta svg { width: 15px; height: 15px; }

/* ============ FOOTER ============ */
#footer {
  margin-top: 6rem; padding: 1.4rem 0 .6rem; border-top: 1px solid var(--light-gray);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .82rem; color: var(--med-gray);
}
#footer a { color: var(--med-gray); }

/* ============ BLOG POST ============ */
/* A post (blog/<slug>.html, built by blog-src/build.py) uses the same tokens, #nav and #footer as the homepage; its own
   rules all sit under .post-page. One language shows at a time: html[data-lang] hides the other's [lang] elements. */
html[data-lang="en"] .post-page [lang="zh"], html[data-lang="zh"] .post-page [lang="en"] { display: none; }
.post-page {
  max-width: var(--max); margin: 0 auto; padding: 6rem 2rem 1rem;
  display: grid; grid-template-columns: 1fr; column-gap: 3.5rem;
}
@media (min-width: 1100px) {
  .post-page { grid-template-columns: 190px minmax(0, 1fr); }
  .post-head { grid-column: 2; }
  .post-toc { grid-column: 1; grid-row: 2; }
  .post-body { grid-column: 2; grid-row: 2; }
}
@media (max-width: 600px) { .post-page { padding: 5rem 1.25rem 1rem; } }
.post-shell { max-width: var(--max); margin: 0 auto; padding: 0 2rem 2rem; }
@media (max-width: 600px) { .post-shell { padding: 0 1.25rem 2rem; } }

.post-head { max-width: 680px; margin-bottom: 2.6rem; }
.post-crumb { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--med-gray); display: flex; gap: .55rem; }
.post-crumb b { font-weight: 400; }
.post-crumb a { text-decoration: none; color: var(--med-gray); }
.post-eyebrow { display: flex; align-items: center; justify-content: space-between; margin-top: 1.6rem; font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.post-head h1 { margin: .5rem 0 1rem; font-size: clamp(2rem, 1.4rem + 2.2vw, 2.9rem); text-wrap: balance; }
html[data-lang="zh"] .post-head h1 { line-height: 1.3; }
.post-standfirst { font-family: var(--sans); font-size: 1.18rem; line-height: 1.6; color: var(--dark-gray); margin: 0; }
html[data-lang="zh"] .post-standfirst { font-family: var(--sans); font-size: 1.08rem; line-height: 1.8; }
.post-authors { margin-top: 1rem; font-size: .85rem; color: var(--med-gray); }

/* EN / 中文: the publication filter's chips */
.post-lang { display: flex; gap: .6rem; }
.post-lang button { border: 0; background: none; cursor: pointer; padding: .1rem .15rem; font-size: .85rem; font-weight: 400; color: var(--med-gray); border-bottom: 2px solid transparent; transition: .2s; }
.post-lang button:hover { color: var(--ink); }
.post-lang button[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

/* contents, left of the text from 1100px */
.post-toc { font-size: .85rem; }
.post-toc ol { list-style: none; margin: 0; padding: 0; position: sticky; top: 6rem; border-left: 1px solid var(--light-gray); }
.post-toc li a { display: block; padding: .3rem 0 .3rem .9rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--med-gray); text-decoration: none; }
.post-toc li a:hover { color: var(--ink); opacity: 1; }
.post-toc li a.on { color: var(--ink); font-weight: 700; border-left-color: var(--accent); }
@media (max-width: 1099px) { .post-toc { display: none; } }

/* text */
.post-body { max-width: 680px; min-width: 0; counter-reset: fig; }
.post-body p { margin: 0 0 1.1rem; color: #3C4043; font-size: 1.04rem; line-height: 1.78; }
html[data-lang="zh"] .post-body p { line-height: 1.9; }
.post-body h2 {
  font-size: 1.7rem; line-height: 1.2; margin: 3.2rem 0 1.1rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--light-gray); scroll-margin-top: 5rem;
}
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-size: 1.1rem; margin: 2rem 0 .8rem; scroll-margin-top: 5rem; }
.post-body ul, .post-body ol { color: #3C4043; padding-left: 1.3rem; margin: 0 0 1.1rem; }
.post-body li { margin-bottom: .35rem; line-height: 1.75; }
.post-body strong { color: var(--ink); }
.post-body code { font-family: var(--mono); font-size: .88em; background: var(--light-gray); padding: .08em .35em; border-radius: 3px; }
.post-body pre { background: var(--light-gray); padding: 1rem 1.1rem; border-radius: 6px; overflow-x: auto; font-size: .85rem; line-height: 1.55; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote { margin: 1.4rem 0; padding: .2rem 0 .2rem 1.1rem; border-left: 2px solid var(--gray); color: var(--dark-gray); }
.post-body .eq { overflow-x: auto; overflow-y: hidden; }
.post-body a.cite { text-decoration: none; color: var(--accent); font-size: .85em; }
.post-body table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 1.2rem 0 1.6rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--light-gray); vertical-align: top; }
.post-body th { font-weight: 700; border-bottom-color: var(--gray); }

/* figures: data charts and captioned images are numbered, schematics without a caption are not */
.post-body figure { margin: 2rem 0 2.2rem; }
.post-body figure img { max-width: 100%; height: auto; display: block; border-radius: 6px; }
.post-body figure svg text:not([font-family]) { font-family: var(--sans); }   /* chart labels; diagrams set their own (serif for maths) */
.post-body figure.chart, .post-body figure.picture { counter-increment: fig; }
.post-body .fig-title { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: .7rem; }
.post-body figure.schematic svg { border: 1px solid var(--light-gray); border-radius: 6px; }
.post-body figcaption { margin-top: .7rem; font-size: .88rem; line-height: 1.6; color: var(--dark-gray); }
.post-body figure.chart figcaption::before, .post-body figure.picture figcaption::before { content: "Figure " counter(fig) ". "; font-weight: 700; color: var(--ink); }
html[data-lang="zh"] .post-body figure.chart figcaption::before, html[data-lang="zh"] .post-body figure.picture figcaption::before { content: "图 " counter(fig) "　"; }
.post-body .fig-src { display: block; margin-top: .25rem; font-size: .8rem; color: var(--med-gray); }
/* data charts: grey card; /blog/charts.js redraws at the card's width, draws the marks in and shows values on hover */
.post-body figure.chart { background: #F8F9FA; border-radius: 8px; padding: 1.1rem 1.2rem .9rem; }
.post-body figure.chart .chart-box { min-height: 1px; }
.post-body figure.chart .hit { cursor: pointer; }
.post-body figure.chart .bar:hover { filter: brightness(.92); }
.post-body figure.chart.anim .mk.bar { transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; transition: transform .9s cubic-bezier(.2,.7,.2,1) calc(.1s + var(--i, 0) * 110ms); }
.post-body figure.chart.anim .mk.line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.4,0,.2,1) .15s; }
.post-body figure.chart.anim .mk.dot, .post-body figure.chart.anim .mk.lab, .post-body figure.chart.anim .mk.fade { opacity: 0; transition: opacity .5s ease calc(.6s + var(--i, 0) * 90ms); }
.post-body figure.chart.anim.drawn .mk.bar { transform: none; }
.post-body figure.chart.anim.drawn .mk.line { stroke-dashoffset: 0; }
.post-body figure.chart.anim.drawn .mk.dot, .post-body figure.chart.anim.drawn .mk.lab, .post-body figure.chart.anim.drawn .mk.fade { opacity: 1; }
.chart-tip { position: absolute; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .12s; background: #202124; color: #fff; font: 500 .8rem/1.35 var(--sans); padding: .35rem .6rem; border-radius: 6px; white-space: nowrap; box-shadow: 0 6px 18px rgba(32, 33, 36, .18); }
.chart-tip.on { opacity: 1; }
@media (max-width: 600px) { .post-body figure.chart { padding: .9rem .7rem .8rem; margin-left: -.4rem; margin-right: -.4rem; } }

/* 「详细说明」 under a figure: numbers and caveats kept out of the text (~/Build/lab/WRITING.md) */
.post-body details.more { margin-top: .6rem; font-size: .88rem; color: var(--dark-gray); }
.post-body details.more summary { cursor: pointer; color: var(--med-gray); font-size: .82rem; }
.post-body details.more p { font-size: .88rem; line-height: 1.65; margin: .5rem 0 0; }

/* experiment pages (lab.jingxuan.uk): a question with its status tag and short answer, the setups side by side, the run record */
.post-body h3.hyp { font-size: 1.12rem; line-height: 1.45; margin: 2.6rem 0 .5rem; }
.post-body .hyp-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .05rem .55rem; margin-right: .55rem; border-radius: 999px; border: 1px solid; vertical-align: .15em; }
.post-body .hyp-tag.done { color: var(--green); border-color: var(--green); }
.post-body .hyp-tag.test { color: var(--med-gray); border-color: var(--gray); }
.post-body p.hyp-answer { margin-bottom: 1rem; }
.post-body figure.setups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem 1rem; }
.post-body .setup svg { border: 1px solid var(--light-gray); border-radius: 6px; }
.post-body .setup-name { font-weight: 600; font-size: .9rem; color: var(--ink); margin: .6rem 0 .25rem; }
.post-body .setup-tag { display: inline-block; font-size: .68rem; font-weight: 600; padding: .02rem .45rem; margin-left: .25rem; border-radius: 999px; border: 1px solid var(--gray); color: var(--dark-gray); vertical-align: .1em; }
.post-body .setup-tag.main { border-color: var(--accent); color: var(--accent); }
.post-body .setup p { font-size: .84rem; line-height: 1.55; margin: 0; color: var(--dark-gray); }
@media (max-width: 760px) { .post-body figure.setups { grid-template-columns: 1fr; } }
.post-body table.record td.num { font-variant-numeric: tabular-nums; }
.post-body table.record code { font-size: .8em; white-space: nowrap; }
.post-body .record-sum { font-size: .88rem; color: var(--med-gray); }

/* references */
.post-refs { margin-top: 3.4rem; padding-top: 1.2rem; border-top: 1px solid var(--light-gray); font-size: .88rem; color: var(--dark-gray); }
.post-refs h3 { font-family: var(--sans); text-transform: uppercase; font-size: .78rem; font-weight: 400; letter-spacing: .18em; margin: 0 0 .8rem; }
.post-refs ol { padding-left: 1.2rem; margin: 0; }
.post-refs li { margin-bottom: .5rem; line-height: 1.6; scroll-margin-top: 5rem; }

/* a post updated later: the old sentence struck out, the new one after it (Jingxuan, 2026-11-24) */
.post-body del { color: var(--med-gray); text-decoration-color: var(--light-accent2); }
.post-body ins { text-decoration: none; color: var(--ink); margin-left: .3em; }
.post-body p.post-update { border-left: 2px solid var(--accent2); padding-left: .9rem; color: var(--ink); }
.post-body .post-update .when { font-weight: 700; color: var(--accent2); font-size: .85em; margin-right: .6em; }
