/* Generated from theme.json by build_site.py. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #1b1724;
  --muted: #5a5466;
  --link: #4a2a80;
  --hover: #2e1a57;
  --line: #e6e3ec;
  --tint: #f3f1f7;
  --wash: #f8f7fa;
  --accent: #a3874a;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121018;
    --ink: #ebe6f5;
    --muted: #a49db6;
    --link: #c4b5fd;
    --hover: #d9bf7a;
    --line: #2a2438;
    --tint: #211a2f;
    --wash: #1a1623;
    --accent: #d9bf7a;
  }
}

/* Colours come from theme.json: build_site.py prepends the selected palette
   (and the automatic dark-mode palette) as CSS custom properties. */
:root {
  --font: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
p, h1, h2, h3, h4, ul, ol, figure, pre { margin: 0; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--hover); text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
::selection { background: var(--tint); }
.page-shell { width: min(920px, calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: absolute; top: -60px; left: 16px; padding: 10px 14px; background: var(--bg); z-index: 10; }
.skip-link:focus { top: 10px; }

/* Header and introduction */
.site-header { padding: 24px 0 30px; }
.site-header nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.site-header nav a { color: var(--muted); padding: 4px 0; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 144px; column-gap: 36px; align-items: start; padding: 4px 0 32px; }
.intro-heading { grid-column: 1; grid-row: 1; min-width: 0; }
.intro-copy { grid-column: 1; grid-row: 2; min-width: 0; }
.intro-statement { grid-column: 1 / -1; max-width: 790px; margin-top: 24px; }
.portrait { grid-column: 2; grid-row: 1 / span 2; width: 100%; margin-top: 3px; }
.portrait-link { display: block; }
.portrait img { display: block; width: 100%; height: auto; }
h1 { font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.6px; }
.chinese-name { margin-left: 10px; font-size: 20px; font-weight: 400; color: var(--muted); white-space: nowrap; letter-spacing: 0; }
.field { margin-top: 12px; font-size: 16px; line-height: 1.5; }
.affiliations { margin-top: 14px; color: var(--muted); font-size: 14px; }
.affiliations > div { display: flex; flex-wrap: wrap; gap: 0 7px; }
.affiliations p + p::before { content: '·'; margin-right: 7px; }
.bio { line-height: 1.65; }
.research-question { font-size: 21px; line-height: 1.35; font-weight: 500; margin-bottom: 9px; letter-spacing: -.15px; }
.intro-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 20px; margin-top: 14px; font-size: 14px; }
.cv-links, .primary-profiles { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cv-links { flex-basis: 100%; }
.cv-link { white-space: nowrap; font-weight: 600; padding: 3px 0; }
.file-type { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.primary-profiles { list-style: none; padding: 0; }
.primary-profiles a { display: inline-block; padding: 3px 0; }
.hero-email { overflow-wrap: anywhere; }
.welcome { margin-top: 12px; color: var(--muted); font-size: 14px; }
.personal { margin-top: 4px; color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding: 30px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px 18px; margin-bottom: 18px; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -.2px; }
.section-link, .section-note { font-size: 13px; }
.section-note { color: var(--muted); }

/* News */
.news-section { padding-bottom: 26px; }
.news-list { list-style: none; padding: 0; }
.news-list li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 16px; font-size: 15px; line-height: 1.5; }
.news-list li + li { margin-top: 8px; }
.news-list time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Selected research */
/* One figure height for all rows; each figure takes its own width (--ar is set per entry), the text
   sits centred beside it, and the key-result chips run full width underneath. */
.research-entry { --fig-h: 200px; display: grid; grid-template-columns: min(calc(var(--fig-h) * var(--ar, 1.5)), 46%) minmax(0, 1fr); gap: 14px 28px; align-items: center; min-width: 0; padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.research-entry > .highlights { grid-column: 1 / -1; align-self: start; margin: 0; }
.research-entry:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.research-figure { width: 100%; min-width: 0; }
.figure-link { display: block; border: 1px solid var(--line); background: #fff; }
.figure-link:hover { border-color: var(--muted); }
.research-figure img { display: block; width: 100%; height: auto; }
.figure-caption { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.work-body { min-width: 0; }
.work-body h3, .publication-entry h3 { font-size: 17px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.publication-entry h3 { font-size: 16px; }
.authors { margin-top: 5px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.self-author { color: var(--ink); font-weight: 600; }
.work-meta, .venue { margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.work-meta cite, .venue cite { font-style: italic; }
.work-summary { margin-top: 9px; font-size: 15px; line-height: 1.55; }
.highlights { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.highlights li { padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--ink); font-size: 13px; line-height: 1.6; }
.resource-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-top: 7px; font-size: 14px; line-height: 1.5; min-width: 0; }
.resource-links > * { min-width: 0; }
.resource-links > a { padding: 2px 0; }
/* The BibTeX toggle must read as one more link: same colour, size and
   baseline, and no disclosure triangle in any engine. */
.bibtex { display: block; }
.bibtex summary { display: inline; padding: 2px 0; color: var(--link); font: inherit; line-height: inherit; cursor: pointer; list-style: none; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex summary::marker { content: ""; }
.bibtex summary:hover { color: var(--hover); text-decoration: underline; }
.bibtex summary:focus:not(:focus-visible) { outline: none; }
.bibtex[open] { flex-basis: 100%; max-width: 100%; }
/* Wrap long author lines visually; copied text keeps the original lines. */
.bibtex pre { margin-top: 6px; padding: 10px 12px; max-width: 100%; background: var(--wash); border: 1px solid var(--line); font: 12px/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.status { display: inline-block; color: var(--muted); font-size: 13px; line-height: 1.5; font-weight: 400; }

/* Directions and publications */
.directions-list { list-style: none; padding: 0; }
.direction-entry { padding: 0 0 17px; }
.direction-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.direction-entry h3 { font-size: 16px; font-weight: 600; }
.direction-entry p { margin-top: 4px; color: var(--muted); }
.publications-list { list-style: none; padding: 0; }
.publication-entry + .publication-entry { margin-top: 12px; }
.publication-entry { padding: 8px 12px; margin: 0 -12px; border-radius: 6px; }
/* Featured works stay in the complete list, highlighted (as on jonbarron.info). */
.publication-entry.is-selected { background: var(--tint); box-shadow: inset 3px 0 0 var(--accent); }
.section-note a { margin-left: 12px; }

/* Background: every sub-heading shares one style and one rhythm */
.background-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.background-section h3 { font-size: 16px; line-height: 1.4; font-weight: 600; margin-bottom: 12px; }
.background-list { list-style: none; padding: 0; }
.background-list li + li { margin-top: 17px; }
.background-list h4 { font-size: 15px; font-weight: 600; }
.background-list p { font-size: 14px; margin-top: 2px; }
.entry-note, .entry-dates { color: var(--muted); }
.research-background { font-size: 15px; }
.research-background p + p { margin-top: 10px; }
.awards-block { margin-top: 28px; }
.awards-block ul { list-style: none; padding: 0; font-size: 15px; }
.awards-block li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.awards-block .entry-dates { font-size: 14px; }

/* Code and contact */
.software-list { list-style: none; padding: 0; }
.software-entry { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; padding-bottom: 14px; }
.software-entry h3 { font-size: 16px; font-weight: 600; }
.software-entry p { color: var(--muted); }
.contact-email { font-size: 16px; overflow-wrap: anywhere; }
.academic-profiles ul { display: flex; flex-wrap: wrap; gap: 7px 20px; margin-top: 11px; padding: 0; list-style: none; font-size: 14px; }
.academic-profiles a { display: inline-block; padding: 3px 0; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; border-top: 1px solid var(--line); padding: 17px 0 30px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.figure-credits { max-width: 36rem; font-size: .75rem; line-height: 1.55; }
.figure-credits summary { cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.figure-credits p { margin: .7em 0 0; }
.not-found { padding: 96px 0; }
.not-found p { margin-top: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .research-entry { --fig-h: 160px; column-gap: 22px; }
}
@media (max-width: 700px) {
  .page-shell { width: calc(100% - 40px); }
  .site-header { padding: 18px 0 20px; }
  .site-header nav { justify-content: flex-start; gap: 7px 19px; }
  .intro { column-gap: 26px; }
  h1 { font-size: 30px; }
  .chinese-name { font-size: 18px; margin-left: 6px; }
  .background-grid { gap: 22px; }
  .software-entry { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 640px) {
  .intro { grid-template-columns: minmax(0, 1fr) 112px; column-gap: 20px; row-gap: 0; }
  .portrait { grid-row: 1; }
  .intro-copy { grid-column: 1 / -1; }
  .intro-statement { margin-top: 20px; }
  .research-entry { grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .research-figure { max-width: 420px; margin: 0; }
}
@media (max-width: 560px) {
  .page-shell { width: calc(100% - 32px); }
  .site-header nav { font-size: 13px; gap: 5px 19px; }
  .intro-links { gap: 5px 18px; }
  .intro { padding-bottom: 22px; }
  .section { padding-top: 22px; }
  h2 { font-size: 21px; }
  .news-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .background-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .software-entry { grid-template-columns: minmax(0, 1fr); gap: 3px; padding-bottom: 16px; }
}
@media (max-width: 380px) {
  .intro { grid-template-columns: minmax(0, 1fr) 88px; column-gap: 16px; }
  h1 { font-size: 28px; }
  .chinese-name { display: block; margin: 4px 0 0; }
  .site-header nav { column-gap: 16px; }
}
@media print {
  @page { margin: 15mm; }
  body { font-size: 10pt; }
  .page-shell { width: 100%; }
  .site-header, .skip-link, .site-footer, .news-section, .bibtex { display: none; }
  .intro { grid-template-columns: minmax(0, 1fr) 120px; column-gap: 22px; padding-bottom: 18px; }
  .portrait { grid-row: 1 / span 2; }
  .intro-copy { grid-column: 1; }
  a { color: #000; }
  .section { padding-top: 16px; }
  .research-entry, .publication-entry, .background-list li { break-inside: avoid; }
}
