/* Academic homepage: local fonts, readable type and a compact content hierarchy. */
:root {
  color-scheme: light;
  --paper: #f8fafc;
  --surface: #ffffff;
  --ink: #213047;
  --muted: #4b5c72;
  --accent: #245c9e;
  --line: #d4dfeb;
  --soft: #edf3fa;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
[data-theme='dark'] {
  color-scheme: dark;
  --paper: #121e30;
  --surface: #18283e;
  --ink: #e8eef7;
  --muted: #b8c8dd;
  --accent: #91bcf1;
  --line: #3b506c;
  --soft: #20344f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
button { font: inherit; }
button, summary { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
p { margin: 0 0 1rem; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 600; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
::selection { background: #cfe1fa; color: #173b68; }
.wrap { width: min(1100px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; background: var(--surface); padding: 10px 16px; transform: translateY(-180%); z-index: 100; }
.skip:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: 82px; display: flex; align-items: center; gap: 24px; }
.brand { color: var(--ink); font: 1.5rem/1.3 var(--serif); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--accent); text-decoration: none; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--muted); font-size: 1rem; padding-block: 10px; text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current='location'] { color: var(--accent); border-bottom-color: var(--accent); }
.header-controls { display: flex; gap: 8px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; place-items: center; }
.icon-button:hover { border-color: var(--accent); }
.theme-toggle, .menu-toggle { display: none; }
.js-ready .theme-toggle { display: grid; }
.hero { padding: 44px 0 32px; border-bottom: 1px solid var(--line); }
.hero h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font: normal clamp(2.8rem, 5.6vw, 3.875rem)/1.15 var(--serif); letter-spacing: -.035em; margin-bottom: 12px; }
.native-name { font: normal .55em/1.4 'Songti SC', 'Noto Serif CJK SC', SimSun, serif; letter-spacing: 0; white-space: nowrap; }
.subtitle { font: normal clamp(1.45rem, 2.8vw, 1.9rem)/1.4 var(--serif); color: var(--accent); margin-bottom: 22px; }
.hero-intro { max-width: 78ch; margin-bottom: 22px; }
.hero-links, .profile-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.hero-links a { overflow-wrap: anywhere; }
.profile-links { margin-top: 16px; font-size: 1rem; }
.profile-links a { text-decoration: none; }
.profile-links a:hover { text-decoration: underline; }
.section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.section-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 28px; }
.section h2 { font: normal 2.125rem/1.25 var(--serif); letter-spacing: -.02em; }
.text-link { font-size: 1rem; }
.section-intro { margin: -6px 0 16px; color: var(--muted); }
.research-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px; }
.research-card { padding-left: 22px; border-left: 2px solid var(--accent); min-width: 0; }
.research-context { color: var(--muted); font-size: .9375rem; margin-bottom: 8px; }
.research-card h3 { font-size: 1.375rem; margin-bottom: 12px; }
.research-card > p:last-child { margin: 0; }
.publication, .patent { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.publication:first-child, .patent:first-child { padding-top: 0; }
.publication:last-child, .patent:last-child { border-bottom: 0; padding-bottom: 0; }
.pub-year { color: var(--muted); font-size: 1rem; padding-top: 3px; }
.pub-body, .patent-body { min-width: 0; }
.pub-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: .9375rem; margin-bottom: 7px; }
.author-role { color: var(--accent); border: 1px solid var(--line); border-radius: 3px; background: var(--soft); font-size: .9375rem; padding: 1px 8px; }
.pub-title, .patent-title { font: normal 1.375rem/1.45 var(--serif); margin-bottom: 10px; }
.pub-title a, .patent-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover, .patent-title a:hover { color: var(--accent); text-decoration: underline; }
.authors { font-size: 1rem; color: var(--muted); line-height: 1.75; margin-bottom: 7px; }
.authors strong { color: var(--ink); font-weight: 700; }
.journal { font-size: 1.0625rem; margin-bottom: 10px; }
.journal-metrics { font-size: 1rem; color: var(--muted); line-height: 1.75; margin-bottom: 12px; }
.journal-metrics a { color: var(--accent); }
.cv-authorship { font-size: .9375rem; color: var(--accent); font-weight: 600; margin-bottom: 3px; }
.bibtex summary { color: var(--accent); font-size: 1rem; width: fit-content; padding-block: 3px; }
.bibtex pre { margin: 14px 0 10px; padding: 18px; background: var(--soft); border: 1px solid var(--line); border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; font: .875rem/1.7 var(--mono); }
.citation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; font-size: 1rem; }
.copy-button { display: none; background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 3px; font-size: .9375rem; min-height: 44px; padding: 8px 14px; }
.js-ready .copy-button { display: inline-block; }
.copy-button:hover { background: var(--soft); }
.patent-record { font-size: 1rem; color: var(--muted); margin-bottom: 4px; }
.record-number { white-space: nowrap; }
.background-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 58px; }
.column-heading { color: var(--accent); font-size: 1.1875rem; margin-bottom: 24px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 28px 20px; position: relative; border-left: 1px solid var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: absolute; left: -4px; top: 10px; }
.timeline time { display: block; color: var(--muted); font-size: .9375rem; margin-bottom: 6px; }
.timeline h4 { font-size: 1.125rem; margin-bottom: 7px; }
.timeline .degree { font-size: 1.0625rem; margin-bottom: 6px; }
.timeline .note { font-size: 1rem; color: var(--muted); margin: 0; }
.supervisors { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 34px; }
.supervisor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.supervisor { min-width: 0; }
.supervisor :is(h3, h4) { font-size: 1.1875rem; margin-bottom: 6px; }
.supervisor-role { font-size: .9375rem; color: var(--muted); margin-bottom: 8px; }
.supervisor-email { font-size: 1rem; overflow-wrap: anywhere; }
.supervisor-links { display: flex; flex-wrap: wrap; flex-direction: column; align-items: flex-start; gap: 5px 20px; margin-top: 10px; font-size: 1rem; }
.hobby-list { max-width: 82ch; margin: 0; padding-left: 1.25em; }
.hobby-list li { padding-left: .2em; margin-bottom: 10px; }
.hobby-list li:last-child { margin-bottom: 0; }
.contact { border-bottom: 0; }
.contact-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.personal-emails { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.personal-emails a { font-size: 1.375rem; overflow-wrap: anywhere; }
.academic-emails summary { color: var(--accent); font-size: 1.0625rem; padding-block: 3px; }
.academic-email-list { margin-top: 20px; }
.academic-email { padding-bottom: 18px; }
.academic-email:last-child { padding-bottom: 0; }
.academic-email h4 { font-size: 1rem; margin-bottom: 4px; }
.academic-email a { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.guestbook { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 32px; }
.guestbook-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.guestbook-heading h3 { font: normal 1.625rem/1.3 var(--serif); }
.guestbook > p { max-width: 78ch; }
.guestbook-write { display: inline-flex; align-items: center; text-decoration: none; }
.guestbook-write:hover { text-decoration: none; filter: brightness(1.1); }
.guestbook-status { color: var(--muted); font-size: 1rem; margin: 24px 0 0; }
.guestbook-messages { list-style: none; padding: 0; margin: 0; }
.guestbook-message { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.guestbook-message h4 { font-size: 1.125rem; margin-bottom: 6px; }
.guestbook-message p { font-size: 1rem; margin-bottom: 8px; white-space: pre-line; }
.guestbook-message-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9375rem; color: var(--muted); }
.guestbook-refresh { border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--accent); font-size: 1rem; min-height: 44px; margin-top: 24px; padding: 8px 14px; }
.guestbook-refresh:disabled { cursor: progress; opacity: .7; }
.footer { border-top: 1px solid var(--line); padding-block: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: .9375rem; color: var(--muted); }
.live-message { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font-size: 1rem; padding: 12px 18px; z-index: 40; text-align: center; }
.live-message:empty { display: none; }

/* The full CV retains detailed research, teaching, skills and honours. */
.cv-page { max-width: 980px; margin: 44px auto 64px; }
.cv-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 36px; }
.button { background: var(--accent); color: var(--paper); border: 1px solid var(--accent); border-radius: 3px; font-size: 1rem; min-height: 44px; padding: 10px 16px; }
.cv-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cv-head h1 { font: normal 3.25rem/1.2 var(--serif); letter-spacing: -.025em; margin-bottom: 16px; }
.cv-head p { font-size: 1.0625rem; }
.cv-head a { overflow-wrap: anywhere; }
.cv-profiles { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 1rem; }
.cv-section { margin-top: 36px; }
.cv-section h2 { font: normal 1.875rem/1.3 var(--serif); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 24px; }
.cv-section > p { font-size: 1.0625rem; }
.cv-entry { margin-bottom: 24px; }
.cv-entry h3 { font-size: 1.125rem; margin-bottom: 6px; }
.cv-entry time { color: var(--muted); font-size: .9375rem; }
.cv-entry p { font-size: 1.0625rem; margin: 7px 0; }
.cv-list { font-size: 1.0625rem; padding-left: 24px; }
.cv-list li { margin-bottom: 16px; }
.cv-publication { line-height: 1.8; }
.cv-footnote { color: var(--muted); font-size: .9375rem; margin-top: 36px; }

