/* Appearance tokens; keep the existing Minimal Light layout and spacing. */
:root {
  color-scheme: light dark;
  --page: #fbfbfd;
  --ink: #1d1d1f;
  --text: #424245;
  --muted: #6e6e73;
  --link: #0066cc;
  --link-hover: #004f9f;
  --paper-title: #183b66;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --focus: #0071e3;
  --line: #dcdce1;
  --panel: #f0f5fc;
  --control: #f0f0f3;
  --control-hover: #e4eaf2;
  --nav: rgba(251, 251, 253, .86);
  --shadow: 0 4px 16px rgba(29, 29, 31, .045);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #161617;
    --ink: #f5f5f7;
    --text: #d2d2d7;
    --muted: #a1a1a6;
    --link: #75b6ff;
    --link-hover: #a3cfff;
    --paper-title: #a8cbf2;
    --accent: #0a66c2;
    --accent-hover: #0b71d5;
    --focus: #75b6ff;
    --line: #3a3a3c;
    --panel: #1c2735;
    --control: #28282c;
    --control-hover: #323c4a;
    --nav: rgba(22, 22, 23, .86);
    --shadow: 0 4px 16px rgba(0, 0, 0, .14);
  }
}
body { background: var(--page); color: var(--text); font-size: 17px; -webkit-font-smoothing: antialiased; }
header { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); }
h1, h2 { font-weight: 600; letter-spacing: -.025em; }
strong { color: var(--ink); }
autocolor { color: var(--text); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a[href] { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
a:hover { color: var(--link-hover); }
section p a:hover, .publication-details .title a:hover { text-decoration: underline; }
::selection { background: #0071e330; }
header position, .publication-legend, .publications .periodical,
.figure-credit, section > p > small { color: var(--muted); }

/* Keep the content grids; enlarge the portrait within the existing sidebar. */
.email-link { display: inline-block; font-size: 13px; overflow-wrap: anywhere; }
.image.avatar img { width: 180px; height: 232px; object-fit: cover; object-position: 50% 35%; border-radius: 8px; clip-path: inset(20px round 14px); }
.publications { margin-top: 0; }
.publication-legend { margin: 0 0 16px; font-size: 14px; }
.publications ol.bibliography li { min-height: 0; margin-bottom: 22px; }
.publications .author { margin-top: 4px; }
.publications .periodical { margin-top: 4px; }
.publications .links { margin-top: 8px; display: flex; gap: 8px; }
.publications .links .btn { font-size: 13px; border-radius: 999px; }
.publications ol.bibliography li .links a.btn {
  position: relative;
  color: var(--paper-title);
  background: var(--control);
  border-color: var(--line);
  font-weight: 500;
  text-decoration: none;
}
/* Enlarge the touch area vertically without moving adjacent content. */
.publications ol.bibliography li .links a.btn::after { content: ""; position: absolute; inset: -10px 0; }
.publications ol.bibliography li .links a.btn:hover {
  color: var(--paper-title);
  background: var(--control-hover);
  border-color: var(--link);
}
.publications ol.bibliography li .links a.btn:active { background: var(--control-hover); box-shadow: inset 0 1px 3px #00000018; }
.contribution { font-size: 14px; }
.publications .publication-entry .title,
.publications .publication-entry .title a,
.publications .publication-entry.first-author .author strong,
.publications .publication-entry.first-author .contribution {
  color: var(--paper-title);
}
.publications .publication-entry.first-author .author strong,
.publications .publication-entry.first-author .contribution { font-weight: 600; }
a:focus-visible, .contact-wechat > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.job-opportunities {
  margin: 20px 0 28px;
  padding: 16px 18px;
  background: var(--panel);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  color: var(--text);
  box-shadow: inset 0 0 0 1px #0071e30c, var(--shadow);
}
.job-opportunities p { margin: 0; }
.job-opportunities p[lang="en"] { margin-top: 10px; }
.job-opportunities .job-opportunities-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.job-opportunities strong { color: inherit; font-weight: 600; }
.job-opportunities-title strong { font-weight: inherit; }
.contact-wechat { display: inline-block; position: relative; margin-top: 14px; }
.contact-wechat > summary {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.contact-wechat > summary::-webkit-details-marker { display: none; }
.contact-wechat > summary:hover { background: var(--accent-hover); box-shadow: 0 3px 10px #0071e322; }
.contact-wechat > summary:active { box-shadow: inset 0 1px 4px #00000030; }
.wechat-contact-card {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  width: 260px;
  max-width: calc(100vw - 70px);
  padding-top: 10px;
}
.wechat-contact-content {
  padding: 12px;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 16px 48px #00000024, 0 2px 8px #0000000a;
}
.contact-wechat[open] .wechat-contact-content { animation: contact-appear 160ms ease-out; }
@keyframes contact-appear {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.job-opportunities .wechat-contact-title { margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.wechat-contact-content img { display: block; width: 100%; height: auto; }

/* Fixed navigation with room for anchored headings below it. */
html { scroll-behavior: smooth; }
body { padding-top: 56px; }
.wrapper section h2[id] { scroll-margin-top: 80px; }
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .top-nav {
    background: var(--nav);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    backdrop-filter: saturate(160%) blur(20px);
  }
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 960px;
  min-height: 56px;
  margin: 0 auto;
  padding: 0 20px;
}
.top-nav-brand { flex-shrink: 0; font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  min-width: 0;
}
.top-nav-links a {
  flex-shrink: 0;
  padding: 16px 0;
  font-size: 16px;
  line-height: 24px;
  border-bottom: 2px solid transparent;
  box-sizing: border-box;
  color: var(--text);
}
.top-nav-links a:hover, .top-nav-links a:focus-visible {
  color: var(--link);
  border-bottom-color: var(--link);
}
.top-nav-links a:focus-visible { outline-offset: -4px; border-radius: 4px; }
@media screen and (max-width: 700px) {
  .top-nav-brand { display: none; }
  .top-nav-inner { padding: 0 15px; }
  .top-nav-links { width: 100%; gap: 18px; }
}
@media screen and (max-width: 960px) {
  body { padding-top: 76px; }
}
/* Keep contact links reachable when a taller portrait meets a short screen. */
@media screen and (min-width: 961px) and (max-height: 660px) {
  header { position: absolute; }
}
@media print {
  .top-nav { display: none; }
  body { padding-top: 0.4in; }
}

/* Paper figures follow the image-left, text-right Minimal Light layout. */
.publication-entry.has-figure {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.publication-visual { position: relative; min-width: 0; text-align: center; }
.figure-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  .figure-link[href]:hover { border-color: var(--link); box-shadow: 0 6px 18px #0071e312; }
}
.paper-figure { display: block; width: 100%; height: auto; max-height: 145px; object-fit: contain; }
.venue-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  pointer-events: none;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px #0000001a;
  background: #183b66;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
}
.figure-credit { display: block; margin-top: 4px; font-size: 9px; line-height: 1.4; }
.publication-details { min-width: 0; overflow-wrap: anywhere; }
@media screen and (max-width: 600px) {
  .publication-entry.has-figure { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .publication-visual { width: min(260px, 100%); }
  .figure-link { min-height: 0; }
}

.social-icons .social-icon-static {
  display: inline-block;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 5px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 1.15rem;
  line-height: 2.5rem;
  cursor: default;
}
.social-icons .social-icon-static:last-child { margin-right: 0; }
.social-icons a { color: var(--paper-title) !important; transition: color 160ms ease, background-color 160ms ease; }
.social-icons a:hover { background: var(--control-hover); transform: none; }

/* Align institution marks with their education and internship entries. */
.affiliation-entry {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 0 0 24px;
}
.affiliation-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px #1d1d1f0a;
}
.affiliation-logo img { display: block; width: 64px; height: 64px; object-fit: contain; }
.affiliation-logo-wordmark img { width: 72px; height: 48px; }
.affiliation-content { min-width: 0; }
.affiliation-content p { margin: 0 0 4px; }
.affiliation-content .affiliation-date { font-size: 14px; color: var(--muted); }
.affiliation-content .affiliation-description { margin-top: 12px; }
@media screen and (max-width: 480px) {
  .affiliation-entry { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
  .affiliation-logo { width: 58px; height: 64px; }
  .affiliation-logo img { width: 50px; height: 50px; }
  .affiliation-logo-wordmark img { width: 54px; height: 36px; }
}

@media screen and (max-width: 960px) {
  section { border-color: var(--line); }
}
@media (prefers-reduced-transparency: reduce) {
  .top-nav { background: var(--page); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a[href], .social-icons a, .contact-wechat > summary { transition: none; }
  .contact-wechat[open] .wechat-contact-content { animation: none; }
}
@media print {
  :root { color-scheme: light; --page: #fff; --ink: #1d1d1f; --text: #424245; --muted: #6e6e73; --link: #0066cc; --paper-title: #183b66; --line: #dcdce1; --panel: #f0f5fc; --control: #f0f0f3; }
  .job-opportunities, .figure-link { box-shadow: none; }
}
