@charset "UTF-8";

:root {
  color-scheme: light;
  --ink: #182026;
  --body: #3b4752;
  --muted: #5c6b77;
  --blue: #1b4f78;
  --blue-hover: #133c5d;
  --blue-soft: #eaf2f8;
  --accent: #a3543b;
  --accent-soft: #f6ebe6;
  --teal: #3d7068;
  --line: #dde3e8;
  --paper: #fbfcfd;
  --surface: #ffffff;
  --hover: #f2f6f9;
  --field-line: #b8c4cc;
  --link-line: #7a98ad;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Songti SC", "STSong", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace;
  font-family: var(--sans);
  font-size: 100%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ecf1f5;
  --body: #c1ccd4;
  --muted: #93a3b0;
  --blue: #8ec5e8;
  --blue-hover: #b2d9f2;
  --blue-soft: #1b2c39;
  --accent: #d88b6c;
  --accent-soft: #2d1f1a;
  --teal: #73b0a6;
  --line: #29353f;
  --paper: #11171c;
  --surface: #172027;
  --hover: #1e2932;
  --field-line: #4d5e6b;
  --link-line: #5d8099;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 72px; background-color: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  font-size: 1.02rem;
  line-height: 1.72;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}
html[lang="zh-CN"] body { font-size: 1rem; line-height: 1.82; }

/* Continuous vortex streamlines backdrop (no dashed/segmented paths) */
body::before {
  content: "";
  position: fixed;
  inset: -6%;
  z-index: -1;
  pointer-events: none;
  background: url("../images/streamlines.svg") center / cover no-repeat;
  opacity: .21;
  animation: flow-background 48s ease-in-out infinite alternate;
  -webkit-mask-image: radial-gradient(ellipse 84% 78% at 50% 44%, rgb(0 0 0 / .28) 0%, rgb(0 0 0 / .84) 62%, #000 100%);
  mask-image: radial-gradient(ellipse 84% 78% at 50% 44%, rgb(0 0 0 / .28) 0%, rgb(0 0 0 / .84) 62%, #000 100%);
}
:root[data-theme="dark"] body::before {
  opacity: .15;
  filter: brightness(1.45) contrast(1.05);
}
@keyframes flow-background { to { transform: translate3d(1.8%, -1.4%, 0); } }

h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-weight: 650; line-height: 1.18; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.paper-meta,
.award-year,
.timeline time,
.year-count,
.pill-count,
.paper-num,
.hero-facts,
.filter-status { font-variant-numeric: tabular-nums; }

/* Strict sharp-corner policy on all images and image wrappers */
img,
picture,
.hero-portrait,
.hero-portrait img,
.research-figures a,
.research-figures img,
.featured-media,
.paper-figure,
.figure-viewer img,
.wechat-card img,
.timeline-badge img {
  border-radius: 0;
}

img { display: block; max-width: 100%; }

a {
  color: var(--blue);
  text-underline-offset: .23em;
  text-decoration-color: var(--link-line);
}
a:hover { color: var(--blue-hover); text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: currentColor;
}

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; z-index: 30; inset: 12px auto auto 12px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
}
.site-brand {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}
.site-brand:hover { color: var(--blue); text-decoration: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 22px;
  row-gap: 4px;
}
.site-nav a {
  padding-block: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .83rem;
  text-decoration: none;
  transition: color 140ms ease;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px var(--blue);
}
.site-nav .language { color: var(--blue); font-weight: 500; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 9px;
  background: var(--surface);
  color: var(--muted);
  font: .78rem var(--mono);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--field-line); background: var(--hover); }
.theme-toggle .icon { width: 14px; height: 14px; }

/* Buttons & Chips */
.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 520;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
:root[data-theme="dark"] .button.primary { color: #0b1318; font-weight: 600; }
.button.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; text-decoration: none; }
:root[data-theme="dark"] .button.primary:hover { color: #0b1318; }

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--field-line);
}
.button.secondary:hover { background: var(--hover); border-color: var(--blue); color: var(--blue); text-decoration: none; }

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--body);
  font-size: .84rem;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}