@media (max-width: 980px) {
  .wrap { width: calc(100% - 48px); }
  .header-inner { flex-wrap: wrap; justify-content: space-between; gap: 0; min-height: 76px; }
  .header-controls { margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; margin: 0; padding: 4px 0 14px; flex-wrap: wrap; gap: 2px 24px; }
  .js-ready .site-nav { display: none; }
  .js-ready .site-nav.is-open { display: flex; }
  .js-ready .menu-toggle { display: grid; }
  .background-grid { gap: 32px; }
  .supervisor-grid { gap: 22px; }
  .supervisor-links { font-size: .9375rem; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 94px; }
  .hero { padding-top: 40px; }
  .research-list, .background-grid, .supervisor-grid, .contact-panel { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .supervisor { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .supervisor:last-child { padding-bottom: 0; border-bottom: 0; }
  .supervisor-links { flex-direction: row; font-size: 1rem; }
  .section { padding-block: 36px; }
  .section h2 { font-size: 1.875rem; }
  .section-top { margin-bottom: 24px; }
}
@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .wrap { width: calc(100% - 36px); }
  .brand { font-size: 1.375rem; }
  .hero { padding: 34px 0 32px; }
  .hero h1 { font-size: 3rem; }
  .subtitle { font-size: 1.5rem; }
  .hero-links, .profile-links { gap: 8px 20px; }
  .hero-links { flex-direction: column; align-items: flex-start; }
  .publication, .patent { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pub-year { padding: 0; }
  .pub-title, .patent-title { font-size: 1.3125rem; }
  .personal-emails a { font-size: 1.1875rem; }
  .bibtex pre { padding: 12px; }
  .cv-page { margin-block: 28px 44px; }
  .cv-head h1 { font-size: 2.75rem; }
  .cv-section h2 { font-size: 1.625rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  :root, [data-theme='dark'] { --paper: #fff; --surface: #fff; --ink: #111; --muted: #333; --accent: #1d4e89; --line: #ccc; --soft: #f5f5f5; }
  body { font-size: 11pt; background: #fff; }
  .wrap { width: 100%; max-width: none; }
  .site-header, .footer, .copy-button, .live-message, .cv-toolbar, .skip, .guestbook { display: none !important; }
  .hero { padding-block: 0 20px; }
  .hero h1 { font-size: 32pt; }
  .hero-intro, .section-intro, .research-card p, .cv-section > p { font-size: 11pt; }
  .section, .cv-section { margin-top: 20px; padding-block: 0 16px; }
  .section h2, .cv-section h2 { font-size: 17pt; margin-bottom: 14px; break-after: avoid; }
  .publication, .patent { padding-block: 16px; }
  .research-card, .publication, .patent, .cv-entry, .cv-publication, .timeline li, .supervisor { break-inside: avoid; }
  .pub-title, .patent-title, .research-card h3 { font-size: 12pt; }
  .authors, .journal, .journal-metrics, .patent-record, .cv-entry p, .cv-list, .cv-head p, .timeline .degree, .timeline .note { font-size: 11pt; }
  .pub-year, .pub-kicker, .author-role, .cv-authorship, .timeline time, .cv-entry time, .cv-profiles, .cv-footnote { font-size: 10pt; }
  .cv-page { margin: 0; }
  .cv-head h1 { font-size: 30pt; }
  .cv-entry { margin-bottom: 16px; }
  .cv-entry h3, .supervisor :is(h3, h4) { font-size: 11pt; }
  .supervisor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .supervisor-role, .supervisor-email, .supervisor-links { font-size: 10pt; }
  .supervisor-links { flex-direction: column; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4; margin: 17mm; }
}
