:root {
  color-scheme: light;
  --ink: #26372f;
  --muted: #63736a;
  --green: #347154;
  --green-dark: #234f3b;
  --line: #e0e9e2;
  --pale: #eff5f0;
  --canvas: #fcfefb;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Lingyi CJK", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 85px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 0 0, #eaf4e880, transparent 650px), var(--canvas); font: 17px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
p, h1, h2, h3, h4 { margin-top: 0; }
p { margin-bottom: 12px; text-wrap: pretty; }
h1, h2, h3, h4 { line-height: 1.35; }
strong { font-weight: 650; }
img { max-width: 100%; }

/* A quiet academic layout: one reading column and a compact profile. */
.site-header { position: sticky; top: 0; z-index: 10; background: #f0f7efee; border-top: 3px solid #a9cbb0; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { max-width: 1240px; min-height: 56px; margin: auto; padding: 0 30px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.site-title { color: var(--green-dark); font-size: 17px; font-weight: 650; white-space: nowrap; }
.site-title:hover { color: var(--green); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 25px; }
.site-nav a { display: block; padding: 16px 0 13px; border-bottom: 3px solid transparent; color: #5b7062; font-size: 14px; line-height: 24px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--green-dark); border-bottom-color: #8bb598; text-decoration: none; }
.page-layout { max-width: 1240px; margin: auto; padding: 44px 30px 50px; display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 56px; align-items: start; }
.profile { position: sticky; top: 94px; }
.portrait { width: 182px; height: 182px; margin-bottom: 20px; border: 4px solid #e4eee5; border-radius: 50%; overflow: hidden; background: var(--pale); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile h1 { margin: 0 0 12px; color: var(--green-dark); font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; }
.profile-role, .profile-affiliation { font-size: 14px; line-height: 1.65; }
.profile-role { margin-bottom: 5px; font-weight: 500; }
.profile-affiliation { color: var(--muted); margin-bottom: 0; }
.profile-label { margin: 26px 0 10px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.profile-links { display: grid; gap: 5px; }
.profile-links a { width: fit-content; padding: 3px 0; font-size: 14px; }
.profile-links span { margin-left: 5px; font-size: 12px; color: var(--muted); }
.academic-content { min-width: 0; }
.content-section { margin: 0 0 38px; }
.content-section h2 { position: relative; margin: 0 0 18px; padding-bottom: 10px; color: var(--green-dark); font-size: 23px; font-weight: 650; letter-spacing: -.015em; }
.content-section h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 2px; background: #8eb59a; }
.content-section h3 { font-size: 17px; font-weight: 650; }
.about-section p { line-height: 1.75; }
.about-section p:last-child { margin-bottom: 0; }
.research-fields { display: block; padding-left: 23px; margin: 0; font-size: 16px; line-height: 1.8; list-style: disc; }
.research-fields li { display: list-item; padding-left: 3px; margin: 7px 0; }
.research-fields li::marker { color: var(--green); }
.about-section strong, .research-fields strong { font-weight: 700; color: var(--ink); }
.about-section a { text-decoration: underline; text-decoration-color: #b9cebf; text-decoration-thickness: 1px; }
.about-section a:hover { text-decoration-color: var(--green); }
.about-section p { margin-bottom: 17px; }


/* The same title / authors / venue / summary hierarchy for every paper. */
.publication-group + .publication-group { margin-top: 28px; }
.publication-group > h3 { display: flex; align-items: center; gap: 15px; margin: 0 0 2px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.publication-group > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.publication-item { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: 25px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.publication-item:last-child { padding-bottom: 0; border-bottom: 0; }
.publication-figure { margin: 4px 0 0; min-width: 0; }
.figure-image-link { display: flex; align-items: center; justify-content: center; min-height: 145px; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; transition: border-color .2s ease; }
.figure-image-link:hover { border-color: #87ab92; }
.publication-figure img { display: block; width: 100%; height: auto; max-height: 210px; object-fit: contain; }
.publication-figure figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 7px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.figure-open-link { white-space: nowrap; }
.publication-copy { min-width: 0; }
.publication-copy h4 { margin: 0 0 7px; font-size: 17px; line-height: 1.45; font-weight: 650; letter-spacing: -.012em; }
.publication-copy h4 a { color: inherit; }
.publication-copy h4 a:hover { color: var(--green); }
.publication-copy p { margin: 0 0 7px; font-size: 14px; line-height: 1.65; }
.publication-copy .publication-authors { color: var(--muted); font-size: 13.5px; }
.publication-authors strong { color: var(--green-dark); font-weight: 650; }
.equal-note { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.publication-copy .publication-venue { color: var(--green-dark); font-size: 13px; font-weight: 600; }
.publication-copy .publication-summary { margin: 9px 0; font-size: 14.5px; }
.publication-links { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 9px; font-size: 13px; font-weight: 600; }
.publication-links a { padding: 2px 0; }
.publication-pending { color: var(--muted); font-size: 14px; }

.entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 22px; flex-wrap: wrap; }
.entry-heading h3 { flex: 1 1 300px; margin: 0; font-size: 17px; line-height: 1.5; }
.entry-heading h3 a { color: var(--ink); }
.entry-heading strong { font-weight: 700; }
.entry-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.experience-row { padding: 20px 0; border-bottom: 1px dashed var(--line); }
.experience-row:last-child { border: 0; padding-bottom: 0; }
.experience-row p { margin: 8px 0 0; font-size: 14.5px; }
.experience-row .entry-role { font-size: 14px; color: var(--muted); }
.entry-role strong { color: var(--ink); }
.education-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 20px; padding: 23px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.education-row:last-child { border: 0; padding-bottom: 0; }
.institution-logo { width: 76px; height: 76px; padding: 7px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 3px 12px #234f3b06; }
.institution-logo > img { width: 60px; height: 60px; object-fit: contain; }
.logo-crop { display: block; overflow: hidden; flex-shrink: 0; }
.logo-crop img { display: block; max-width: none; }
.logo-crop--shude { width: 59px; height: 60px; }
.logo-crop--shude img { width: auto; height: 60px; transform: translateX(-12px); }
.logo-crop--hkust { width: 41px; height: 60px; }
.logo-crop--hkust img { width: 187px; height: 60px; }
.education-copy { min-width: 0; }
.education-copy p { margin: 6px 0 0; font-size: 14px; }
.education-copy .institution-detail { color: var(--muted); }
.entry-bottom { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.entry-bottom span { font-size: 13px; color: var(--muted); }
.education-mentor { color: var(--muted); }
.education-mentor a { color: var(--ink); }
.honors-section ul { padding: 0; margin: 0; list-style: none; }
.honors-section li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 8px 0; font-size: 17px; line-height: 1.6; }
.honors-section li strong { font-weight: 600; }
.honors-section li span { color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Life stays in the homepage flow, with the same typographic scale. */
.life-section { border-top: 1px solid var(--line); padding-top: 30px; }
.life-intro { font-size: 16px; }
.life-subheading { margin: 23px 0 0; color: var(--green-dark); font-size: 17px; }
.practice-item { position: relative; display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: 25px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.practice-item:last-child { padding-bottom: 0; border-bottom: 0; }
.practice-number { position: absolute; z-index: 1; top: 33px; left: 9px; padding: 1px 7px; color: #fff; background: #234f3be6; border-radius: 3px; font-size: 11px; font-weight: 650; letter-spacing: .04em; }
.practice-visual { margin: 0; min-width: 0; }
.practice-visual a { display: block; overflow: hidden; border-radius: 6px; background: var(--pale); }
.practice-visual img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .2s ease; }
.practice-visual a:hover img { transform: scale(1.025); }
.practice-visual figcaption { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.practice-copy { min-width: 0; }
.practice-copy h3, .practice-copy h4 { margin: 0 0 6px; font-size: 17px; font-weight: 650; line-height: 1.4; }
.practice-item p { margin: 0 0 8px; font-size: 14px; line-height: 1.65; }
.practice-item .practice-original { margin-bottom: 8px; font: 400 12.5px/1.7 "Lingyi CJK", var(--font); color: var(--muted); overflow-wrap: anywhere; }
.practice-item .practice-award { color: var(--green-dark); font-size: 12.5px; font-weight: 600; }
.practice-copy > a { font-size: 13px; font-weight: 600; }
.life-moments { margin-top: 33px; padding-top: 24px; border-top: 1px solid var(--line); }
.life-moments .life-subheading { margin: 0 0 9px; }
.gallery-intro { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px 16px; }
.gallery-item { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.gallery-item img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; transition: transform .2s ease; }
.gallery-item:hover img { transform: translateY(-2px); }
.gallery-item span { display: block; margin-top: 7px; font-size: 13px; color: var(--muted); }
.gallery-item:hover span { color: var(--green); text-decoration: underline; }
.life-more { margin: 22px 0 0; font-size: 14px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 12px; color: var(--muted); }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 9px 12px; background: #fff; color: var(--green-dark); transform: translateY(-160%); z-index: 30; }
.skip-link:focus { transform: none; }
#photo-dialog { border: 0; border-radius: 8px; padding: 22px; width: min(900px, calc(100vw - 28px)); max-height: 90vh; background: #fff; color: var(--ink); }
#photo-dialog::backdrop { background: #17251acc; }
#photo-dialog img { max-width: 100%; max-height: 64vh; display: block; object-fit: contain; margin: auto; }
#photo-description { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 15px; }
.dialog-header button { border: 0; background: transparent; font-size: 26px; cursor: pointer; color: var(--ink); }
.dialog-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; font-size: 13px; margin-top: 14px; }
.dialog-footer button { border: 0; background: transparent; color: var(--green); padding: 5px 0; cursor: pointer; font: inherit; }
.dialog-footer button:disabled { opacity: .35; cursor: default; }

@media (max-width: 1050px) {
  .page-layout { grid-template-columns: 195px minmax(0, 1fr); gap: 35px; }
  .portrait { width: 164px; height: 164px; }
  .publication-item, .practice-item { grid-template-columns: minmax(0, 30%) minmax(0, 1fr); gap: 20px; }
  .figure-image-link { min-height: 110px; }
  .research-fields { column-gap: 20px; }
}
@media (max-width: 820px) {
  .page-layout { display: block; padding: 30px 26px 40px; }
  .profile { position: static; display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 26px; margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .portrait { grid-column: 1; grid-row: 1 / span 4; width: 132px; height: 132px; margin: 0; }
  .profile h1 { grid-column: 2; font-size: 27px; margin: 0 0 7px; }
  .profile-role, .profile-affiliation { grid-column: 2; margin-bottom: 4px; }
  .profile-label { display: none; }
  .profile-links { grid-column: 2; display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 0; margin-top: 5px; }
  .header-inner { padding: 0 26px; }
  .site-nav { gap: 18px; }
  .publication-item, .practice-item { grid-template-columns: minmax(0, 32%) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 112px; }
  body { font-size: 16px; }
  .header-inner { display: block; padding: 10px 20px 0; }
  .site-title { display: block; font-size: 16px; }
  .site-nav { width: 100%; overflow-x: auto; gap: 20px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 12px; padding: 8px 0 9px; }
  .page-layout { padding: 27px 20px 35px; }
  .profile { grid-template-columns: 88px minmax(0, 1fr); column-gap: 18px; margin-bottom: 28px; padding-bottom: 24px; }
  .portrait { width: 88px; height: 88px; border-width: 3px; }
  .profile h1 { font-size: 25px; }
  .profile-role, .profile-affiliation { font-size: 12px; }
  .profile-links { grid-column: 1 / -1; margin-top: 12px; gap: 16px; }
  .profile-links a { font-size: 13px; }
  .content-section { margin-bottom: 32px; }
  .content-section h2 { font-size: 22px; margin-bottom: 15px; }
  .research-fields { display: block; font-size: 15px; }
  .education-row { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
  .institution-logo { width: 58px; height: 64px; padding: 4px; }
  .institution-logo > img { width: 48px; height: 48px; }
  .logo-crop--shude { width: 47px; height: 48px; }
  .logo-crop--shude img { height: 48px; transform: translateX(-10px); }
  .logo-crop--hkust { width: 33px; height: 48px; }
  .logo-crop--hkust img { width: auto; height: 48px; }
  .entry-heading h3 { font-size: 16px; }
  .publication-item, .practice-item { grid-template-columns: minmax(0, 1fr); gap: 15px; padding: 20px 0; }
  .publication-figure { margin-top: 0; }
  .figure-image-link { min-height: 0; padding: 12px; }
  .publication-figure img { max-height: 200px; }
  .publication-copy h4 { font-size: 17px; }
  .publication-copy .publication-summary { font-size: 14px; }
  .publication-links { gap: 8px 20px; }
  .publication-links a, .practice-copy > a { padding: 5px 0; }
  .career-row { column-gap: 12px; }
  .career-institution { grid-column: 1 / -1; font-size: 14px; }
  .career-years { grid-row: 1; font-size: 12px; }
  .career-row h3 { font-size: 14px; }
  .honors-section li { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; font-size: 16px; }
  .honors-section li span { font-size: 13px; }
  .practice-number { top: 29px; }
  .practice-visual img { max-height: 260px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .gallery-item span { font-size: 12px; }
  .site-footer { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .site-header, .skip-link { display: none; }
  .page-layout { display: block; padding: 0; }
  .profile { position: static; margin-bottom: 24px; }
  .publication-item, .practice-item { break-inside: avoid; }
}
