@font-face {
  font-family: "LXGW WenKai TC";
  src: url("fonts/lxgw-wenkai-name.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+4E7E, U+6653, U+6881;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --wash: #f0f5f1;
  --ink: #202a24;
  --muted: #536159;
  --accent: #255e48;
  --accent-hover: #143c2d;
  --rule: #dce5df;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  line-height: 1.6;
}

h1, h2, h3, h4, p, ul {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.wrap {
  width: min(65rem, calc(100% - 5rem));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1;
  inset: 1rem auto auto 1rem;
  padding: 0.5rem 0.85rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.profile {
  border-top: 0.3rem solid var(--accent);
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 44rem) clamp(10rem, 20vw, 13rem);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  padding-block: clamp(3.25rem, 6vw, 5.75rem);
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
}

h1 {
  color: #183e2e;
  font-size: clamp(2.15rem, calc(1rem + 4vw), 3.65rem);
  letter-spacing: -0.045em;
}

.name-zh {
  margin-inline-start: 0.22em;
  font-family: "LXGW WenKai TC", "Kaiti SC", KaiTi, var(--serif);
  font-size: 0.66em;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.profile-email {
  margin-top: 0.65rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.9375rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.profile-email a {
  color: inherit;
  text-decoration: none;
}

.profile-email a:hover, .profile-email a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.education, .bio {
  line-height: 1.65;
}

.education {
  margin-top: 1.35rem;
}

.bio {
  margin-top: 0.75rem;
}

.profile-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.6rem;
}

.profile-links > a, .profile-wechat summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-inline: 0.8rem;
  border: 1px solid #bccfc3;
  border-radius: 0.3rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.profile-links > a:hover, .profile-wechat summary:hover, .profile-wechat[open] summary {
  border-color: var(--accent);
  background: #e5eee8;
}

.profile-wechat summary {
  cursor: pointer;
  list-style: none;
}

.profile-wechat summary::-webkit-details-marker {
  display: none;
}

.profile-wechat summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.wechat-qr {
  position: absolute;
  z-index: 1;
  inset-block-start: calc(100% + 0.6rem);
  inset-inline-end: 0;
  width: min(16rem, 100%);
  padding: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 0.55rem;
  background: var(--paper);
  box-shadow: 0 0.55rem 1.4rem #202a2426;
}

.wechat-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.3rem;
}

.profile-portrait {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ccdacf;
  border-radius: 0.55rem;
  padding: 0.35rem;
  background: var(--paper);
}

.research {
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.6rem;
}

.research h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.15rem, 4vw, 3.05rem);
  letter-spacing: -0.04em;
}

.authorship-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin-bottom: 1.3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.authorship-legend strong, .paper-authors sup {
  color: var(--accent);
  font-weight: 650;
}

.research-year {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  column-gap: clamp(1rem, 3vw, 2.2rem);
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.research-year h3 {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.15;
}

.publication {
  display: grid;
  grid-template-columns: minmax(0, 12.75rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.6vw, 1.7rem);
}

.publication + .publication {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}

.paper-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  background: var(--wash);
}

a.paper-preview:hover {
  border-color: var(--accent);
}

.paper-preview img, .paper-preview video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: inherit;
  object-fit: cover;
}

.video-preview {
  position: relative;
}

.video-preview video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.video-preview.is-playing video {
  opacity: 1;
}

.paper-preview.diagram {
  padding: 0.35rem;
  background: #fcfdfc;
}

.paper-preview.diagram img {
  object-fit: contain;
}

.paper-venue {
  margin-bottom: 0.2rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
}

.paper-venue time {
  color: var(--muted);
  font-weight: 400;
}

.paper-venue span {
  padding-inline: 0.12rem;
}

.paper-details h4 {
  font-size: clamp(1.05rem, 1.7vw, 1.21rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.paper-details h4 a {
  color: inherit;
  text-decoration: none;
}

.paper-details h4 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.paper-authors {
  margin-top: 0.36rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.paper-authors strong {
  color: var(--ink);
  font-weight: 650;
}

.paper-authors sup {
  line-height: 0;
}

.paper-summary {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.55;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.95rem;
  margin-top: 0.38rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 650;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.2rem 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 50rem) {
  .wrap {
    width: calc(100% - 3rem);
  }

  .research-year {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .publication {
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  }
}

@media (max-width: 38rem) {
  .wrap {
    width: calc(100% - 2.25rem);
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    padding-block: 2.5rem 2rem;
  }

  .profile-portrait {
    justify-self: start;
    width: min(100%, 10rem);
  }

  .education, .profile-links {
    margin-top: 1.1rem;
  }

  .research-year {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1rem;
  }

  .publication {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }

  .paper-preview {
    width: min(100%, 16rem);
  }
}