.social-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}
.social-chip .icon { width: 14px; height: 14px; color: var(--blue); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 33%);
  align-items: start;
  gap: clamp(28px, 5vw, 56px);
  padding-block: 44px 38px;
}
.hero > * { min-width: 0; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.45rem, 4.8vw, 3.45rem);
  letter-spacing: -.03em;
}
html[lang="zh-CN"] .hero h1 { font-family: var(--sans); letter-spacing: -.01em; }
.alternate-name { color: var(--muted); margin-top: 4px; font-size: 1.05rem; }

.affiliation {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-block: 18px;
  padding: 4px 0 4px 14px;
  background: transparent;
  border: 0;
  border-left: 2px solid var(--blue);
  width: fit-content;
  max-width: 100%;
}
.affiliation img { flex: 0 0 50px; width: 50px; height: 50px; object-fit: contain; }
.affiliation strong, .affiliation a { display: block; line-height: 1.45; }
.affiliation strong { font-weight: 640; font-size: .96rem; }
.affiliation a { width: fit-content; font-size: .89rem; text-decoration: none; }
.affiliation a:hover { text-decoration: underline; }

.bio { color: var(--body); max-width: 64ch; }
.bio strong { color: var(--ink); font-weight: 620; }
.bio p + p { margin-top: 8px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-portrait {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px -18px rgb(16 30 42 / .25);
}
.hero-portrait img { width: 100%; height: auto; aspect-ratio: 735 / 551; object-fit: cover; }
.hero-portrait figcaption { margin-top: 7px; text-align: right; color: var(--muted); font-size: .8rem; font-family: var(--mono); }
.hero-facts {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  font-family: var(--mono);
  font-size: .77rem;
}
.hero-facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.hero-facts dt { color: var(--muted); flex: 0 0 auto; }
.hero-facts dd { margin: 0; color: var(--body); text-align: right; }

/* Sections */
.section { padding-block: 32px 34px; border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 18px;
}
.section-heading-group { display: grid; gap: 4px; }
.section-eyebrow {
  font-family: var(--mono);
  font-size: .73rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
html[lang="zh-CN"] .section-eyebrow { letter-spacing: .05em; text-transform: none; }
.eyebrow-num { color: var(--accent); font-weight: 600; }
.section-heading h2, .contact h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: -.015em;
}
html[lang="zh-CN"] .section-heading h2,
html[lang="zh-CN"] .contact h2 { font-family: var(--sans); letter-spacing: 0; }
.section-heading a { font-size: .9rem; font-family: var(--mono); }

/* Research */
.research-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.research-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-block: 20px;
  min-width: 0;
}
.research-card > * { min-width: 0; }
.research-card + .research-card { border-top: 1px solid var(--line); }
.research-card--single {
  grid-template-columns: minmax(260px, 46%) minmax(0, 1fr);
  align-items: center;
  gap: 16px 26px;
}
.research-copy { display: grid; gap: 6px; align-content: start; }
.research-meta-row { display: flex; align-items: center; gap: 8px; }
.research-index {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 650;
  color: var(--accent);
}
.research-tag {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 550;
  letter-spacing: .03em;
  text-transform: uppercase;
}
html[lang="zh-CN"] .research-tag { text-transform: none; letter-spacing: .02em; }
.research-card h3, .timeline > h3, .honors-block > h3 { font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
.research-card p { color: var(--body); max-width: 72ch; }
.research-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--blue);
  text-decoration: none;
}
.research-link:hover { color: var(--accent); text-decoration: underline; }

.gallery-shell {
  position: relative;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 42px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 42px), transparent 100%);
}
.gallery-shell.is-scrolled {
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22px, #000 calc(100% - 42px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22px, #000 calc(100% - 42px), transparent 100%);
}
.research-figures {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 4px 2px 8px;
  list-style: none;
  overflow-x: auto;
  scroll-behavior: auto;
  scrollbar-width: none;
}
.research-figures::-webkit-scrollbar { display: none; }
.research-figures li { flex: 0 0 auto; min-width: 0; }
.research-card--single .research-figures { padding: 0; overflow: visible; }
.research-card--single .research-figures li { width: 100%; }

.research-figures a {
  display: block;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: zoom-in;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.research-figures a:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 18px -12px rgb(16 30 42 / .32);
}
.research-figures a:focus-visible { outline-offset: -2px; }

