@font-face {
  font-family: "Outfit";
  src: url("/assets/type/outfit-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --text: #252b33;
  --secondary: #4c5562;
  --muted: #697586;
  --accent: #245da7;
  --accent-hover: #a76324;
  --line: #e5eaf0;
  --soft: #f5f8fc;
  --highlight: #f0f6fe;
  --serif: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.figure-open { overflow: hidden; }
::selection { background: #deebfa; }
a { color: var(--accent); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
img { display: block; max-width: 100%; }
figure, p { margin: 0; }
button { font: inherit; }
strong { font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: -80px;
  left: 16px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  background: #fff;
}
.skip-link:focus { top: 12px; }
.page-shell { width: min(940px, calc(100% - 360px)); margin: 0 auto; }
.page-section { margin-top: 48px; scroll-margin-top: 40px; }

/* A quiet index on desktop; a compact horizontal index on smaller screens. */
.section-nav {
  position: fixed;
  top: 50%;
  left: max(24px, calc(50% - 656px));
  width: 132px;
  transform: translateY(-50%);
  z-index: 10;
  font-family: var(--serif);
}
.section-nav__label {
  display: inline-block;
  margin: 0 0 15px 16px;
  color: var(--secondary);
  font-size: 17px;
}
.section-nav__track { border-left: 1px solid var(--line); }
.section-nav__link {
  display: block;
  min-height: 42px;
  margin-left: -1px;
  padding: 9px 8px 9px 16px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
}
.section-nav__link[aria-current="location"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Profile */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 28px 48px;
  align-items: center;
  margin-top: 64px;
}
h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.name-divider { color: #a4adba; font-size: 26px; }
.chinese-name { font-family: "Kaiti SC", "STKaiti", "KaiTi", var(--serif); font-size: 37px; letter-spacing: .04em; }
.profile__status { color: var(--secondary); font-size: 15px; margin-bottom: 20px; }
.profile__content > p + p { margin-top: 12px; }
.profile__portrait { width: 100%; }
.profile__portrait img { width: 100%; height: auto; border-radius: 36px; }
.profile__portrait figcaption { margin-top: 11px; text-align: center; font-size: 13px; color: var(--muted); }
.profile-links, .resource-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.profile-links { margin-top: 21px; }
.profile-links a, .resource-links a { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; }
.profile-details { margin-top: 14px; }
.profile-details summary, .news-archive summary {
  width: fit-content;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}
.profile-details summary:hover, .news-archive summary:hover { color: var(--accent-hover); }
.profile-details p { margin-top: 12px; padding: 0 0 0 14px; border-left: 2px solid #dae6f4; color: var(--secondary); font-size: 15px; line-height: 1.9; }
.current-research { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--line); }
.current-research__label { margin: 0 0 7px; color: var(--accent); font-size: 15px; font-weight: 500; line-height: 1.5; }
.current-research__title { margin: 0 0 9px; font-size: 19px; font-weight: 600; line-height: 1.45; }
.current-research p { color: var(--secondary); font-size: 16px; line-height: 1.7; }

/* Shared section rhythm */
.section-title {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 400;
  line-height: 1.25;
}
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 4px; }
.section-heading .section-title { margin-bottom: 0; }
.section-heading__link { font-size: 14px; }
.research-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; }
.research-toggle { padding: 3px 0; border: 0; border-bottom: 1px solid #b9cce7; background: transparent; color: var(--accent); font-size: 15px; line-height: 1.6; cursor: pointer; }
.research-toggle:hover { color: var(--accent-hover); }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 83px minmax(0, 1fr); gap: 18px; margin-top: 10px; font-size: 16px; line-height: 1.65; }
.news-list li:first-child { margin-top: 0; }
.news-date { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.news-list__latest .news-date { color: var(--accent); font-weight: 500; }
.news-archive { margin-top: 12px; }
.news-archive .news-list { margin-top: 12px; }

/* Publications and projects share one Research list and image layout. */
.paper-row {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 24px 18px;
  margin: 14px -18px;
  border-radius: 4px;
}
.paper-row:last-child { margin-bottom: 0; }
.paper-row[data-highlight="true"] { background: var(--highlight); }
.paper-row[id] { scroll-margin-top: 100px; }
.paper-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: zoom-in;
  transition: border-color 160ms ease;
}
.paper-figure:hover { border-color: #9db9dd; }
.paper-figure img { width: 100%; height: 100%; object-fit: contain; }
.paper-figure__zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  color: #5d7290;
  background: #ffffffed;
}
.paper-figure__zoom .icon { width: 14px; height: 14px; }
.paper-title {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}
.authors { color: var(--secondary); font-size: 15px; line-height: 1.6; }
.author-self { color: var(--text); font-weight: 600; }
.paper-venue { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 7px; font-size: 15px; font-style: italic; line-height: 1.5; }
.paper-type { padding: 1px 7px; border: 1px solid #dee6ef; border-radius: 3px; background: var(--soft); color: var(--secondary); font-size: 12px; font-style: normal; font-weight: 500; line-height: 1.6; }
.paper-description { margin-top: 9px; color: var(--secondary); font-size: 16px; line-height: 1.6; }
.resource-links { margin-top: 12px; gap: 8px 22px; }
.resource-links .icon { width: 17px; height: 17px; }

/* Project metadata follows the same typography as publication authors. */
.project-meta { color: var(--secondary); font-size: 15px; line-height: 1.6; }
.project-meta span[aria-hidden] { margin: 0 5px; }
.project-note { margin-top: 9px; font-size: 14px; color: var(--muted); }

/* Reference-style education rows: emblem, institution details, and dates. */
.education-entry { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 15px 0; }
.education-entry:first-child { padding-top: 0; }
.education-entry:last-child { padding-bottom: 0; }
.education-logo { display: flex; align-items: center; justify-content: center; width: 108px; min-height: 96px; }
.education-logo img { width: 72px; height: 72px; max-width: none; object-fit: contain; }
/* The official Tsinghua artwork has wide blank margins; the emblem is intact. */
.education-logo--tsinghua img { width: 96px; height: 96px; object-fit: cover; object-position: 49% 50%; }
.education-entry h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 4px; font-size: 18px; font-weight: 600; line-height: 1.5; }
.education-entry h3 a { color: var(--text); }
.education-entry h3 a:hover { color: var(--accent); }
.education-dates { color: var(--secondary); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.education-dates span { display: block; color: var(--muted); font-size: 14px; }
.education-degree { color: var(--secondary); font-size: 16px; line-height: 1.6; }
.education-status { display: inline-block; padding: 1px 7px; border: 1px solid #d6e4f4; border-radius: 3px; color: var(--accent); background: var(--soft); font-size: 12px; font-weight: 500; }
.education-details { margin-top: 3px; color: var(--secondary); font-size: 15px; line-height: 1.6; }

.honors-grid { display: grid; grid-template-columns: 1fr 1.45fr; gap: 36px; }
.honors-group h3 { margin: 0 0 11px; font-size: 16px; font-weight: 500; color: var(--secondary); }
.honors-list { margin: 0; padding-left: 17px; font-size: 15px; line-height: 1.65; }
.honors-list li { padding-left: 2px; margin-top: 7px; }
.honors-list li::marker { color: #a2adba; }
.honors-list span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.honors-list span::before { content: " · "; }
.site-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 44px; padding: 23px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer a { display: grid; place-items: center; width: 44px; height: 44px; color: var(--secondary); }

/* A native, keyboard-accessible lightbox with links to image sources. */
.figure-dialog {
  width: min(1160px, calc(100% - 36px));
  max-height: calc(100dvh - 40px);
  padding: 48px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
}
.figure-dialog::backdrop { background: #142334b3; }
.figure-dialog figure img { width: 100%; max-height: calc(100dvh - 200px); object-fit: contain; }
.figure-dialog figcaption { margin-top: 19px; text-align: center; color: var(--secondary); font-size: 15px; line-height: 1.5; }
.figure-source { display: block; margin: 9px auto 0; width: fit-content; text-align: center; font-size: 14px; }
.dialog-close { position: absolute; right: 7px; top: 4px; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--secondary); font-size: 30px; cursor: pointer; }

@media (max-width: 1170px) {
  .page-shell { width: min(940px, calc(100% - 64px)); }
  .section-nav { position: sticky; top: 0; left: auto; width: 100%; transform: none; border-bottom: 1px solid var(--line); background: #fff; }
  .section-nav__inner { display: flex; align-items: center; gap: 24px; max-width: 1004px; margin: 0 auto; padding: 0 32px; }
  .section-nav__label { margin: 0; font-size: 16px; }
  .section-nav__track { display: flex; min-width: 0; overflow-x: auto; border: 0; scrollbar-width: none; }
  .section-nav__track::-webkit-scrollbar { display: none; }
  .section-nav__link { flex: 0 0 auto; margin: 0; padding: 12px 13px 10px; border-left: 0; border-bottom: 2px solid transparent; font-size: 15px; white-space: nowrap; }
  .page-section { scroll-margin-top: 84px; }
  .profile { margin-top: 42px; }
}
@media (max-width: 850px) {
  .profile { grid-template-columns: minmax(0, 1fr) 196px; gap: 28px; }
  h1 { font-size: 38px; gap: 9px; }
  .chinese-name { font-size: 32px; }
  .profile__portrait img { border-radius: 28px; }
  .paper-row { grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
  .education-entry { grid-template-columns: 88px minmax(0, 1fr); gap: 5px 20px; }
  .education-logo { width: 88px; grid-row: span 2; }
  .education-dates { grid-column: 2; text-align: left; }
  .education-dates span { display: inline; margin-left: 8px; }
  .honors-grid { grid-template-columns: 1fr; gap: 25px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .page-shell { width: calc(100% - 36px); }
  .section-nav__inner { padding: 0 12px; }
  .section-nav__label { display: none; }
  .section-nav__track { width: 100%; justify-content: space-between; }
  .section-nav__link { font-size: 14px; padding: 11px 8px 9px; }
  .profile { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 28px; }
  .profile__portrait { order: -1; width: 174px; align-self: center; margin-bottom: 23px; }
  .profile__portrait img { border-radius: 26px; }
  .profile__portrait figcaption { display: none; }
  h1 { justify-content: center; font-size: 36px; gap: 10px; margin-bottom: 10px; }
  .name-divider { font-size: 23px; }
  .chinese-name { font-size: 31px; }
  .profile__status { text-align: center; font-size: 14px; margin-bottom: 21px; }
  .profile-links { gap: 10px 20px; }
  .current-research { margin-top: 24px; padding-top: 20px; }
  .current-research__title { font-size: 18px; }
  .current-research p { font-size: 15.5px; }
  .page-section { margin-top: 38px; scroll-margin-top: 78px; }
  .profile { margin-top: 28px; }
  .section-title { font-size: 28px; margin-bottom: 18px; }
  .section-heading { gap: 8px 18px; }
  .section-heading__link { font-size: 13px; }
  .news-list li { grid-template-columns: 71px minmax(0, 1fr); gap: 11px; font-size: 15px; margin-top: 11px; }
  .news-date { font-size: 14px; }
  .research-controls { gap: 10px 22px; }
  .research-toggle { font-size: 14px; }
  .paper-row { grid-template-columns: 1fr; gap: 17px; margin: 14px -10px; padding: 22px 10px; }
  .paper-figure { max-width: 360px; margin: 0 auto; max-height: 215px; }
  .paper-title { font-size: 18px; }
  .paper-description { font-size: 15.5px; }
  .education-entry { grid-template-columns: 66px minmax(0, 1fr); gap: 5px 15px; padding: 16px 0; }
  .education-logo { width: 66px; min-height: 72px; }
  .education-logo img { width: 54px; height: 54px; }
  .education-logo--tsinghua img { width: 72px; height: 72px; }
  .education-entry h3 { font-size: 17px; }
  .education-degree { font-size: 15.5px; }
  .education-dates { white-space: normal; }
  .honors-list { font-size: 15px; }
  .figure-dialog { padding: 46px 12px 18px; }
  .figure-dialog figure img { max-height: calc(100dvh - 250px); }
}
@media (max-width: 360px) {
  h1 { font-size: 32px; gap: 8px; }
  .chinese-name { font-size: 28px; }
  .section-nav__link { padding-left: 5px; padding-right: 5px; font-size: 13px; }
  .profile-links { gap: 8px 16px; }
  .profile-links a { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .section-nav, .skip-link, .figure-dialog, .paper-figure__zoom, .research-toggle, .site-footer a { display: none !important; }
  body { font-size: 11pt; }
  .page-shell { width: 100%; }
  .profile { display: grid; grid-template-columns: minmax(0, 1fr) 150px; margin-top: 0; gap: 28px; }
  .profile__portrait { order: initial; width: auto; }
  .profile__status, h1 { text-align: left; justify-content: start; }
  .page-section { margin-top: 28px; }
  .paper-row, .paper-row[hidden] { display: grid !important; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; background: transparent; }
  .paper-row, .education-entry, .honors-group { break-inside: avoid; }
  .paper-figure { aspect-ratio: auto; padding: 0; border: 0; }
  a { color: inherit; }
}
