/* Layout "B": fixed profile sidebar + serif reading column. */
:root {
  --ink: #222222;
  --muted: #5a5a5a;
  --rule: #e4e4e4;
  --accent: #1d5f8a;
  --accent-hover: #123f5c;
  --bg: #ffffff;
  --sans: "Source Sans 3", "Helvetica Neue", Helvetica, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6e4df; --muted: #a8a5a0; --rule: #34363a; --accent: #7fb6dd; --accent-hover: #a9d0ec; --bg: #16181b; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main p a, .role a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(16px, 5vw, 64px); border-bottom: 1px solid var(--rule); }
.brand { font-size: 20px; font-weight: 700; color: var(--ink); }
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { color: var(--muted); font-size: 16px; }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.layout { display: flex; gap: 56px; max-width: 1200px; padding: 44px clamp(16px, 5vw, 64px) 32px; }
.profile { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; align-self: flex-start; position: sticky; top: 24px; }
.photo { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; }
.profile p { margin: 0; }
.name { font-size: 24px; font-weight: 700; }
.name-zh { font-size: 18px; color: var(--muted); }
.role { font-size: 15px; color: var(--muted); line-height: 1.5; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.contact li, .contact a { display: flex; gap: 10px; align-items: center; }
.contact li > span { color: var(--muted); }
.contact svg { width: 18px; height: 18px; flex-shrink: 0; }

.cv-button { align-self: flex-start; margin-top: 4px; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 6px; font-size: 15px; font-weight: 600; }
.cv-button:hover { text-decoration: none; background: var(--accent); color: var(--bg); }
main { flex: 1; min-width: 0; font-family: var(--serif); font-size: 18px; line-height: 1.65; }
main h1 { font-size: 34px; font-weight: 600; margin: 0 0 14px; line-height: 1.2; }
main h2 { font-size: 24px; font-weight: 600; margin: 36px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
main p { margin: 0 0 14px; }
.topics { margin: 0 0 14px; padding-left: 22px; }
.pub { font-size: 16px; line-height: 1.55; margin: 0 0 14px; }
.numbered .pub { padding-left: 2.2em; text-indent: -2.2em; }
.num { display: inline-block; width: 1.8em; margin-right: 0.4em; text-align: right; text-indent: 0; color: var(--muted); }
.doi { font-family: var(--sans); font-size: 14px; white-space: nowrap; }
.note { font-size: 15px; color: var(--muted); }
.more { font-family: var(--sans); font-size: 16px; }

.grant { display: flex; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.period { flex: 0 0 110px; margin: 0; font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--muted); }
.grant-title { margin: 0 0 6px; font-weight: 600; font-size: 17px; line-height: 1.45; }
.grant-title strong { font-weight: 600; }
.grant-detail { margin: 0; font-size: 15px; color: var(--muted); }

.foot { padding: 24px clamp(16px, 5vw, 64px) 40px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .layout { flex-direction: column; gap: 28px; padding-top: 28px; }
  .profile { width: auto; position: static; display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 18px; row-gap: 8px; }
  .photo { width: 110px; height: 110px; grid-row: span 2; }
  .who { align-self: end; }
  .role { grid-column: 2; align-self: start; border-bottom: 0; padding-bottom: 0; }
  .cv-button { grid-column: 1 / -1; }
  .contact { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 10px 18px; padding-top: 12px; border-top: 1px solid var(--rule); }
  main { font-size: 17px; }
  main h1 { font-size: 28px; }
  .grant { flex-direction: column; gap: 4px; }
  .period { flex-basis: auto; }
}
