/* Compact academic layout, inspired by yechao-zhang.github.io. */
:root {
  --ink: #494e52;
  --strong: #31363b;
  --muted: #6f777d;
  --link: #2f5d7c;
  --hover: #4f86a6;
  --blue: #286fa8;
  --purple: #7b42bc;
  --rule: #eceeee;
  --paper: #fff;
  --subtle: #f7f8f9;
}
body.dark-mode {
  --ink: #c9ced3;
  --strong: #edf0f2;
  --muted: #a0a8b0;
  --link: #8fb6d0;
  --hover: #bbd6e8;
  --blue: #83b9eb;
  --purple: #bc9ade;
  --rule: #30363c;
  --paper: #171b20;
  --subtle: #20262d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 19px/1.6 'Trebuchet MS', Helvetica, Arial, sans-serif;
}
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .14em;
  transition: color .15s ease;
}
a:hover { color: var(--hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2, h3 { color: var(--strong); line-height: 1.3; }
p { margin: 0 0 12px; }
.container {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 64px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}
.sidebar { position: sticky; top: 0; align-self: start; padding: 78px 0 36px; }
.profile-photo { margin: 0 auto 20px; width: 180px; height: 180px; }
.profile-photo img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
}
.name { text-align: center; margin: 0 0 8px; font-size: 28px; letter-spacing: -.4px; }
.name .chinese { display: block; margin-top: 5px; font-size: 22px; font-weight: 400; color: var(--ink); }
.affiliation { margin-bottom: 14px; text-align: center; }
.profile-location { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 17px; color: var(--muted); }
.profile-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; max-width: 260px; margin: 0 auto; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 18px; }
.profile-link { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; white-space: nowrap; color: var(--ink); }
.profile-link i { width: 18px; text-align: center; color: var(--link); }
.profile-link:hover { color: var(--link); text-decoration: underline; }
button.profile-link { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.main-content { min-width: 0; padding-bottom: 40px; }
.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 49px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.top-nav a { padding: 13px 0; color: var(--muted); font-size: 18px; text-decoration: none; }
.top-nav a:hover { color: var(--link); }
.top-nav a.active { font-weight: 700; color: var(--strong); }
.section { margin-bottom: 38px; scroll-margin-top: 75px; }
.section-title { margin: 0 0 15px; padding-bottom: 9px; border-bottom: 1px solid var(--rule); font-size: 28px; }
.section-subtitle { margin: 22px 0 10px; font-size: 22px; }
.bio-interests { margin: 0 0 14px; padding-left: 19px; }
.bio-interests li { margin-bottom: 7px; }
.highlight { color: var(--purple); font-weight: 700; }
.bio-contact { overflow-wrap: anywhere; font-size: 18px; }
.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 10px;
  padding-left: 14px;
  margin-bottom: 8px;
  font-size: 18px;
}
.news-item::before { content: '•'; position: absolute; left: 0; color: var(--ink); }
.news-professional-milestone::before, .news-professional-site::before { color: var(--purple); }
.news-date { font-weight: 700; color: var(--strong); white-space: nowrap; }
.pub-entry {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px;
  align-items: center; padding: 0 0 20px; margin-bottom: 22px; border-bottom: 1px solid var(--rule);
}
.pub-entry:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.pub-teaser {
  display: flex; align-items: center; justify-content: center; width: 320px;
}
.pub-teaser img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; }
.pub-title { margin: 0 0 5px; font-size: 21px; line-height: 1.4; }
.pub-title a { color: var(--strong); text-decoration: none; }
.pub-title a:hover { color: var(--link); text-decoration: underline; }
.pub-venue { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; font-size: 17px; color: var(--muted); }
.pub-venue .tag-oral, .pub-venue .tag-poster {
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: none; color: inherit; font: inherit;
}
.pub-venue .tag-oral { color: var(--blue); font-weight: 700; }
.pub-venue .tag-oral::before {
  content: ''; display: inline-block; width: 1em; height: 1em; margin-right: 4px;
  vertical-align: -.08em; background: url('../images/oral-star.png') center / contain no-repeat;
  filter: brightness(1.28) saturate(1.15);
}
.pub-authors { margin-bottom: 7px; font-size: 18px; font-style: normal; }
.author-name { white-space: nowrap; }
.pub-authors .me { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pub-links { margin-bottom: 7px; font-size: 17px; color: var(--muted); }
.pub-links a { margin: 0 3px; }
.pub-links a:first-child { margin-left: 0; }
.pub-tldr { font-size: 18px; line-height: 1.55; }
.bibtex-content { margin-top: 12px; padding: 14px; background: var(--subtle); border: 1px solid var(--rule); }
.bibtex-content[hidden] { display: none; }
.bibtex-content pre { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.bibtex-copy { padding: 3px 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--link); cursor: pointer; }
.item-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; margin-bottom: 10px; font-size: 18px; }
.item-date { color: var(--strong); font-weight: 700; }
.review-grid { display: grid; gap: 7px; }
.review-item { display: grid; grid-template-columns: 90px 1fr; gap: 14px; font-size: 18px; }
.review-venue { white-space: nowrap; font-weight: 700; }
.tag-gold-reviewer, .tag-top-reviewer, .tag-notable { margin-left: 4px; color: var(--blue); font-weight: 700; }
.footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.theme-toggle, .back-to-top { position: fixed; z-index: 10; border: 1px solid var(--rule); color: var(--muted); background: var(--paper); cursor: pointer; width: 30px; height: 30px; border-radius: 3px; }
.theme-toggle { top: 9px; right: 8px; }
.theme-toggle .icon-sun, body.dark-mode .theme-toggle .icon-moon { display: none; }
body.dark-mode .theme-toggle .icon-sun { display: inline; }
.back-to-top { bottom: 18px; right: 14px; visibility: hidden; opacity: 0; transition: opacity .15s ease; }
.back-to-top.visible { visibility: visible; opacity: 1; }
@media (max-width: 1000px) {
  .container { grid-template-columns: 190px minmax(0, 1fr); gap: 40px; }
  .pub-entry { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .pub-teaser { width: 240px; }
  .top-nav { gap: 14px; }
}
@media (max-width: 900px) {
  .container { display: block; padding: 0 20px; }
  .sidebar { position: static; padding: 32px 0 26px; text-align: center; }
  .profile-photo { width: 150px; height: 150px; margin-bottom: 14px; }
  .name .chinese { display: inline; margin-left: 8px; }
  .top-nav { gap: 8px 20px; margin-bottom: 22px; position: static; }
  .top-nav a { padding: 9px 0; }
  .section { scroll-margin-top: 18px; }
  .pub-entry { grid-template-columns: 260px minmax(0, 1fr); }
  .pub-teaser { width: 260px; }
}
@media (max-width: 640px) {
  .pub-entry { grid-template-columns: 1fr; gap: 12px; }
  .pub-teaser { width: min(100%, 420px); min-height: 0; max-height: none; aspect-ratio: 4 / 3; margin: 0 auto; }
}
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .section-title { font-size: 25px; }
  .news-item { grid-template-columns: 1fr; gap: 1px; margin-bottom: 12px; }
  .item-row { grid-template-columns: 1fr; gap: 2px; }
  .pub-title { font-size: 20px; }
  .pub-authors { font-size: 18px; }
  .top-nav { gap: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .container { display: block; }
  .sidebar { position: static; padding: 0; }
  .profile-photo, .top-nav, .theme-toggle, .back-to-top { display: none; }
  .pub-entry { break-inside: avoid; }
  body { color: #000; background: #fff; }
}