.research-figures img {
  --figure-base-height: clamp(160px, 23vw, 220px);
  height: var(--figure-base-height);
  width: calc(var(--figure-base-height) * var(--figure-ratio));
  max-width: none;
  object-fit: contain;
}
.research-card--single .research-figures img {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.gallery-hint { color: var(--muted); font-size: .78rem; font-family: var(--mono); }
.gallery-controls { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.gallery-controls button {
  min-width: 30px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--blue);
  background: var(--surface);
  font: .8rem var(--mono);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.gallery-controls button:hover:not(:disabled) { background: var(--hover); border-color: var(--field-line); }
.gallery-controls button:disabled { opacity: .4; cursor: default; }

/* Lightbox dialog */
.figure-viewer {
  max-width: min(94vw, 1120px);
  max-height: 92vh;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .45);
}
.figure-viewer::backdrop { background: rgb(10 16 22 / .76); backdrop-filter: blur(4px); }
.figure-viewer header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.viewer-nav { display: flex; align-items: center; gap: 8px; }
.viewer-counter { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.viewer-actions { display: flex; align-items: center; gap: 10px; }
.figure-viewer button {
  padding: 4px 10px;
  font: .82rem var(--mono);
  color: var(--blue);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.figure-viewer button:hover:not(:disabled) { background: var(--hover); border-color: var(--field-line); }
.figure-viewer button:disabled { opacity: .4; cursor: default; }
.figure-viewer .viewer-stage {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px;
}
.figure-viewer img {
  width: auto;
  max-height: 70vh;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
}
.viewer-caption {
  margin-top: 10px;
  color: var(--body);
  font-size: .9rem;
  text-align: center;
}

/* Selected Papers (3-column editorial grid) */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.featured-card:hover {
  border-color: var(--field-line);
  background-color: var(--hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -18px rgb(16 30 42 / .28);
}
.featured-media {
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px;
  margin-bottom: 12px;
}
:root[data-theme="dark"] .featured-media {
  background: #e6ecf0;
  border-color: #32414d;
}
:root[data-theme="dark"] .featured-media .paper-figure {
  filter: brightness(.94) contrast(1.03);
}
.paper-figure {
  width: 100%;
  height: 176px;
  object-fit: contain;
}
.featured-copy { display: flex; flex-direction: column; flex: 1; }
.paper-meta { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.paper-badge-new,
.paper-badge-selected {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  vertical-align: middle;
}
.featured-copy h3, .paper-row h3 {
  margin-block: 4px 6px;
  font-family: var(--serif);
  line-height: 1.35;
  font-size: 1.07rem;
  font-weight: 650;
}
.featured-copy h3 a, .paper-row h3 a { color: var(--ink); text-decoration: none; }
.featured-copy h3 a:hover, .paper-row h3 a:hover { color: var(--blue); text-decoration: underline; }
.paper-authors { color: var(--body); font-size: .88rem; line-height: 1.5; }
.paper-authors a { color: inherit; }
.paper-authors a:hover { color: var(--blue); }
.featured-copy .paper-links { margin-top: auto; padding-top: 10px; }

/* Background & Honours */
.background-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.timeline ul, .honors-list { list-style: none; padding: 0; margin: 10px 0 0; }
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 14px;
  padding-block: 10px;
}
.timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 17.5px;
  top: 48px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}
.timeline-badge, .timeline-logo-space { display: grid; place-items: center; width: 36px; height: 36px; margin-top: 2px; }
.timeline-badge img { width: 34px; height: 34px; object-fit: contain; }
.timeline-body { min-width: 0; }
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 12px;
}
.timeline-head strong { font-size: .94rem; font-weight: 620; line-height: 1.42; }
.timeline-org { display: block; margin-top: 2px; font-size: .85rem; color: var(--body); }
.award-year, .timeline time { font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Dark mode transparent badge adjustments */
:root[data-theme="dark"] img[src*="ustcblack"] { filter: invert(0.92); }
:root[data-theme="dark"] img[src*="hkpolyu"] { filter: brightness(1.75) saturate(1.1); }

.honors-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.honors-list li {
  display: grid;
  grid-template-columns: minmax(0, 4.8rem) minmax(0, 1fr);
  gap: 12px;
  color: var(--body);
  font-size: .93rem;
  padding-block: 5px;
}
.honors-more { margin-top: 8px; }
summary { cursor: pointer; color: var(--blue); width: fit-content; font-size: .91rem; font-weight: 520; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; }
.contact-intro { display: grid; gap: 4px; }
.contact p { color: var(--body); margin-top: 4px; max-width: 54ch; }
.contact a { overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.copy-btn { padding: 8px 12px; font-size: .85rem; font-family: var(--mono); }
.contact-email-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  color: var(--muted);
}
.email-tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
}
.secondary-mail-link {
  font-family: var(--mono);
  font-size: .84rem;
  color: var(--body);
  text-decoration: none;
}
.secondary-mail-link:hover { color: var(--blue); text-decoration: underline; }
.copy-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--blue);
  font: .76rem var(--mono);
  cursor: pointer;
}
.copy-inline-btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.contact-extras { font-size: .9rem; }
.wechat-details { position: relative; }
.wechat-card {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  color: #182026;
  border: 1px solid var(--line);
  width: 210px;
}
.wechat-card img { width: 100%; height: auto; }
.wechat-note { margin-top: 8px !important; font-size: .78rem; line-height: 1.45; color: #3b4752 !important; }

.fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--blue);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  box-shadow: 0 8px 22px -12px rgb(16 30 42 / .35);
  transition: opacity 180ms ease, transform 180ms ease, background-color 140ms ease, border-color 140ms ease;
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--hover);
  border-color: var(--blue);
}
.back-to-top .icon { width: 18px; height: 18px; }

