:root {
  --ink: #3d4247;
  --muted: #59636b;
  --accent: #2b5685;
  --line: #e9ecef;
  --background: #ffffff;
  --focus: #d67d21;
  --sans: "Trebuchet MS", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #173b64;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 2px;
}

p {
  margin: 0 0 1em;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.35;
  font-weight: 700;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  margin: 0 0 1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
}

h3 {
  font-size: 1.125rem;
}

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

li + li {
  margin-top: .5rem;
}

strong {
  font-weight: 700;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--background);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1160px;
  margin: auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.65rem;
  font-size: 1rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 3rem;
  max-width: 1160px;
  margin: auto;
  padding: 2.6rem 2rem 3rem;
  align-items: start;
}

.profile {
  position: sticky;
  top: 6.6rem;
}

main {
  min-width: 0;
  max-width: 78ch;
}

.section {
  margin-bottom: 2.5rem;
}

.section > :last-child {
  margin-bottom: 0;
}

.about {
  margin-bottom: 2rem;
}

.footer {
  max-width: 1096px;
  margin: auto;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .875rem;
}

.footer p {
  margin: 0;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: 1rem;
  z-index: 20;
  padding: .5rem 1rem;
  background: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand, .nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.brand:hover, .nav-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 7px;
}

.profile-avatar {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 0 1.2rem;
  border-radius: 50%;
  object-fit: cover;
}

.profile-position {
  margin: .6rem 0 1.2rem;
  font-size: 1rem;
}

.profile-interests {
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.3rem;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.contact-prompt {
  margin-bottom: .5rem;
}

.contact-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.contact-icon:hover {
  background: #edf2f6;
  color: #173b64;
}

.contact-icon svg {
  width: 26px;
  height: 26px;
}

.wechat-trigger {
  anchor-name: --wechat-trigger;
}

.wechat-popover {
  position: fixed;
  position-anchor: --wechat-trigger;
  inset: auto;
  top: anchor(top);
  left: calc(anchor(right) + .5rem);
  right: 1rem;
  position-try-fallbacks: flip-block;
  width: auto;
  max-width: 260px;
  max-height: calc(100dvh - 2rem);
  margin: 0;
  overflow: auto;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--background);
  color: var(--ink);
  box-shadow: 0 12px 48px #0002;
}

.wechat-popover img {
  display: block;
  width: 100%;
}

.publication + .publication {
  margin-top: 1.45rem;
}

.publication h3 {
  color: #333c45;
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: .25rem;
}

.publication p {
  margin: .15rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.publication .venue {
  color: var(--accent);
  font-style: italic;
}

.timeline {
  list-style: none;
  padding: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1rem;
}

.timeline-item + .timeline-item {
  margin-top: 1.3rem;
}

.timeline-item p {
  margin: .15rem 0 0;
  font-size: 1.0625rem;
}

.timeline-item .timeline-date {
  margin: .1rem 0 0;
  font-size: 1rem;
  color: var(--muted);
}

.timeline-detail {
  color: var(--muted);
}

.service-list, .teaching-list {
  margin-top: .65rem;
}

.course-term {
  color: var(--muted);
}


@media (max-width: 1100px) {
  .nav {
    gap: 2rem;
  }

  .nav-links {
    gap: .4rem 1rem;
    font-size: 1rem;
  }

  .page-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 2.5rem;
  }

  .footer {
    margin: 0 2rem;
  }
}

@media (max-width: 800px) {
  html {
    scroll-padding-top: 7.5rem;
  }

  body {
    font-size: 1.0625rem;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding: .8rem 1.25rem;
  }

  .nav-links {
    gap: .3rem 1.1rem;
  }

  .page-layout {
    display: block;
    padding: 2rem 1.25rem;
  }

  .profile {
    position: static;
    display: grid;
    grid-template-columns: 115px minmax(0, 1fr);
    gap: 1.4rem;
    padding-bottom: 1.7rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid var(--line);
  }

  .profile-avatar {
    width: 115px;
    height: 115px;
  }

  .profile-position {
    margin: .4rem 0 .7rem;
  }

  .profile-interests {
    margin-bottom: .7rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .footer {
    margin: 0 1.25rem;
    flex-wrap: wrap;
    gap: .4rem 1rem;
  }
}

@media (max-width: 480px) {
  html {
    scroll-padding-top: 9rem;
  }

  .profile {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 1rem;
  }

  .profile-avatar {
    width: 74px;
    height: 74px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: .25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
