/* ---------- tokens ---------- */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d2327;
  --muted: #5f6b73;
  --line: #e4e1d9;
  --accent: #0f5e6b;
  --accent-soft: #e3f0f1;
  --clinical: #8a4b12;
  --clinical-soft: #f6eadb;
  --other: #4b5563;
  --other-soft: #eceef0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #12171a; --surface: #1a2125; --text: #e6e9ea; --muted: #9aa6ad; --line: #2b353b;
  --accent: #6cc3cf; --accent-soft: #17343a;
  --clinical: #e0a868; --clinical-soft: #3a2a17;
  --other: #b3bcc3; --other-soft: #262e33;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171a; --surface: #1a2125; --text: #e6e9ea; --muted: #9aa6ad; --line: #2b353b;
    --accent: #6cc3cf; --accent-soft: #17343a;
    --clinical: #e0a868; --clinical-soft: #3a2a17;
    --other: #b3bcc3; --other-soft: #262e33;
  }
}

/* ---------- language switch ---------- */
html[data-lang="en"] .zh, html[data-lang="zh"] .en { display: none !important; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased;
}
html[data-lang="zh"] body { line-height: 1.85; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.6rem; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3.sub { font-size: 1.15rem; margin: 36px 0 12px; }
section { margin: 64px 0; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 20; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-family: var(--serif); font-weight: 600; color: var(--text); white-space: nowrap; }
.nav nav { display: flex; gap: 18px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { color: var(--muted); font-size: .93rem; white-space: nowrap; }
.nav nav a:hover { color: var(--accent); text-decoration: none; }
.tools { display: flex; gap: 6px; }
.tools button {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; cursor: pointer; min-height: 30px;
}
.tools button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- hero ---------- */
.hero { display: flex; gap: 36px; align-items: center; margin: 56px 0 32px; }
.photo {
  position: relative; flex: 0 0 190px; width: 190px; aspect-ratio: 4 / 5; border-radius: 16px;
  overflow: hidden; background: var(--accent-soft); display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 6px var(--surface), 0 0 0 7px var(--line);
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.initials { font: 600 3.4rem var(--serif); color: var(--accent); }
h1 { font-size: 2.4rem; margin: 0 0 6px; letter-spacing: -.01em; }
.alt-name { font-size: 1.5rem; color: var(--muted); font-weight: 400; margin-left: 6px; white-space: nowrap; }
.role { margin: 0 0 14px; color: var(--muted); }
.pitch { margin: 0 0 18px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; }
.pitch em { color: var(--accent); font-style: italic; }
html[data-lang="zh"] .pitch em { font-style: normal; font-weight: 600; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.links a {
  display: inline-block; font-size: .9rem; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- callout ---------- */
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.callout summary { cursor: pointer; padding: 12px 18px; font-weight: 600; color: var(--accent); }
.callout-body { padding: 0 18px 14px; font-size: .97rem; }
.callout-body p { margin: 0; }

#about { margin: 36px 0 0; }
#about p { margin: 0; }

/* ---------- research cards ---------- */
.lede { color: var(--muted); margin: -6px 0 20px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px;
  display: flex; flex-direction: column;
}
.card-num { font: 600 .85rem var(--serif); color: var(--accent); letter-spacing: .08em; }
.card h3 { margin: 4px 0 8px; font-size: 1.25rem; }
.card p { margin: 0 0 12px; font-size: .93rem; line-height: 1.6; }
.card .card-ref { margin: auto 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }

/* ---------- news & timelines ---------- */
.news, .timeline, .pubs, .plain { list-style: none; margin: 0; padding: 0; }
.news li, .timeline li { display: grid; grid-template-columns: 108px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.news li:last-child, .timeline li:last-child { border-bottom: 0; }
.news li[hidden] { display: none; }
time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; padding-top: 2px; }
.more { margin-top: 10px; font: inherit; font-size: .9rem; color: var(--accent); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.more:hover { text-decoration: underline; }
.plain li { padding: 5px 0 5px 18px; position: relative; }
.plain li::before { content: ""; position: absolute; left: 2px; top: 1em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  font: inherit; font-size: .88rem; padding: 4px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.filters .count { opacity: .65; font-size: .8em; margin-left: 2px; }
.pubs li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.pubs li:target .pub-title { color: var(--accent); }
.badge {
  justify-self: start; align-self: start; margin-top: 3px; font-size: .76rem; font-weight: 600; line-height: 1.3;
  padding: 4px 10px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
}
.badge.clinical { background: var(--clinical-soft); color: var(--clinical); }
.badge.other { background: var(--other-soft); color: var(--other); }
.pub-title { font-weight: 600; line-height: 1.45; }
.pub-authors { font-size: .93rem; color: var(--muted); margin-top: 3px; }
.pub-authors .me { color: var(--text); }
.pub-venue { font-size: .9rem; font-style: italic; color: var(--muted); }
.pub-links { font-style: normal; margin-left: 10px; }
.pub-links a { margin-right: 10px; font-weight: 600; }
.pub-links a::before { content: "["; } .pub-links a::after { content: "]"; }
.note { font-size: .85rem; color: var(--muted); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 48px; font-size: .88rem; color: var(--muted); }
.foot p { margin: 4px 0; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .brand { display: none; }
  .nav nav { margin-left: 0; flex: 1; }
  .hero { flex-direction: column; text-align: center; gap: 22px; margin-top: 36px; }
  .photo { flex-basis: auto; width: 150px; }
  h1 { font-size: 1.9rem; }
  .alt-name { display: block; margin: 2px 0 0; font-size: 1.25rem; }
  .links { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .news li, .timeline li, .pubs li { grid-template-columns: 1fr; gap: 4px; }
  section { margin: 48px 0; }
}
@media print {
  .nav, .callout, .filters, .more { display: none; }
  body { background: #fff; font-size: 11pt; }
}
