/* ---------- Tokens ---------- */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1b1a17;
  --body: #3a3833;
  --muted: #7d7a72;
  --line: #e4e2da;
  --accent: #9a3b3b;
  --accent-hover: #7d2c2c;
  --accent-soft: #f4e7e4;
  --chip: #efede6;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 4px 16px rgba(27, 26, 23, .05);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1b1b19;
    --ink: #f2f1ec;
    --body: #d6d4cc;
    --muted: #8f8d86;
    --line: #2c2c2a;
    --accent: #e3948a;
    --accent-hover: #f0b2aa;
    --accent-soft: #2f2120;
    --chip: #252523;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1b1b19;
  --ink: #f2f1ec;
  --body: #d6d4cc;
  --muted: #8f8d86;
  --line: #2c2c2a;
  --accent: #e3948a;
  --accent-hover: #f0b2aa;
  --accent-soft: #2f2120;
  --chip: #252523;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

strong { color: var(--ink); font-weight: 600; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--chip); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 190px; gap: 48px; align-items: center; padding: 64px 0 40px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.hero h1 .cn { font-size: 26px; font-weight: 400; color: var(--muted); margin-left: 10px; letter-spacing: .04em; }
.role { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.hero p { margin: 0 0 14px; }

.photo {
  width: 190px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: block;
}

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--surface); }
.email { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); padding: 7px 4px; }
.email svg { width: 15px; height: 15px; }

/* ---------- Sections ---------- */
section { padding: 36px 0 12px; }
section > h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lead { margin: 0 0 18px; }

/* Research */
.interests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.interests li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
}
.interests .num { display: block; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .08em; margin-bottom: 6px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.news li:last-child { border-bottom: 0; }
.news time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; white-space: nowrap; }
.more { margin-top: 4px; }
.more summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding: 8px 0;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; font-weight: 600; width: 12px; }
.more[open] summary::before { content: "−"; }
.more[open] summary .closed, .more:not([open]) summary .opened { display: none; }

/* Publications */
.filter { display: inline-flex; background: var(--chip); border-radius: 8px; padding: 3px; font-family: var(--sans); }
.filter button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.filter button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 6px;
}
.group:first-of-type .group-title { margin-top: 4px; }

.pub { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.group:last-of-type .pub:last-child { border-bottom: 0; }
.venue { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 2px; }
.badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.plain { background: var(--chip); color: var(--muted); }
.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
}
.venue .sub { font-size: 12px; color: var(--muted); line-height: 1.4; }

.pub h3 { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.4; margin: 0 0 4px; }
.authors { font-size: 14.5px; color: var(--body); margin: 0 0 8px; }
.authors strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.authors .note { color: var(--muted); font-size: 13px; }
.plinks { display: flex; flex-wrap: wrap; gap: 6px; }
.plinks a {
  font-size: 12.5px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--body);
  background: var(--surface);
}
.plinks a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.pubs.first-only .pub:not([data-first]) { display: none; }
.pubs.first-only .group:not(:has(.pub[data-first])) { display: none; }

/* Awards & services */
.awards { list-style: none; margin: 0; padding: 0; }
.awards li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.awards li:last-child { border-bottom: 0; }
.awards .where { color: var(--muted); font-weight: 400; }
.awards time { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; }
.services p { margin: 0 0 8px; }

/* Footer */
footer { margin-top: 48px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .brand { display: none; }
  .topbar .wrap { justify-content: center; }
  .nav { justify-content: center; gap: 0; flex-wrap: nowrap; }
  .nav a { font-size: 13px; padding: 6px 7px; }

  .hero { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 24px; }
  .hero .photo-wrap { order: -1; }
  .photo { width: 120px; }
  .hero h1 { font-size: 34px; }
  .hero h1 .cn { font-size: 21px; display: inline-block; margin-left: 6px; }

  section > h2 { font-size: 24px; }
  .interests { grid-template-columns: 1fr; }
  .news li { grid-template-columns: 1fr; gap: 0; }
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .venue { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .awards li { flex-direction: column; gap: 0; }
}