.copy-toast:not(:empty) {
  position: fixed; right: 22px; bottom: 72px; z-index: 30;
  border: 1px solid var(--line); border-radius: 4px; background: var(--surface);
  padding: 8px 14px; color: var(--ink); font-size: .85rem;
  box-shadow: 0 10px 24px -12px rgb(0 0 0 / .35);
}

/* Footer */
.footer-inner {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 20px 28px;
  font-size: .87rem;
  color: var(--muted);
}
.footer-inner strong { color: var(--ink); margin-inline-end: 10px; font-weight: 630; }
.footer-updated { margin-inline-start: 10px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.footer-updated::before { content: "· "; }
.footer-links { display: flex; align-items: baseline; gap: 16px; }

/* Publications Page */
.page-intro { padding-block: 22px 18px; }
.page-intro h1 { font-family: var(--serif); font-size: clamp(2.2rem, 4.5vw, 3.1rem); }
html[lang="zh-CN"] .page-intro h1 { font-family: var(--sans); }
.page-intro > p { margin-top: 10px; color: var(--body); }
.page-intro .profile-links { margin-top: 0; }

.publication-layout { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 28px; padding-bottom: 36px; }
.year-nav { position: sticky; top: 74px; align-self: start; display: flex; flex-direction: column; gap: 5px; font-size: .88rem; }
.year-nav-heading { font-weight: 650; margin-bottom: 2px; }
.year-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  width: fit-content;
  font-family: var(--mono);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
}
.year-nav a:hover { background: var(--hover); }
.year-nav a[aria-current] { font-weight: 700; background: var(--blue-soft); color: var(--blue); }
.year-count { font-size: .76rem; color: var(--muted); }

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 40;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #3b4e5b 0%,
    #3f686c 16%,
    #3d7068 32%,
    #5a7c63 48%,
    #8e875e 62%,
    #b38c56 76%,
    #af714b 90%,
    #a3543b 100%
  );
  clip-path: inset(0 calc((1 - var(--reading-progress, 0)) * 100%) 0 0);
}

.publication-filters {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.filter-search label { display: block; font-size: .84rem; font-weight: 550; color: var(--muted); margin-bottom: 5px; }
.filter-search input {
  display: block; width: 100%; min-height: 38px; padding: 7px 10px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--field-line); border-radius: 4px; font: inherit; font-size: .92rem;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--body);
  font: .81rem var(--mono);
  cursor: pointer;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}
