@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&family=LXGW+WenKai+TC:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --background: #faf9f6;
  --surface: #ffffff;
  --ink: #202b36;
  --body: #4d5964;
  --muted: #6f7982;
  --accent: #2d718e;
  --accent-soft: #eaf2f5;
  --border: #e6e7e4;
  --border-hover: #b9cfd9;
  --header-background: rgba(250, 249, 246, .96);
  --header-translucent: rgba(250, 249, 246, .88);
  --surface-hover: #fefefe;
  --accent-hover: #235b73;
  --shadow-card: 0 2px 8px #293b4703;
  --shadow-hover: 0 4px 18px #293b4708;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--body);
  background: var(--background);
  scroll-behavior: smooth;
  scroll-padding-top: 98px;
  scrollbar-gutter: stable;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0f0f17;
  --surface: #18182a;
  --ink: #e2e8f0;
  --body: #94a3b8;
  --muted: #64748b;
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, .08);
  --border: rgba(255, 255, 255, .06);
  --border-hover: rgba(99, 102, 241, .4);
  --surface-hover: #1e1e34;
  --accent-hover: #a5b4fc;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, .4);
  --header-background: rgba(15, 15, 23, .96);
  --header-translucent: rgba(15, 15, 23, .8);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; color: var(--accent-hover); }
