html:root {
  --lab-ink: #22202a;
  --lab-muted: #5c5964;
  --lab-plum: #69396f;
  --lab-rule: #dcd7df;
  --lab-serif-en: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --lab-serif: var(--lab-serif-en);
}

html:root[data-theme="dark"] {
  --lab-ink: #f3eff3;
  --lab-muted: #c3bec8;
  --lab-plum: #e1aedf;
  --lab-rule: #534c58;
}

html body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--lab-ink);
  line-height: 1.55;
}

body :focus-visible { outline: 2px solid var(--lab-plum); outline-offset: 4px; }
body .container { width: calc(100% - 3rem); margin-inline: auto; }
body a { color: var(--lab-plum); text-underline-offset: .18em; }

#navbar.lab-nav {
  background: var(--global-bg-color);
  border-top: 3px solid var(--lab-plum);
  border-bottom: 1px solid var(--lab-rule);
  opacity: 1;
}

.lab-nav .container { min-height: 3.2rem; }
#navbar .lab-wordmark {
  color: var(--lab-ink);
  font: 700 1.85rem/1 var(--lab-serif-en);
  letter-spacing: -.05em;
}
#navbar .lab-wordmark em { color: var(--lab-plum); font-weight: 500; }
#navbar .navbar-nav { align-items: center; gap: 1.05rem; }
#navbar .nav-link { font-size: .95rem; }
#navbar .active .nav-link { color: var(--lab-plum); text-decoration: underline; text-underline-offset: .3em; }
#navbar #light-toggle { transform: none; align-self: center; }
.mode-disc {
  width: 1rem; height: 1rem; border-radius: 100%;
  border: 1.5px solid var(--lab-ink);
  background: linear-gradient(90deg, var(--lab-ink) 50%, transparent 50%);
}

html[data-theme-setting="dark"] .mode-disc { background: var(--lab-ink); }
html[data-theme-setting="light"] .mode-disc { background: transparent; }

body [role="main"] { margin-top: clamp(2.25rem, 5vw, 4.5rem); }
.lab-intro {
  display: grid; grid-template-columns: 1.48fr 1fr;
  align-items: end; gap: clamp(1.5rem, 5vw, 5rem);
  margin: 0 0 2.15rem;
}
.lab-intro .lab-affiliation {
  color: var(--lab-plum); font-weight: 650; font-size: .875rem;
  letter-spacing: .14em; text-transform: uppercase; margin: 0 0 1rem;
}
.post-header .post-title, .section-heading h2, .people-section h2 {
  font-family: var(--lab-serif);
  color: var(--lab-ink);
  font-weight: 500;
}
.lab-intro h1 { color: var(--lab-ink); font-family: var(--lab-serif-en); font-weight: 500; margin: 0; font-size: clamp(2.7rem, 4.85vw, 4.35rem); line-height: 1; letter-spacing: -.045em; }
.lab-intro h1 em { color: var(--lab-plum); font-weight: 400; }
.lab-intro .lab-intro-text { max-width: 28rem; margin: 0 0 .2rem; color: var(--lab-muted); font-size: 1.03rem; line-height: 1.65; }
.lab-intro-text a, .group-photo figcaption a, .people-list a { text-decoration: underline; }
.group-photo { margin: 0; }
.group-photo > a { display: block; }
.group-photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 2.65;
  object-fit: cover; object-position: center 52%;
}
.group-photo figcaption, .section-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.group-photo figcaption { padding: .7rem 0; font-size: .875rem; }
.group-photo figcaption span { color: var(--lab-muted); }
.home-section { margin-block: 3.75rem; }
.section-heading, .post .post-header {
  padding-bottom: .9rem; margin-bottom: 1.35rem; border-bottom: 1px solid var(--lab-rule);
}
.section-heading h2 { margin: 0; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.1; letter-spacing: -.03em; }
.paper-title a { color: var(--lab-ink); }
.research-intro { max-width: 78ch; margin: 0 0 2.2rem; font-size: 1.06rem; line-height: 1.75; }
#publications { scroll-margin-top: 5.5rem; }
.post-header .post-title { font-size: clamp(2.8rem, 6vw, 4.5rem); letter-spacing: -.04em; line-height: 1.1; margin: 0; }
.post-header .post-description:empty { display: none; }
.people-section {
  display: grid; grid-template-columns: minmax(12rem, .75fr) minmax(0, 2fr);
  column-gap: 2.5rem; padding-block: 1.5rem;
  border-bottom: 1px solid var(--lab-rule);
}
.people-section h2 { margin: 0; font-size: 1.75rem; line-height: 1.15; }
.people-cohort { grid-column: 2; }
.people-cohort + .people-cohort { margin-top: 1.4rem; }
.people-cohort h3 { font-size: .9rem; font-weight: 600; color: var(--lab-muted); margin: 0 0 .5rem; }
.people-list { display: flex; flex-wrap: wrap; gap: .5rem 1.7rem; }
.people-cohort .people-list { padding: 0; margin: 0; list-style: none; }
.people-name { font-size: 1.05rem; }
.people-name a span { color: inherit; }
.lab-papers .bibliography { margin: 0; padding: 0; list-style: none; }
.lab-papers li { border-bottom: 1px solid var(--lab-rule); padding: 1.1rem 0 1.3rem; }
.lab-papers li:first-child { padding-top: .25rem; }
.lab-papers .paper-title {
  max-width: 60ch; text-wrap: balance; font: 500 clamp(1.3rem, 2.2vw, 1.72rem)/1.25 var(--lab-serif);
  margin: 0 0 .5rem;
}
.lab-papers .paper-authors { color: var(--lab-muted); margin: 0 0 .35rem; }
.lab-papers .paper-meta { color: var(--lab-plum); font-size: .875rem; margin: 0; }

@media (max-width: 760px) {
  body .container { width: calc(100% - 1rem); }
  .lab-intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .lab-intro .lab-intro-text { max-width: 60ch; }
  .group-photo img { aspect-ratio: auto; }
  .home-section { margin-block: 2.65rem; }
  .people-section { grid-template-columns: 1fr; gap: 1rem; }
  .people-cohort { grid-column: auto; }
  .people-cohort + .people-cohort { margin-top: 0; }
}
@media (max-width: 575px) {
  #navbar .navbar-nav { align-items: flex-start; gap: .15rem; padding-bottom: .5rem; }
  .lab-intro h1 { font-size: clamp(2.55rem, 9.7vw, 3.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  html.transition *, .navbar-toggler .icon-bar { transition: none !important; }
}

#navbar .lab-language {
  margin-left: 1rem;
  padding: .3rem 0 .3rem 1rem;
  border-left: 1px solid var(--lab-rule);
  color: var(--lab-plum);
  font-size: .95rem;
}
#navbar .lab-language:hover { text-decoration: underline; }
.lab-intro .lab-intro-text p { color: inherit; margin: 0; }
html:lang(zh-CN) {
  --lab-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
}
html:lang(zh-CN) .lab-intro-text, html:lang(zh-CN) .research-intro { line-height: 1.85; }
@media (max-width: 575px) {
  #navbar .lab-language { margin-left: auto; padding: .5rem; border: 0; }
  #navbar .navbar-toggler-main { margin-left: .4rem; }
}