.filter-pill:hover { border-color: var(--blue); color: var(--blue); }
.filter-pill[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
:root[data-theme="dark"] .filter-pill[aria-pressed="true"] { color: #0b1318; font-weight: 600; }
.pill-count { opacity: .78; font-size: .74rem; }

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.filter-status { font-family: var(--mono); font-size: .79rem; color: var(--muted); }
.filter-action {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--blue);
  font: .78rem var(--mono);
  cursor: pointer;
  transition: background-color 130ms ease, border-color 130ms ease;
}
.filter-action:hover { background: var(--blue-soft); border-color: var(--blue); }

.paper-year { margin-top: 26px; }
.paper-year h2 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 10px; }
html[lang="zh-CN"] .paper-year h2 { font-family: var(--sans); }
.paper-row {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 14px 10px;
  transition: background-color 140ms ease;
}
.paper-row[data-selected="true"] { border-left: 2px solid var(--accent); padding-left: 10px; }
.paper-num { font-family: var(--mono); font-size: .8rem; color: var(--muted); user-select: none; }
.paper-num--thesis { color: var(--accent); font-weight: 600; }
.paper-body { min-width: 0; }
.paper-row:hover { background-color: var(--hover); }
.paper-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 7px; font-size: .86rem; }
.paper-links > a { font-family: var(--mono); }
.paper-links a.paper-link-code {
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  text-decoration: none;
}
.paper-links a.paper-link-code:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .paper-links a.paper-link-code:hover { color: #0b1318; }
.bibtex-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--blue);
  font: .78rem var(--mono);
  cursor: pointer;
}
.bibtex-btn:hover { background: var(--blue-soft); border-color: var(--blue); }

.paper-abstract { margin-top: 8px; min-width: 0; }
.paper-abstract summary { font-size: .88rem; }
.abstract-body {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  max-width: 70ch;
}
.abstract-body p { color: var(--body); font-size: .94rem; overflow-wrap: anywhere; }
.abstract-body p + p { margin-top: 8px; }
.empty-results { margin-top: 18px; color: var(--body); }

/* 404 */
.not-found { padding-block: 72px; max-width: 58ch; }
.not-found h1 { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 10px; }
.not-found p { margin-top: 12px; color: var(--body); }

/* View transitions */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: theme-ripple 380ms ease-out both; }
@keyframes theme-ripple {
  from { clip-path: circle(0 at var(--theme-origin, 50% 50%)); }
  to { clip-path: circle(var(--theme-radius, 150vmax) at var(--theme-origin, 50% 50%)); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .research-figures img, .button, .social-chip, .paper-row, .featured-card { transition: none; }
}

@media (max-width: 900px) {
  .featured-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; }
  .featured-media { margin-bottom: 0; }
  .paper-figure { height: 126px; }
  .research-card--single { grid-template-columns: minmax(0, 1fr); }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact-actions { align-items: flex-start; }
}

@media (max-width: 660px) {
  .shell { width: calc(100% - 32px); }
  .site-brand { display: none; }
  .site-nav { width: 100%; column-gap: 12px; }
  .site-nav a { font-size: .79rem; padding-block: 12px; }
  .theme-toggle { padding: 3px 7px; font-size: .74rem; }
  .site-nav .language { margin-inline-start: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 26px 24px; }
  .hero-aside { width: min(100%, 320px); }
  .hero-portrait { width: 100%; }
  .section { padding-block: 22px 24px; }
  .featured-card { grid-template-columns: minmax(0, 1fr); }
  .paper-figure { height: 168px; }
  .background-grid, .publication-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .honors-list li { grid-template-columns: minmax(0, 4.4rem) minmax(0, 1fr); }
  .paper-row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; padding-inline: 4px; }
  .page-intro { padding-block: 16px 14px; }
  .year-nav { position: static; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
  .year-nav-heading { width: 100%; }
  .footer-inner strong, .footer-inner span { display: block; }
  .footer-updated { margin-inline-start: 0; margin-top: 2px; }
  .footer-updated::before { content: ""; }
  .back-to-top { right: 16px; bottom: 16px; width: 38px; height: 38px; }
}

@media (max-width: 390px) {
  .site-nav { column-gap: 10px; }
  .site-nav a { font-size: .78rem; }
}