body, .site-header, .publication-card, .experience-card, .figure-dialog { transition: background-color .3s ease, color .3s ease, border-color .3s ease; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
::selection { background: #d8e9ef; color: #183949; }
img { display: block; max-width: 100%; }
svg { display: block; }
p, h1, h2, h3, figure { margin: 0; }
strong { color: var(--ink); font-weight: 600; }
[hidden] { display: none !important; }
html:not([lang="zh-CN"]) .lang-zh,
html[lang="zh-CN"] .lang-en { display: none !important; }
.page-shell, .nav-shell { width: min(100% - 64px, 940px); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 20;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--surface);
}
.skip-link:focus { top: 12px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--header-background);
}
@supports (backdrop-filter: blur(12px)) {
  .site-header { background: var(--header-translucent); backdrop-filter: blur(12px); }
}
.nav-shell { min-height: 70px; display: flex; gap: 28px; align-items: center; }
.wordmark { font: 600 23px var(--serif); color: var(--ink); white-space: nowrap; }
.wordmark .lang-zh { font-family: "LXGW WenKai TC", "Songti SC", SimSun, serif; }
.wordmark:hover { text-decoration: none; }
.wordmark-dot { color: var(--accent); }
nav { display: flex; gap: 24px; align-items: center; margin-left: auto; }
nav a { font-size: 12.5px; font-weight: 500; color: var(--body); padding-block: 12px; white-space: nowrap; }
nav a:hover { color: var(--accent); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-toggle, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.language-toggle:hover, .theme-toggle:hover { background: var(--accent-soft); border-color: var(--border-hover); }
.theme-toggle { min-width: 36px; width: 36px; height: 36px; border-radius: 50%; padding: 0; font-size: 17px; }
[data-theme="light"] .theme-moon, [data-theme="dark"] .theme-sun { display: none; }
.language-toggle svg, .social-links svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 206px; gap: 62px; padding: 76px 0 54px; align-items: start; }
.eyebrow { margin-bottom: 18px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
h1 { font: 700 54px/1.15 var(--serif); color: var(--ink); letter-spacing: -1.5px; }
.chinese-name { display: inline-block; font: 400 26px/1.4 "LXGW WenKai TC", "Songti SC", SimSun, serif; color: var(--muted); letter-spacing: 3px; margin-left: 12px; vertical-align: middle; }
.position { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 13px; margin-bottom: 23px; }
.bio { font-size: 14px; line-height: 1.85; }
.bio p + p { margin-top: 13px; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  color: var(--body);
  font-size: 12px;
  background: var(--surface);
}
.social-links a:hover { color: var(--accent); border-color: var(--border-hover); text-decoration: none; background: var(--surface); }
.portrait { padding-top: 24px; }
.portrait img { width: 206px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; box-shadow: 0 7px 24px #182b3710; }
.portrait figcaption { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 15px; font-size: 11px; color: var(--muted); letter-spacing: .2px; }
.location-dot { width: 5px; height: 5px; border-radius: 50%; background: #7b9e90; }

.section { padding: 32px 0 13px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
h2 { display: flex; align-items: baseline; gap: 11px; font: 500 28px/1.3 var(--serif); color: var(--ink); letter-spacing: -.3px; }
.section-mark { font-family: var(--sans); font-size: 19px; font-weight: 400; color: #91b4c3; letter-spacing: -2px; }
.section-link { font-size: 11px; white-space: nowrap; }
.section-link span { margin-left: 3px; }
.section-note { color: var(--muted); font-size: 11px; margin-top: -9px; margin-bottom: 18px; }
.news-section { padding-top: 27px; border-top: 1px solid var(--border); }
.news-list { padding: 0; margin: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 9px 0; font-size: 13px; }
.news-list time { padding-top: 2px; font-family: var(--mono); color: var(--muted); font-size: 11px; }

.publication-list { display: grid; gap: 16px; }
.publication-card {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color .2s, box-shadow .2s;
}
.publication-card:hover { background: var(--surface-hover); border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.paper-figure { display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 12px 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); width: 100%; cursor: zoom-in; }
.paper-figure:disabled { cursor: default; }
.paper-figure img { width: 100%; height: auto; max-height: 155px; object-fit: contain; background: #fff; border-radius: 4px; }
.paper-figure:hover { text-decoration: none; border-color: var(--border-hover); }
.figure-caption { font-size: 10px; color: var(--muted); }
.paper-figure:hover .figure-caption { color: var(--accent); }
.venue { display: inline-block; padding: 5px 11px; color: #276d80; background: #eaf4f5; border: 1px solid #dcebee; border-radius: 6px; font-size: 12px; line-height: 1.5; font-weight: 650; margin-bottom: 11px; letter-spacing: .2px; }
.venue-purple { color: #655d8b; background: #f0edf8; border-color: #e8e2f3; }
.venue-preprint { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.venue-neurips { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
[data-theme="dark"] .venue { color: #abd9e8; background: #203241; border-color: #345466; }
[data-theme="dark"] .venue-preprint { background: rgba(100, 116, 139, .1); color: #94a3b8; border-color: rgba(100, 116, 139, .2); }
[data-theme="dark"] .venue-neurips { background: rgba(37, 99, 235, .1); color: #93c5fd; border-color: rgba(37, 99, 235, .25); }
[data-theme="dark"] .venue-purple { background: rgba(124, 58, 237, .1); color: #c4b5fd; border-color: rgba(124, 58, 237, .25); }
[data-theme="dark"] .topic-tags > span { background: #25253d; color: #b7c3d5; }
[data-theme="dark"] .education-logo { background: #e8eaf0; }
h3 { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.paper-copy h3 { font-size: 16px; }
.paper-copy h3 a { color: var(--ink); }
.paper-copy h3 a:hover { color: var(--accent); text-decoration: none; }
.authors { margin-top: 9px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.authors strong { color: var(--ink); }
.paper-summary { font-size: 12px; margin-top: 8px; line-height: 1.75; }
.paper-links { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 12px; }
.paper-links a { font-size: 11px; font-weight: 600; }
.paper-links a span[aria-hidden] { font-size: 12px; margin-left: 2px; }

.experience-card { display: flex; gap: 25px; padding: 25px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.company-logo { width: 64px; min-width: 64px; height: 70px; display: grid; place-items: center; background: #f5faff; border-radius: 10px; }
.company-logo img { width: 34px; height: auto; }
[data-theme="dark"] .company-logo { background: rgba(129, 140, 248, .08); }
.experience-copy { flex: 1; min-width: 0; }
.entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.entry-date { flex-shrink: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.entry-role { margin-top: 4px; font-size: 12.5px; }
.experience-copy > p:not(.entry-role) { margin-top: 12px; font-size: 13px; line-height: 1.8; }
.internship-projects { margin: 14px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.internship-projects li + li { margin-top: 12px; }
.internship-projects li::marker { color: var(--accent); }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.topic-tags > span { padding: 3px 8px; border-radius: 4px; background: #f3f5f6; color: #64717d; font-size: 10px; }
.education-entry { display: flex; gap: 20px; padding: 20px 0; }
.education-entry:first-child { padding-top: 3px; }
.education-entry + .education-entry { border-top: 1px solid var(--border); }
.education-logo { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; padding: 4px; border-radius: 8px; }
.education-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.entry-body { flex: 1; min-width: 0; }
.education-entry h3 { font-size: 14px; max-width: 480px; }
.entry-detail { margin-top: 4px; font-size: 12px; color: var(--muted); }
.detail-divider { margin-inline: 8px; color: #a2adb3; }
.honors-section { padding-bottom: 51px; }
.honors-list { margin: 0; padding: 0; list-style: none; }
.honors-list li { display: flex; align-items: baseline; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.honors-list li:last-child { border-bottom: 0; }
.award-symbol { color: #ab976c; font-size: 21px; line-height: 1; }
.honors-list strong { font-weight: 500; }
.award-detail { margin-left: 13px; font-size: 11px; color: var(--muted); }
.honors-list time, .award-years { margin-left: auto; white-space: nowrap; font-size: 11px; color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-block: 23px 30px; font-size: 11px; color: var(--muted); }
.site-footer a { color: var(--muted); }
html[lang="zh-CN"] .bio { line-height: 2; }
html[lang="zh-CN"] .position { font-family: var(--sans); font-size: 14px; letter-spacing: .04em; }
html[lang="zh-CN"] h2 { font-family: "LXGW WenKai TC", "Songti SC", SimSun, serif; font-size: 26px; }
html[lang="zh-CN"] .eyebrow { letter-spacing: 2px; }
html[lang="zh-CN"] .entry-role { letter-spacing: .3px; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.activity-list li:first-child { padding-top: 0; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list h3 { font-size: 14px; }

.figure-modal-open { overflow: hidden; }
.figure-dialog {
  width: min(96vw, 1600px);
  max-width: 96vw;
  max-height: 94vh;
  max-height: 94svh;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--body);
  background: var(--surface);
  box-shadow: 0 24px 90px #0005;
}
.figure-dialog::backdrop { background: #080c18cc; backdrop-filter: blur(4px); }
.figure-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.figure-toolbar h2 { font: 600 17px/1.5 var(--sans); letter-spacing: 0; }
.figure-heading { min-width: 0; }
.figure-heading .venue { margin-bottom: 8px; }
.figure-actions { display: flex; gap: 8px; flex-shrink: 0; }
.figure-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: var(--accent-soft); font: 500 14px/1 var(--sans); letter-spacing: .01em; cursor: pointer; }
.figure-actions button svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.figure-actions button:hover { border-color: var(--border-hover); }
.figure-scroll { overflow: auto; max-height: 72vh; max-height: 72svh; border-radius: 7px; background: #fff; overscroll-behavior: contain; }
.figure-scroll img { width: auto; height: auto; max-width: 100%; max-height: 70vh; max-height: 70svh; margin: auto; object-fit: contain; }
html[lang="zh-CN"] .figure-toolbar h2 { font: 600 17px/1.5 var(--sans); }

.scroll-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease, background-color .3s ease, color .3s ease, border-color .3s ease;
}
.scroll-reveal.is-visible { opacity: 1; transform: none; }
.scroll-reveal:focus-within { opacity: 1; transform: none; transition: none; }
@media print {
  .scroll-reveal { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 1400px) {
  .hero { padding-top: 88px; }
}
@media (max-width: 860px) {
  .nav-shell { gap: 18px; }
  nav { gap: 15px; }
  .hero { gap: 35px; grid-template-columns: minmax(0, 1fr) 176px; }
  .portrait img { width: 176px; }
  h1 { font-size: 46px; }
  .chinese-name { font-size: 23px; margin-left: 7px; }
  .publication-card { grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 20px; }
  .entry-heading { gap: 10px; }
  .education-entry .entry-heading { flex-wrap: wrap; gap: 3px 15px; }
}
@media (max-width: 1000px) {
  :root { scroll-padding-top: 118px; }
  .nav-shell { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; padding-top: 14px; }
  .wordmark { font-size: 22px; }
  .nav-actions { grid-column: 2; grid-row: 1; }
  .language-toggle { min-height: 34px; }
  nav { grid-column: 1 / -1; grid-row: 2; width: 100%; overflow-x: auto; margin: 3px 0 0; gap: 23px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { font-size: 11px; white-space: nowrap; padding-block: 10px 12px; }
}
@media (max-width: 740px) {
  .page-shell, .nav-shell { width: calc(100% - 40px); }
  .hero { display: flex; flex-direction: column; gap: 28px; padding: 34px 0 35px; }
  .portrait { order: -1; align-self: center; padding: 0; }
  .portrait img { width: 136px; border-radius: 10px; }
  .portrait figcaption { font-size: 10px; margin-top: 10px; }
  .eyebrow { font-size: 9px; letter-spacing: 1px; margin-bottom: 13px; }
  h1 { font-size: 44px; }
  .chinese-name { font-size: 24px; }
  .position { font-family: var(--mono); font-size: 12px; margin: 10px 0 18px; }
  .bio { font-size: 13px; }
  .social-links { margin-top: 20px; gap: 7px; }
  .social-links a { padding: 5px 9px; font-size: 11px; }
  .section { padding-top: 28px; }
  .section-heading { gap: 10px; margin-bottom: 18px; }
  h2 { font-size: 25px; gap: 9px; }
  .section-link { font-size: 10px; }
  .news-list li { grid-template-columns: 61px 1fr; gap: 9px; font-size: 12px; }
  .news-list time { font-size: 10px; }
  .publication-card { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; }
  .paper-figure img { height: auto; max-height: 230px; }
  .paper-copy h3 { font-size: 15px; }
  .experience-card { gap: 14px; padding: 20px 16px; }
  .company-logo { min-width: 40px; width: 40px; height: 48px; border-radius: 7px; }
  .company-logo img { width: 24px; }
  .entry-heading { flex-wrap: wrap; gap: 4px 15px; }
  .entry-date { font-size: 10px; }
  .experience-copy > p:not(.entry-role) { font-size: 12px; }
  .internship-projects { font-size: 12px; }
  .entry-role { font-size: 12px; }
  .topic-tags > span { font-size: 9px; }
  .education-entry { gap: 13px; }
  .education-logo { width: 38px; height: 38px; padding: 3px; }
  .education-entry h3 { font-size: 13px; }
  .award-detail { display: block; margin: 2px 0 0; }
  .honors-list li { font-size: 12px; gap: 11px; }
  .honors-list time, .award-years { font-size: 10px; }
  .honors-section { padding-bottom: 35px; }
  .activity-list li { gap: 12px; }
  .activity-list h3 { font-size: 13px; }
  .figure-dialog { padding: 16px; }
  .figure-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .figure-toolbar h2, html[lang="zh-CN"] .figure-toolbar h2 { font-size: 14px; }
  .figure-scroll { max-height: 65vh; max-height: 65svh; }
  .figure-scroll img { max-height: 63vh; max-height: 63svh; }
}
@media (max-width: 360px) {
  nav { gap: 17px; }
  .page-shell, .nav-shell { width: calc(100% - 32px); }
  .section-link { font-size: 9px; }
  h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .scroll-reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition: none !important; }
}
