:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #171717;
  --muted: #6f6f6f;
  --line: #e7e7e3;
  --accent: #2f5cff;
  --accent-soft: #eaf0ff;
  --shadow: 0 14px 40px rgba(20, 20, 20, 0.06);
  --radius: 20px;
  --max: 1120px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #151821;
  --text: #f4f5f7;
  --muted: #a6abba;
  --line: #252a36;
  --accent: #7a9cff;
  --accent-soft: #1b274d;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); z-index: 30; padding: 8px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-links { display: flex; align-items: center; gap: 26px; color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.mobile-toggle { display: none; }

.hero {
  padding: 88px 0 52px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .75fr);
  align-items: center;
  gap: 56px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 20px;
}

.hero h1, .page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.8rem, 7vw, 5.9rem);
  line-height: .98;
  letter-spacing: -0.055em;
}

.hero .lead {
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  color: var(--muted);
  max-width: 760px;
  margin: 0 0 26px;
}

.hero .lead strong { color: var(--text); }
.hero h1.person-name, .page-hero h1.person-name { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.25; letter-spacing: -.025em; }
.chinese-name { display: block; font-size: inherit; line-height: inherit; letter-spacing: 0; margin-top: .15em; }
.hero-affiliation { color: var(--muted); font-weight: 700; margin: 0 0 20px; }
.hero > *, .cv-grid > *, .cards-3 > * { min-width: 0; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  transition: transform .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }

.portrait-card {
  width: 50%;
  justify-self: center;
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 45%, var(--surface)));
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px;
  box-shadow: var(--shadow);
}

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 11px;
  overflow: hidden;
  background: var(--accent-soft);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

.section { padding: 54px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.55rem); letter-spacing: -0.035em; }
.section h2.publication-category { font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.02em; }
.section-intro { color: var(--muted); max-width: 640px; margin: 6px 0 0; }
.text-link { color: var(--accent); font-weight: 750; }

.news-list { display: grid; gap: 4px; }
.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.news-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.news-item strong { font-weight: 750; }

.pub-grid { display: grid; gap: 18px; }
.pub-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.025);
}
.pub-meta { color: var(--muted); font-size: .96rem; }
.pub-card .pub-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 7px; line-height: 1.4; overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
  margin-right: 6px;
}
.pub-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.pub-links a { color: var(--accent); font-weight: 720; font-size: .94rem; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.info-card h3 { margin: 0 0 8px; letter-spacing: -0.02em; }
.info-card h2 { font-size: 1.2rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.info-card p { color: var(--muted); margin: 0; }
.info-card a, .cv-block a { overflow-wrap: anywhere; }
.profile-list { display: grid; gap: 6px; justify-items: start; }

.page-hero { padding: 76px 0 30px; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.page-hero h1.kicker { font-size: .9rem; line-height: 1.65; letter-spacing: normal; margin: 0 0 20px; }
.page-hero p { color: var(--muted); font-size: 1.18rem; max-width: 760px; }

.contact-strip {
  margin: 30px 0 70px;
  border-radius: 26px;
  padding: 28px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}
.contact-strip p { margin: 0; opacity: .78; }
.contact-strip .btn { background: var(--bg); color: var(--text); border-color: transparent; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.print-only { display: none; }
.cv-grid { display: grid; grid-template-columns: 250px 1fr; gap: 38px; }
.cv-side h3, .cv-main h3 { margin-top: 0; }
.cv-block { margin-bottom: 26px; }
.cv-block h2 { margin: 0 0 12px; font-size: 1.2rem; letter-spacing: -0.02em; }
.cv-block .supervisor { margin-top: 16px; }
.cv-block h4 { margin: 0 0 4px; }
.cv-block p { margin: 0; color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 58px; }
  .portrait-card { max-width: 195px; }
  .cards-3 { grid-template-columns: 1fr; }
  .pub-card { grid-template-columns: 1fr; }
  .cv-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .mobile-toggle { display: grid; }
}

@media (max-width: 560px) {
  .container { width: min(var(--max), calc(100% - 26px)); }
  .nav { min-height: 66px; }
  .hero { gap: 34px; padding-top: 46px; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .section { padding: 40px 0; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .contact-strip { align-items: flex-start; flex-direction: column; }
}

@media print {
  .site-header, .site-footer, .skip-link, .no-print { display: none !important; }
  :root, [data-theme="dark"] { --bg: white; --surface: white; --text: black; --muted: #444; --line: #ddd; --accent: #222; --accent-soft: #eee; }
  body { background: white; color: black; }
  .container { width: 100%; max-width: none; }
  .page-hero { padding: 0 0 18px; }
  .print-only { display: block; }
  .cv-grid { grid-template-columns: 210px 1fr; }
  .cv-block p, .page-hero p { color: #444; }
  .pub-card { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
