@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --purple: #612968;
  --purple-hover: #4d2154;
  --text: #29252c;
  --muted: #625c67;
  --rule: #dfd0e2;
  --body-font: "Source Serif 4", Georgia, "Songti SC", serif;
  --heading-font: "Source Serif 4", Georgia, "Songti SC", serif;
  font-family: var(--body-font);
  color: var(--text);
  font-size: 20px;
  line-height: 1.4;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: #eeeeef; }
::selection { background: #f0e6f2; }
.page {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 12px 50px 24px;
  background: white;
}
main { display: block; }
a { color: var(--purple); text-decoration: none; overflow-wrap: anywhere; }
a:hover { color: var(--purple-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
main p a, main li a, .social-links a, .resource-links a { color: var(--text); }
main p a:hover, main li a:hover, .social-links a:hover, .resource-links a:hover { color: var(--purple); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--purple); line-height: 1.35; }
h1, h2 { font-family: var(--heading-font); font-weight: 600; letter-spacing: -.018em; }
h1 { font-size: 34px; text-wrap: balance; }
h2 {
  font-size: 26px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 5px;
  margin-bottom: 12px;
}
h3 { font-size: 20px; font-weight: 600; line-height: 1.35; }
p + p { margin-top: 8px; }
strong { font-weight: 600; }
ul, ol { padding-left: 25px; margin: 9px 0 0; }
li { padding-left: 2px; margin-bottom: 3px; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10; background: white; padding: 9px 16px; border: 2px solid var(--purple); }
.skip-link:focus { top: 15px; }

/* Keep the navigation as simple as the academic reference. */
.site-header { background: #f5f4f6; }
.main-nav { display: flex; justify-content: center; align-items: center; gap: 0; }
.nav-link { display: block; min-width: 140px; padding: 8px 28px; text-align: center; font-family: var(--heading-font); font-size: 19px; font-weight: 600; color: var(--muted); }
.nav-link[aria-current="page"] { color: var(--purple); }

/* The introduction follows the reference: profile, then Biography. */
.profile-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 60px;
  align-items: stretch;
  padding: 26px 0 0;
}
.profile-info h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
.profile-info h1 > span { white-space: nowrap; }
.name-calligraphy { width: auto; height: 30px; flex: 0 0 auto; }
.profile-role { color: var(--purple); font-size: 21px; font-weight: 600; margin-bottom: 4px; }
.profile-role + p { margin-top: 0; line-height: 1.4; }
.profile-email { margin-top: 12px; }
/* Compensate for the whitespace inside the name and final links' line boxes. */
.portrait { position: relative; min-height: 0; margin: 9px 0 4px; overflow: hidden; border-radius: 8px; }
.portrait picture { position: absolute; inset: 0; display: block; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 10px; }
.social-link { display: inline-flex; line-height: 0; }
.social-link img, .social-link svg { width: 28px; height: 28px; object-fit: contain; }
.social-link svg { fill: var(--purple); }
.section { margin-top: 28px; }
.biography p { text-align: left; }
.experience-entry + .experience-entry, .education-entry + .education-entry, .service-entry + .service-entry { margin-top: 16px; }
.entry-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.entry-heading h3 { color: var(--text); }
.entry-date { font-size: 19px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-role { margin-top: 3px; color: var(--text); }
.education-entry ul { margin-top: 7px; }
.award-list { margin-top: 0; }
.award-list li { margin-bottom: 6px; }

/* Plain publication entries: title, authors, venue, links. */
.page-heading { margin-top: 26px; }
.page-heading h1 { margin-bottom: 12px; }
.publication-group { margin-top: 24px; }
.paper-entry { margin-top: 22px; }
.paper-entry h3 { font-size: 21px; line-height: 1.35; font-weight: 600; }
.paper-entry p { margin-top: 3px; }
.paper-authors { font-size: 19px; line-height: 1.4; }
.paper-authors strong { color: var(--text); }
.paper-venue { font-size: 19px; }
.paper-venue > span { color: var(--text); margin-left: 5px; }
.resource-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 19px; }

/* Blog uses the same typography and layout as the other two pages. */
.blog-entry + .blog-entry { margin-top: 20px; }
.blog-entry h3 { font-size: 22px; line-height: 1.35; }
.blog-entry p { margin-top: 6px; }
.post-meta { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.article-heading { margin-top: 26px; }
.article-heading h1 { margin-bottom: 12px; }
[lang="zh-Hans"] { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", var(--body-font); }
.article-deck { margin-top: 16px; }
.prose { margin-top: 18px; line-height: 1.45; }
.article-heading + .prose { margin-top: 10px; }
.prose li { margin-bottom: 10px; padding-left: 5px; }
.prose .bilingual-list { padding-left: 32px; }
.prose .bilingual-list > li { margin-bottom: 14px; padding-left: 8px; }
.prose .bilingual-list p { margin: 0; }
.prose .bilingual-list p + p { margin-top: 4px; }
.prose .bilingual-list [lang="zh-Hans"] { font-family: "Kaiti SC", "KaiTi", "STKaiti", serif; line-height: 1.5; color: var(--text); }
.prose .bilingual-list [lang="en"] { color: var(--text); }
.prose h2, .prose h3 { margin: 24px 0 12px; }
.prose p { margin: 8px 0; }
.prose pre { background: #f5f5f5; padding: 14px; overflow: auto; font-size: 17px; }
.prose code { font-family: Consolas, "Liberation Mono", monospace; font-size: .9em; overflow-wrap: anywhere; }
.prose blockquote { margin: 18px 0; padding-left: 18px; border-left: 3px solid #c6a8cc; }
.prose figure { margin: 20px 0; }
.prose figcaption { color: var(--text); font-size: 17px; margin-top: 7px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 22px 0; }
.article-back { margin-top: 24px; }
.site-footer { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 18px; color: var(--muted); }
.blog-main + .site-footer { margin-top: 16px; }
.site-footer p > span { margin-inline: 6px; }
.not-found { padding-block: 30px; }
.not-found h1 { margin-bottom: 18px; }

@media (max-width: 1000px) {
  .page { width: calc(100% - 32px); padding-inline: 32px; margin-block: 16px; min-height: calc(100vh - 32px); }
  .profile-header { grid-template-columns: minmax(0, 1fr) 200px; gap: 35px; }
  .entry-heading { flex-wrap: wrap; gap: 3px 16px; }
}

@media (max-width: 660px) {
  :root { font-size: 19px; line-height: 1.4; }
  body { background: white; }
  .page { width: 100%; padding: 12px 22px 22px; margin: 0; min-height: 100vh; }
  .main-nav { justify-content: space-evenly; }
  .nav-link { min-width: 0; flex: 0 1 auto; font-size: 19px; padding: 8px 12px; }
  .profile-header { display: flex; flex-direction: column; gap: 18px; padding-top: 22px; }
  .profile-info h1 { gap: 8px 16px; margin-bottom: 16px; }
  .name-calligraphy { height: 28px; }
  .portrait { width: 170px; margin: 0; aspect-ratio: 1000 / 1150; }
  .profile-role { font-size: 20px; }
  .profile-email { overflow-wrap: anywhere; }
  .social-links { font-size: 19px; gap: 4px 9px; }
  h1 { font-size: 32px; }
  h2 { font-size: 25px; }
  .entry-heading { display: block; }
  .entry-date { display: block; margin-top: 4px; }
  .section { margin-top: 24px; }
  .paper-venue > span { margin-left: 0; }
  .site-footer { font-size: 18px; }
  .article-heading h1 { font-size: 29px; }
  .prose ul, .prose ol { padding-left: 22px; }
}

@media (max-width: 440px) {
  .page { padding-inline: 18px; }
  .profile-header { display: flex; flex-direction: column; gap: 18px; }
  .profile-info { width: 100%; }
  .portrait { width: 155px; }
  .social-links { gap: 4px 9px; }
}

@media print {
  @page { size: A4; margin: 13mm 15mm 14mm; }
  body { background: white; color: #222; font-size: 10pt; line-height: 1.4; }
  .page { width: 100%; min-height: 0; margin: 0; padding: 0; }
  .site-header, .site-footer, .skip-link { display: none !important; }
  a { color: #222; }
  h1, h2, h3 { color: #222; break-after: avoid; }
  .paper-entry, .experience-entry, .education-entry, .prose li { break-inside: avoid; }
  .profile-header { padding-top: 0; }
  .article-heading { margin-top: 0; }
}
