/* Compact academic layout; content stays readable without JavaScript. */
:root { color-scheme: light; --bg: #fff; --surface: #f5f8f8; --ink: #172b38; --muted: #52636e; --subtle: #687680; --line: #dce4e6; --accent: #17665d; --accent-light: #e4f1eb; --focus: #2879c7; --header: rgba(255,255,255,.97); --serif: Georgia,'Times New Roman','Songti SC',serif; --sans: -apple-system,BlinkMacSystemFont,'Segoe UI','Noto Sans',Helvetica,Arial,sans-serif; --width: 1240px; }
:root[data-theme='dark'] { color-scheme: dark; --bg: #111b22; --surface: #17252d; --ink: #e6eef0; --muted: #b4c3cc; --subtle: #9cb0bb; --line: #32434c; --accent: #93d4bc; --accent-light: #203a32; --focus: #95caff; --header: rgba(17,27,34,.97); }
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-light); color: var(--ink); }
a { color: var(--accent); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button,input,select { font: inherit; color: inherit; }
button,summary,select { cursor: pointer; }
button,a,input,select,summary { -webkit-tap-highlight-color: transparent; }
:is(button,a,input,select,summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img,svg { max-width: 100%; }
img { display: block; height: auto; }
p,h1,h2,h3,h4,figure { margin: 0; }
h1,h2,h3,h4 { font-weight: 500; }
ul { padding: 0; margin: 0; list-style: none; }
[hidden] { display: none !important; }
.content-width { width: calc(100% - 72px); max-width: var(--width); margin-inline: auto; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.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; }
.anchor-alias { position: absolute; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 12px; padding: 8px 15px; background: var(--ink); color: var(--bg); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* The navigation remains visible, including on phones. */
.site-header { position: sticky; z-index: 30; top: 0; background: var(--header); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 64px; display: flex; align-items: center; gap: 24px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.monogram { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; padding-bottom: 3px; border-radius: 8px; background: #173f39; color: #e7f1ec; font: 700 1.45rem/1 var(--serif); }
#main-nav { display: flex; align-items: center; gap: 23px; margin-left: auto; }
#main-nav a { position: relative; color: var(--muted); font-size: .875rem; padding-block: 21px; line-height: 1.5; white-space: nowrap; }
#main-nav a:hover,#main-nav a[aria-current='location'] { text-decoration: none; color: var(--accent); }
#main-nav a[aria-current='location']::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.theme-toggle { display: none; flex: 0 0 auto; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { background: var(--surface); }

/* A stable identity column keeps the main column for research. */
.page-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 48px; align-items: start; padding-block: 32px 26px; }
.profile-sidebar { position: sticky; top: 96px; min-width: 0; }
.profile-photo { width: 190px; height: 190px; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.profile-identity h1 { font: 500 1.95rem/1.2 var(--serif); letter-spacing: -.04em; margin-top: 18px; }
.chinese-name { font: 400 1.125rem/1.6 'Songti SC',var(--serif); color: var(--muted); letter-spacing: .14em; margin-top: 5px; }
.affiliation { margin-top: 13px; font-size: .875rem; color: var(--muted); line-height: 1.7; }
.affiliation strong { display: block; color: var(--ink); font-weight: 600; }
.affiliation span { display: block; margin-top: 3px; }
.profile-links { margin-top: 17px; }
.profile-email { display: inline-flex; align-items: center; gap: 7px; font-size: .875rem; }
.profile-email .icon { width: 16px; height: 16px; }
.social-links { display: flex; flex-wrap: wrap; gap: 5px 17px; max-width: 210px; margin-top: 11px; }
.social-link { font-size: .875rem; }
.main-column { min-width: 0; }
.about-section h2,.section-heading h2 { font: 500 1.8rem/1.25 var(--serif); letter-spacing: -.025em; }
.about-text { margin-top: 12px; }
.about-text p { font-size: 1rem; line-height: 1.7; color: var(--muted); }
.about-text p + p { margin-top: 10px; }
.research-overview { display: flex; flex-wrap: wrap; gap: 4px 17px; margin-top: 12px; }
.research-overview a { font-size: .875rem; font-weight: 550; }
.content-section { position: relative; margin-top: 27px; padding-top: 25px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading > a { font-size: .875rem; white-space: nowrap; }

/* Short announcements; the full archive is one click away. */
.news-list { display: grid; gap: 7px; }
.news-list li { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 14px; align-items: baseline; }
.news-list time { font-size: .875rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-list p { font-size: 1rem; line-height: 1.6; color: var(--muted); }
.news-list strong { color: var(--ink); font-weight: 600; }
.news-archive { margin-top: 8px; }
.news-archive > summary { color: var(--accent); font-size: .875rem; width: fit-content; list-style-position: inside; }
.news-archive > summary span { color: var(--subtle); }
.news-archive .news-list { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }

/* Compact bibliographic rows with native disclosure for summaries and BibTeX. */
.section-description { color: var(--muted); font-size: .875rem; margin-top: -3px; margin-bottom: 12px; }
.section-description strong { font-weight: 600; color: var(--ink); }
.publication-controls { display: none; }
.js .publication-controls { display: block; margin-top: 13px; }
.publication-toolbar { display: flex; align-items: center; gap: 10px; }
.view-switch { flex: 0 0 auto; display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.view-switch button { border: 0; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 3px; font-size: .875rem; font-weight: 550; white-space: nowrap; }
.view-switch button span { color: var(--subtle); font-size: .75rem; padding-left: 5px; }
.view-switch button[aria-pressed='true'] { color: var(--accent); background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.search-field { display: flex; align-items: center; gap: 7px; flex: 1 1 auto; min-width: 150px; border: 1px solid var(--line); border-radius: 5px; padding-left: 10px; color: var(--subtle); }
.search-field:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.search-field .icon { width: 17px; height: 17px; }
.search-field input { background: transparent; border: 0; outline: none; width: 100%; min-width: 0; font-size: .875rem; padding: 7px 8px 7px 0; line-height: 1.5; }
.search-field input:focus-visible { outline: none; }
.search-field input::placeholder { color: var(--subtle); opacity: 1; }
.year-filter { flex: 0 0 auto; }
.year-filter select { appearance: none; background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23687780' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 7px 31px 7px 10px; font-size: .875rem; line-height: 1.5; }
.topic-filters { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.topic-filters button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 4px; padding: 4px 9px; font-size: .875rem; line-height: 1.5; }
.topic-filters button:first-child { margin-left: -9px; }
.topic-filters button[aria-pressed='true'] { color: var(--accent); background: var(--accent-light); }
.topic-filters button:hover { border-color: var(--line); }
.publication-status { margin-top: 9px; color: var(--subtle); font-size: .875rem; }
.publication-year { display: grid; grid-template-columns: 45px minmax(0,1fr); column-gap: 15px; padding-top: 17px; }
.publication-year + .publication-year { margin-top: 2px; border-top: 1px solid var(--line); }
.year-heading { color: var(--muted); font: 500 1.3rem/1.55 var(--serif); }
.publication { padding-block: 0 15px; }
.publication + .publication { border-top: 1px solid var(--line); padding-top: 14px; }
.publication h4 { color: var(--ink); font-size: 1rem; font-weight: 600; line-height: 1.5; letter-spacing: -.008em; }
.publication h4 a { color: var(--ink); }
.publication h4 a:hover { color: var(--accent); }
.paper-authors { margin-top: 4px; color: var(--subtle); font-size: .875rem; line-height: 1.65; }
.paper-authors strong { color: var(--ink); font-weight: 650; }
.author-role { color: var(--accent); font-size: .875rem; }
.paper-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 15px; margin-top: 5px; }
.publication-venue { display: flex; align-items: center; gap: 7px; }
.venue-badge { display: inline-block; color: var(--accent); background: var(--accent-light); border-radius: 3px; padding: 2px 6px; font-size: .75rem; font-weight: 650; line-height: 1.5; }
.venue-badge.preprint { background: var(--surface); color: var(--muted); border: 1px solid var(--line); padding: 1px 5px; }
.paper-type { font-size: .75rem; color: var(--subtle); }
.paper-links { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 13px; min-width: 0; flex: 1 1 auto; }
.paper-links > a,.paper-links summary { font-size: .875rem; font-weight: 500; color: var(--accent); }
.paper-links details { min-width: 0; }
.paper-links details[open] { flex-basis: 100%; }
.paper-links summary { width: fit-content; list-style: none; cursor: pointer; }
.paper-links summary::-webkit-details-marker { display: none; }
.paper-links summary:hover { text-decoration: underline; text-underline-offset: .2em; }
.paper-summary { font-size: 1rem; line-height: 1.65; color: var(--muted); padding: 10px 13px; margin-top: 6px; background: var(--surface); border-left: 2px solid var(--accent); }
.citation-panel { background: var(--surface); border: 1px solid var(--line); padding: 12px; margin-top: 6px; border-radius: 4px; }
.citation pre { margin: 0; max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .75rem/1.7 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color: var(--muted); }
.copy-citation { display: none; background: var(--bg); color: var(--accent); border: 1px solid var(--line); border-radius: 4px; padding: 4px 9px; margin-top: 9px; font-size: .875rem; align-items: center; gap: 6px; }
.js .copy-citation { display: inline-flex; }
.copy-citation .icon { width: 14px; height: 14px; }
.empty-state { padding: 35px 15px; text-align: center; }
.empty-state h3 { font: 500 1.35rem/1.5 var(--serif); }
.empty-state p { margin-block: 6px 14px; color: var(--muted); }
.button { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 7px 13px; font-size: .875rem; }

/* Compact research, code, and experience directories. */
.direction { display: grid; grid-template-columns: 215px minmax(0,1fr); gap: 20px; padding-block: 12px; }
.direction + .direction { border-top: 1px solid var(--line); }
.direction h3 { font-size: 1rem; font-weight: 600; line-height: 1.55; }
.direction p { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.direction-works { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 5px; }
.direction-works a { font-size: .875rem; }
.project-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 27px; }
.project { border-top: 1px solid var(--line); padding-block: 14px; min-width: 0; }
.project-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.project h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
.project-links { display: flex; gap: 13px; font-size: .875rem; }
.project > p { color: var(--muted); font-size: 1rem; line-height: 1.65; margin-top: 5px; }
.experience-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 32px; }
.subsection-title { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.timeline li { margin-bottom: 15px; }
.timeline time { font-size: .875rem; color: var(--accent); }
.timeline h3 { font-size: 1rem; font-weight: 550; line-height: 1.55; margin-top: 1px; }
.timeline p { font-size: .875rem; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.service > p { font-size: .875rem; color: var(--subtle); margin-block: 10px 6px; }
.service-venues { display: flex; flex-wrap: wrap; gap: 4px 13px; color: var(--ink); font-size: .875rem; font-weight: 550; }
.service > ul { font-size: .875rem; color: var(--muted); line-height: 1.85; }
.service .tutorial-note { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--line); padding-block: 17px; font-size: .75rem; color: var(--subtle); }
.site-footer p:first-child span { margin-left: 7px; }
.site-footer p:nth-child(2) span { padding-inline: 6px; }
.site-footer a { color: var(--muted); }

@media (max-width: 1080px) {
  .content-width { width: calc(100% - 48px); }
  .page-layout { grid-template-columns: 195px minmax(0,1fr); gap: 32px; }
  .header-inner { gap: 17px; }
  #main-nav { gap: 17px; }
  .profile-photo { width: 175px; height: 175px; }
  .profile-identity h1 { font-size: 1.75rem; }
  .direction { grid-template-columns: 175px minmax(0,1fr); gap: 15px; }
  .publication-year { grid-template-columns: 40px minmax(0,1fr); column-gap: 12px; }
  .publication-toolbar { flex-wrap: wrap; }
  .search-field { min-width: 190px; }
  .experience-grid { gap: 24px; }
}
@media (max-width: 800px) {
  .header-inner { gap: 15px; }
  .wordmark > span:last-child { display: none; }
  #main-nav { margin-left: 0; flex: 1; justify-content: space-between; gap: 13px; }
  .page-layout { grid-template-columns: minmax(0,1fr); gap: 27px; padding-top: 24px; }
  .profile-sidebar { position: static; display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 11px 20px; align-items: start; }
  .profile-photo { width: 105px; height: 105px; grid-row: 1; }
  .profile-identity h1 { font-size: 1.9rem; margin-top: 0; }
  .chinese-name { display: inline-block; font-size: 1rem; margin-top: 3px; }
  .affiliation { margin-top: 5px; }
  .affiliation strong { display: inline; }
  .affiliation span { display: inline; margin-left: 8px; }
  .profile-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 25px; margin-top: 0; }
  .social-links { max-width: none; margin-top: 0; gap: 5px 17px; }
  .about-section h2,.section-heading h2 { font-size: 1.65rem; }
  .content-section { margin-top: 24px; padding-top: 23px; }
  .publication-toolbar { flex-wrap: nowrap; }
  .search-field { min-width: 100px; }
  .direction { grid-template-columns: 180px minmax(0,1fr); }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 112px; }
  .content-width { width: calc(100% - 32px); }
  .header-inner { display: grid; grid-template-columns: minmax(0,1fr) 32px; gap: 0 12px; padding-top: 8px; }
  .wordmark { grid-column: 1; }
  .wordmark > span:last-child { display: inline; }
  .monogram { width: 29px; height: 29px; font-size: 1.3rem; border-radius: 7px; }
  .theme-toggle { width: 30px; height: 30px; grid-column: 2; grid-row: 1; }
  #main-nav { display: flex; justify-content: start; gap: 21px; grid-column: 1 / -1; grid-row: 2; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
  #main-nav a { padding-block: 11px 9px; font-size: .875rem; }
  .page-layout { padding-top: 21px; gap: 23px; }
  .profile-sidebar { grid-template-columns: 85px minmax(0,1fr); gap: 12px 16px; }
  .profile-photo { width: 85px; height: 85px; }
  .profile-identity h1 { font-size: 1.65rem; }
  .chinese-name { font-size: 1rem; margin-top: 1px; }
  .affiliation { font-size: .875rem; line-height: 1.55; margin-top: 4px; }
  .affiliation strong,.affiliation span { display: block; margin-left: 0; }
  .affiliation span { font-size: .875rem; margin-top: 3px; }
  .profile-links { gap: 6px 20px; }
  .social-links { gap: 5px 17px; }
  .about-text { margin-top: 9px; }
  .about-text p { font-size: 1rem; line-height: 1.65; }
  .research-overview { gap: 3px 14px; }
  .research-overview a { font-size: .875rem; }
  .section-heading { margin-bottom: 12px; gap: 12px; }
  .about-section h2,.section-heading h2 { font-size: 1.55rem; }
  .section-heading > a { font-size: .875rem; }
  .content-section { margin-top: 23px; padding-top: 21px; }
  .news-list li { grid-template-columns: 68px minmax(0,1fr); gap: 9px; }
  .news-list p { font-size: 1rem; }
  .news-list time { font-size: .875rem; }
  .publication-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
  .view-switch { width: fit-content; }
  .view-switch button { padding: 4px 8px; font-size: .875rem; }
  .search-field { grid-column: 1 / -1; grid-row: 2; }
  .year-filter { grid-column: 2; grid-row: 1; }
  .year-filter select { font-size: .875rem; padding-right: 28px; }
  .topic-filters { gap: 2px; }
  .topic-filters button { font-size: .875rem; padding: 4px 7px; }
  .topic-filters button:first-child { margin-left: -7px; }
  .publication-year { grid-template-columns: minmax(0,1fr); gap: 7px; padding-top: 14px; }
  .year-heading { font-size: 1.2rem; }
  .publication { padding-bottom: 13px; }
  .publication + .publication { padding-top: 13px; }
  .publication h4 { font-size: 1rem; line-height: 1.5; }
  .paper-authors { font-size: .875rem; line-height: 1.65; }
  .paper-meta { gap: 5px 12px; }
  .paper-links { gap: 4px 12px; }
  .paper-links > a,.paper-links summary { font-size: .875rem; }
  .paper-links details[open] { flex-basis: 100%; }
  .paper-summary { padding: 9px 10px; }
  .direction { grid-template-columns: minmax(0,1fr); gap: 5px; padding-block: 13px; }
  .direction-works { margin-top: 5px; }
  .project-list { grid-template-columns: minmax(0,1fr); }
  .project { padding-block: 12px; }
  .experience-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .service { border-top: 1px solid var(--line); padding-top: 18px; }
  .service > ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 14px; }
  .site-footer { padding-block: 14px; }
  .site-footer p:nth-child(2) { order: 3; width: 100%; }
}
@media (max-width: 360px) {
  .profile-sidebar { grid-template-columns: 73px minmax(0,1fr); gap: 11px 13px; }
  .profile-photo { width: 73px; height: 73px; }
  .profile-identity h1 { font-size: 1.45rem; }
  .social-links { gap: 5px 15px; }
  .view-switch button { padding-inline: 6px; }
  .year-filter select { padding-left: 7px; padding-right: 25px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root,:root[data-theme='dark'] { --bg:#fff; --ink:#000; --muted:#333; --subtle:#444; --line:#ccc; --accent:#174f42; --surface:#fff; --accent-light:#fff; }
  .site-header,.publication-controls,.publication-status,.site-footer,.paper-links { display: none !important; }
  .content-width { width: 100%; max-width: none; }
  .page-layout { display: block; padding: 0; }
  .profile-sidebar { position: static; display: grid; grid-template-columns: 90px 1fr; gap: 10px 20px; margin-bottom: 20px; }
  .profile-photo { width: 90px; height: 90px; }
  .profile-identity h1 { margin-top: 0; }
  .profile-links { grid-column: 1 / -1; margin-top: 0; }
  .publications-section .publication,.publications-section .publication-year { display: block !important; }
  .publication { break-inside: avoid; padding-top: 10px; }
  .year-heading { margin-bottom: 10px; }
  .content-section { margin-top: 15px; padding-top: 15px; }
}
