/* Colors and page dimensions can be customized here. */
:root {
  --ink: #343b43;
  --heading: #242d38;
  --muted: #65717e;
  --blue: #244f88;
  --blue-hover: #163963;
  --line: #e7ebef;
  --soft: #f5f8fc;
  --page-width: 1220px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: #fff; color: var(--ink); font: 16px/1.75 "Trebuchet MS", Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid #6793c8; outline-offset: 5px; border-radius: 2px; }
button { font: inherit; }
img { display: block; max-width: 100%; }
strong { font-weight: 700; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
::selection { background: #dce8f6; color: #173253; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 10px 16px; background: #fff; border: 2px solid var(--blue); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* Shared masthead and section navigation. */
.masthead { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.masthead-inner { max-width: var(--page-width); min-height: var(--header-height); margin: 0 auto; display: flex; align-items: center; gap: 38px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--heading); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #d7e1ee; border-radius: 5px; color: var(--blue); background: var(--soft); font-size: 12px; letter-spacing: -.4px; }
.site-nav { display: flex; align-items: center; gap: 28px; flex: 1; }
.site-nav a { position: relative; display: flex; align-items: center; min-height: var(--header-height); color: #59636f; font-size: 14px; white-space: nowrap; }
.site-nav a::after { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; content: ""; background: var(--blue); transform: scaleX(0); transition: transform .18s ease; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--blue); text-decoration: none; }
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }
.header-cv { margin-left: auto; font-size: 14px; font-weight: 700; white-space: nowrap; }
.header-cv span { margin-left: 6px; }
.menu-toggle { display: none; }

/* Sticky author profile, in the same spirit as AcadHomepage. */
.page-layout { max-width: var(--page-width); margin: 0 auto; padding: 42px 24px 0; display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 62px; align-items: start; }
.sidebar { position: sticky; top: 110px; }
.portrait-link { display: block; width: fit-content; border-radius: 50%; }
.portrait { width: 174px; height: 174px; padding: 5px; border: 1px solid #e0e5eb; border-radius: 50%; object-fit: cover; }
.profile h1 { font-size: 27px; line-height: 1.3; letter-spacing: -.6px; margin: 22px 0 9px; color: var(--heading); }
.profile-role { margin: 0; font-size: 15px; }
.profile-school { margin: 0; font-size: 15px; font-weight: 700; }
.profile-school a, a.tsinghua { color: #70427e; }
.profile-group { margin: 3px 0 0; font-size: 12px; }
.profile-group a { color: var(--muted); }
.profile-focus { font-size: 14px; line-height: 1.65; margin: 20px 0 18px; padding-left: 14px; list-style: disc; color: #576473; }
.profile-focus li::marker { font-size: 10px; }
.social-links { margin: 0; padding: 0; list-style: none; }
.social-links a { width: fit-content; min-height: 33px; display: flex; align-items: center; gap: 11px; color: #454e58; font-size: 14px; }
.social-links a:hover { color: var(--blue); }
.social-links svg { width: 16px; height: 16px; color: #66788d; }
.profile-note { border-top: 1px solid var(--line); padding-top: 16px; margin: 19px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 200px; }

/* Main academic content. */
main { min-width: 0; }
main:focus { outline: none; }
.section { margin: 0 0 46px; }
.section h2 { color: var(--heading); font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -.45px; margin: 0 0 24px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-icon { display: inline-block; width: 25px; height: 25px; color: var(--blue); stroke-width: 1.65; margin-right: 7px; vertical-align: -3px; }
.about p { margin: 0 0 15px; }
.about > p { text-wrap: pretty; }
.about h2 { margin-bottom: 22px; }
.opportunity-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 17px; margin-top: 21px; border-left: 3px solid #c47e65; background: #fcf8f5; color: #874c3a; border-radius: 0 4px 4px 0; font-size: 14px; line-height: 1.75; }
.opportunity-note > svg { margin-top: 4px; width: 17px; height: 17px; }
.opportunity-note p { margin: 0; }
.opportunity-note a { color: inherit; text-decoration: underline; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.section-heading h2 { border: 0; margin: 0; }
.contribution-note { color: var(--muted); font-size: 12px; font-style: italic; white-space: nowrap; }
.subsection-heading { font-size: 20px; font-weight: 700; color: var(--heading); margin: 32px 0 27px; padding-bottom: 10px; border-bottom: 1px solid var(--line); letter-spacing: -.2px; }

/* Paper figures keep their complete aspect ratio; click to open the original. */
.paper { display: grid; grid-template-columns: 235px minmax(0, 1fr); align-items: center; gap: 25px; margin: 0 0 30px; }
.paper-image { display: flex; align-items: center; justify-content: center; position: relative; height: 166px; padding: 30px 8px 9px; border: 1px solid #e0e5eb; border-radius: 5px; box-shadow: 0 2px 7px rgba(29,50,77,.045); background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.paper-image:hover { border-color: #a5bad3; box-shadow: 0 3px 10px rgba(29,50,77,.09); }
.paper-image img { width: 100%; height: 100%; object-fit: contain; }
.venue-badge { position: absolute; top: -1px; left: -1px; border-radius: 5px 0 4px 0; padding: 2px 10px; background: var(--blue); color: #fff; font-size: 11px; line-height: 1.8; font-weight: 700; letter-spacing: .15px; }
.manuscript-badge { background: #66778d; }
.report-badge { background: #6b5f91; }
.paper-content h3, .paper-content h4 { margin: 0 0 7px; font-size: 16px; line-height: 1.5; font-weight: 700; color: var(--heading); }
.paper-content p { margin: 0 0 5px; }
.authors { color: #58616c; font-size: 13px; line-height: 1.65; }
.authors strong { color: #303b48; text-decoration: underline; text-decoration-color: #b4becb; text-underline-offset: 3px; }
.venue { font-size: 13px; color: #495b72; font-style: italic; }
.venue-detail { color: var(--muted); }
.paper-links { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 6px; }
.paper-links a { font-size: 13px; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; min-height: 28px; }
.paper-links a span { font-size: 12px; color: #7389a5; }
.coming-soon { color: var(--muted); font-size: 12px; font-style: italic; padding-top: 3px; }
.paper-compact { display: block; padding-left: 17px; border-left: 2px solid var(--line); margin-bottom: 24px; }
.paper-compact .paper-content h4 { font-size: 15px; }
.paper-compact .venue { margin-bottom: 0; }

/* Education and experience. */
.institution { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 21px; margin-bottom: 30px; }
.institution-logo { width: 64px; height: 64px; object-fit: contain; margin: 3px auto 0; }
.microsoft-logo { width: 72px; height: 52px; margin-top: 7px; }
.institution-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.institution h3 { color: var(--heading); font-size: 17px; line-height: 1.5; margin: 0; }
.dates { color: var(--muted); font-size: 12px; white-space: nowrap; }
.degree { margin: 2px 0 5px; font-size: 14px; font-style: italic; }
.institution ul { padding-left: 18px; margin: 6px 0 0; font-size: 14px; line-height: 1.8; }
.institution li { padding-left: 2px; }
.institution li::marker { color: #93a2b4; }
.awards-list { list-style: none; margin: 0; padding: 0; }
.awards-list li { display: flex; justify-content: space-between; gap: 22px; padding: 11px 0 11px 17px; position: relative; font-size: 14px; border-bottom: 1px solid #f0f2f4; }
.awards-list li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #8398b3; position: absolute; left: 0; top: 23px; }
.awards-list li:last-child { border-bottom: 0; }
.award-year { color: var(--muted); white-space: nowrap; font-size: 12px; padding-top: 2px; }
.site-footer { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 22px 0 30px; font-size: 11px; color: var(--muted); }
.site-footer a { color: inherit; }
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #dbe3ed; background: #fff; border-radius: 5px; color: var(--blue); box-shadow: 0 2px 8px #243b5310; font-size: 20px; z-index: 10; }
.back-to-top:hover { background: var(--soft); text-decoration: none; }

@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 195px minmax(0, 1fr); gap: 35px; }
  .masthead-inner { gap: 28px; }
  .site-nav { gap: 23px; }
  .paper { grid-template-columns: 205px minmax(0, 1fr); gap: 21px; }
  .paper-image { height: 158px; }
}

@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .masthead-inner { gap: 24px; }
  .site-nav { gap: 17px; }
  .site-nav a { font-size: 13px; }
  .brand { font-size: 15px; }
  .brand-mark { display: none; }
  .page-layout { display: block; max-width: 820px; padding-top: 30px; }
  .sidebar { position: static; margin-bottom: 35px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .profile { display: flex; align-items: center; gap: 26px; }
  .portrait { width: 140px; height: 140px; }
  .portrait-link { flex-shrink: 0; }
  .profile h1 { margin: 0 0 6px; font-size: 26px; }
  .profile-focus, .profile-note, .profile-group { display: none; }
  .social-links { display: flex; flex-wrap: wrap; gap: 4px 19px; margin-top: 10px; }
  .social-links a { font-size: 13px; gap: 6px; }
  .paper { grid-template-columns: 225px minmax(0, 1fr); }
  .paper-image { height: 166px; }
  .section { margin-bottom: 40px; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 85px; }
  .masthead-inner { min-height: 60px; padding: 0 20px; gap: 17px; flex-wrap: wrap; }
  .brand { min-height: 60px; font-size: 16px; }
  .brand-mark { display: grid; width: 28px; height: 28px; }
  .header-cv { margin-left: 0; }
  .menu-toggle { margin-left: auto; padding: 9px 0 9px 8px; background: none; border: 0; color: var(--ink); font-size: 13px; cursor: pointer; }
  .js .menu-toggle { display: flex; align-items: center; gap: 6px; }
  .menu-toggle svg { width: 17px; }
  .site-nav { order: 3; width: 100%; flex: 0 0 100%; flex-wrap: wrap; gap: 0 20px; padding: 0 0 12px; }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav a { min-height: 40px; font-size: 14px; }
  .page-layout { padding: 26px 20px 0; }
  .profile { gap: 19px; align-items: flex-start; }
  .portrait { width: 105px; height: 105px; padding: 4px; }
  .profile h1 { font-size: 24px; margin-bottom: 4px; }
  .profile-role, .profile-school { font-size: 13px; line-height: 1.6; }
  .social-links { column-gap: 13px; row-gap: 0; margin-top: 8px; }
  .social-links a { font-size: 12px; min-height: 32px; gap: 5px; }
  .social-links svg { width: 13px; height: 13px; }
  .sidebar { margin-bottom: 29px; padding-bottom: 25px; }
  body { font-size: 15px; line-height: 1.8; }
  .section h2 { font-size: 23px; padding-bottom: 11px; margin-bottom: 20px; }
  .section-icon { width: 23px; height: 23px; margin-right: 4px; }
  .about p { margin-bottom: 14px; }
  .opportunity-note { font-size: 13px; padding: 12px; gap: 9px; }
  .opportunity-note p { margin-bottom: 0; }
  .section-heading { flex-wrap: wrap; gap: 0; margin-bottom: 24px; }
  .section-heading h2 { margin-bottom: 0; }
  .contribution-note { margin-left: auto; font-size: 11px; padding-bottom: 12px; }
  .paper { grid-template-columns: 1fr; gap: 15px; margin-bottom: 30px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
  .paper-image { max-width: 380px; width: 100%; height: 205px; }
  .paper-content h3, .paper-content h4 { font-size: 16px; line-height: 1.6; }
  .authors { font-size: 13px; }
  .paper-links { margin-top: 5px; gap: 20px; }
  .paper-links a { min-height: 34px; }
  .subsection-heading { font-size: 19px; margin-top: 28px; }
  .paper-compact { padding-bottom: 0; border-bottom: 0; padding-left: 14px; }
  .institution { grid-template-columns: 46px minmax(0, 1fr); gap: 14px; margin-bottom: 26px; }
  .institution-logo { width: 44px; height: 44px; }
  .microsoft-logo { height: 35px; }
  .institution-heading { display: block; }
  .institution h3 { font-size: 16px; }
  .dates { font-size: 12px; }
  .degree, .institution ul { font-size: 13px; }
  .degree { margin-top: 3px; }
  .awards-list li { flex-direction: column; gap: 3px; padding-top: 12px; padding-bottom: 12px; font-size: 13px; }
  .award-year { padding: 0; font-size: 11px; }
  .site-footer { display: block; font-size: 10px; }
  .site-footer span { display: block; margin-bottom: 4px; }
  .back-to-top { right: 14px; bottom: 14px; width: 36px; height: 36px; }
}

@media (max-width: 360px) {
  .page-layout { padding-left: 16px; padding-right: 16px; }
  .portrait { width: 82px; height: 82px; }
  .profile { gap: 15px; }
  .profile h1 { font-size: 22px; }
  .social-links { gap: 0 10px; }
  .contribution-note { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .masthead, .skip-link, .back-to-top, .profile-note { display: none !important; }
  .page-layout { display: block; padding: 0; }
  .sidebar { position: static; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
  .profile { display: flex; gap: 24px; align-items: center; }
  .portrait { width: 110px; height: 110px; }
  .profile h1 { margin-top: 0; }
  .profile-focus, .profile-group { display: none; }
  .social-links { display: flex; flex-wrap: wrap; gap: 15px; }
  body { font-size: 11pt; }
  .section { margin-bottom: 26px; }
  .paper, .institution, .awards-list li { break-inside: avoid; }
  .paper-image { box-shadow: none; }
  .venue-badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { color: inherit; }
}
