@font-face { font-family: Lora; src: url('/assets/lora.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Iansui; src: url('/assets/iansui.ttf') format('truetype'); font-display: swap; }
:root {
  color-scheme: light dark;
  --page: light-dark(white, #191a1d);
  --ink: light-dark(black, #eeeae4);
  --note: light-dark(#212121, #dedbd6);
  --chrome: light-dark(#333, #e4e1dd);
  --subtle: light-dark(#5c5c5c, #c7c4bf);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Georgia, 'Times New Roman', serif; }
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: transparent; }
h1, h2, p { margin: 0; font-weight: 400; }
:focus-visible { outline: 2px solid #508cf0; outline-offset: 3px; }
.skip { position: fixed; top: -4rem; left: .5rem; z-index: 9; padding: .5rem; background: var(--page); }
.skip:focus { top: .5rem; }
.site-bar { height: 56px; padding: 0 5px 0 28px; display: flex; align-items: center; position: fixed; inset: 0 0 auto; z-index: 3; color: var(--chrome); font-family: Lora, Georgia, serif; }
body[data-page="teaching"] .site-bar { color: white; }
body[data-page="research"] .site-bar { color: #333; }
.site-bar.scrolled, body[data-page] .site-bar.scrolled { background: var(--page); color: var(--chrome); box-shadow: 0 1px 3px #0002; }
.site-bar a { text-decoration: none; }
.brand { font-size: 20px; white-space: nowrap; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; padding: 0 13px; }
.desktop-nav a { color: inherit; opacity: .8; }
.desktop-nav a:hover, .desktop-nav a[aria-current], .drawer a:hover { opacity: 1; }
.icon { display: grid; place-items: center; width: 40px; height: 44px; padding: 0; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.menu-button { display: none; }
.layout { max-width: 1280px; margin: auto; padding-inline: 48px; }
.home { padding-block: 80px 70px; }
.home-row { display: flex; }
.portrait-col { width: 41.666667%; padding: 0 1.25%; }
.portrait { display: block; width: 100%; height: auto; }
.bio { width: 58.333333%; padding: 14px calc(1.25% + 8px) 0; }
.bio h1 { font-size: 40px; line-height: 54.4px; margin-bottom: 28px; }
.chinese { font-family: Iansui, serif; }
.bio p { font-size: 14pt; line-height: 1.6667; }
.bio .welcome { margin-bottom: 12.67px; }
.bio .intro { margin-bottom: 21.5px; }
.bio .interests, .bio .contact { line-height: 1.38; color: var(--note); }
.bio .interests { margin-bottom: 16px; }
.hero { height: 340px; display: grid; place-items: center; background-position: center top; background-size: cover; }
.research-hero { background-image: linear-gradient(rgb(255 255 255 / 60%), rgb(255 255 255 / 60%)), url('/assets/research-banner.png'); }
.teaching-hero { background-image: linear-gradient(rgb(33 33 33 / 70%), rgb(33 33 33 / 70%)), url('/assets/teaching-banner.jpg'); }
.hero h1 { font-size: 64px; color: #980000; line-height: 1.33333; }
.research-hero h1 { transform: translateY(-25px); }
@media (prefers-color-scheme: dark) {
  .teaching-hero h1 { color: #ffbcb9; }
}
.text-panel { margin-inline: calc(1.25% + 8px); padding-block: 32px; }
.text-panel h2 { font-size: 25.3333px; line-height: 35.4667px; }
.paper { font-size: 16px; line-height: 1.6667; font-weight: bold; color: var(--note); }
.school { font-size: 14pt; }
.course { font-size: 11pt; line-height: 25.33px; color: var(--note); }
.course + .course { margin-top: 12.67px; }
.cv { padding-top: 88px; }
.cv h1 { font-size: 45.333px; line-height: 54.4px; text-align: center; margin-bottom: 56px; }
.cv-file { margin: 0 1.25% 64px; }
.pdf-viewer { display: block; width: 100%; aspect-ratio: 1.633; border: 0; }
.cv-caption { display: inline-block; margin-block: 12px; }
.cv-card { display: none; }
dialog { color: var(--ink); background: var(--page); border: 0; }
dialog::backdrop { background: #0006; }
.drawer { margin: 0 auto 0 0; width: min(300px, 85vw); height: 100dvh; max-height: 100dvh; padding: 18px; }
.drawer a { display: block; text-decoration: none; padding: 12px; font-family: Lora, Georgia, serif; }
.drawer [aria-current] { font-weight: bold; }
.drawer button { margin-bottom: 18px; }
.search-box { width: min(620px, 92%); margin: 16px auto; padding: 20px; border-radius: 4px; font-family: system-ui, sans-serif; }
.search-box label { display: block; font-size: 18px; margin-bottom: 12px; }
.search-field { display: flex; gap: 10px; }
.search-field input { min-width: 0; flex: 1; font: inherit; padding: 8px; }
.search-results { display: grid; gap: 12px; margin: 16px 0 4px; }
@media (max-width: 767px) {
  .site-bar { padding: 0 5px 0 4px; }
  .brand { font-size: 18.6667px; margin-left: 4px; }
  .desktop-nav { display: none; }
  .menu-button { display: grid; }
  .search-button { margin-left: auto; }
  .layout { max-width: 544px; padding-inline: 5px; }
  .home-row { display: block; }
  .portrait-col { width: 83.333333%; padding-inline: 2.5%; margin-inline: auto; }
  .bio { width: 100%; padding: 62px calc(2.5% + 8px) 0; }
  .bio h1 { font-size: 36px; line-height: 46.4px; }
  .hero { height: 250px; }
  .hero h1 { font-size: 54.667px; line-height: 69.33px; }
  .text-panel { margin-inline: calc(2.5% + 8px); }
  .text-panel h2 { font-size: 22.667px; line-height: 31.733px; }
  .cv h1 { font-size: 38.667px; line-height: 46.4px; }
  .cv-file { margin-inline: 2.5%; }
  .pdf-viewer, .cv-caption { display: none; }
  .cv-card { display: block; background: light-dark(#f2f2f2,#303134); border: 1px solid light-dark(#ddd,#444); text-decoration: none; }
  .cv-card img { display: block; width: 100%; aspect-ratio: 1.633; object-fit: cover; object-position: center; padding-inline: 12.5%; background: black; }
  .cv-card span { display: block; padding: 14px; font: 16px system-ui, sans-serif; }
}
@media (max-width: 479px) {
  .brand { font-size: 17.3333px; }
  .portrait-col { width: 100%; padding-inline: 3.75%; }
  .bio { padding-inline: calc(3.75% + 8px); }
  .bio h1 { font-size: 30.667px; line-height: 38.4px; }
  .hero h1 { font-size: 44px; line-height: 53.333px; }
  .text-panel { margin-inline: calc(3.75% + 8px); }
  .text-panel h2 { font-size: 20px; line-height: 28px; }
  .cv h1 { font-size: 32px; line-height: 38.4px; }
  .cv-file { margin-inline: 3.75%; }
}
