:root {
  color-scheme: light;
  --ink: #24292f;
  --muted: #656d76;
  --link: #355d50;
  --line: #e6e8eb;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
p, h1, h2, h3, h4 { margin: 0; }
p + p { margin-top: 8px; }
h1 { font-size: 36px; font-weight: 650; letter-spacing: -.035em; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.4; margin-bottom: 22px; }
h3, h4 { font-size: 15px; font-weight: 600; line-height: 1.6; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.wrap { width: min(880px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; left: 20px; top: 8px; padding: 8px 12px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.header-avatar { display: block; width: 44px; height: 44px; border-radius: 10px; }
.site-header nav { display: flex; gap: 26px; font-size: 13px; }
.site-header nav a { color: var(--muted); }
.site-header nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.intro, .page-intro { padding: 44px 0 34px; }
.intro-heading { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 36px; }
.intro-identity { min-width: 0; }
.profile-portrait { display: block; width: 132px; height: auto; border-radius: 8px; }
.intro-identity > .muted { font-size: 14px; }
.interests-section h2 { margin-bottom: 12px; }
.interests-section p { max-width: 590px; color: var(--muted); }
.intro-role { margin-top: 12px; font-size: 16px; }
.intro > .muted { font-size: 14px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; font-size: 14px; }
.intro-bio { margin-top: 26px; max-width: 800px; }
.profile-section { padding: 30px 0; border-top: 1px solid var(--line); }
.section-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-topline h2 { margin: 0; }
.section-topline > a { font-size: 13px; white-space: nowrap; }
.entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.entry-heading h3 .muted { font-weight: 400; }
.entry-date { flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.entry-heading p { margin: 0; }
.experience-row + .experience-row { margin-top: 25px; }
.job-role { margin-top: 3px; font-size: 14px; }
.job-detail { color: var(--muted); font-size: 14px; margin-top: 7px; }
.highlights { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }
.highlights li + li { margin-top: 8px; }
.highlights strong { font-weight: 500; }
.internships { margin-top: 28px; }
.internships > h3 { margin-bottom: 12px; font-size: 14px; color: var(--muted); font-weight: 500; }
.internship-row { padding: 10px 0; }
.internship-row h4 { font-size: 14px; font-weight: 500; }
.internship-row p { color: var(--muted); font-size: 13px; }
.publication-row + .publication-row, .patent-row + .patent-row { margin-top: 22px; }
.publication-row h3, .patent-row h3 { font-size: 16px; }
.publication-row p, .patent-row p { font-size: 13px; margin-top: 4px; }
.authors { color: var(--muted); }
.authors strong { color: var(--ink); }
.education-row + .education-row { margin-top: 20px; }
.education-row .organization-content > p { font-size: 14px; margin-top: 3px; }
.education-row .organization-content > p.muted { font-size: 13px; }
.award-row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.award-row + .award-row { margin-top: 15px; }
.award-row h3 { font-size: 14px; font-weight: 500; }
.award-row p { font-size: 13px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: 12px; }
.site-footer a { color: var(--muted); }
.footer-emails p + p { margin-top: 4px; }
.page-intro h1 + p { margin-top: 14px; }
.page-intro > a { display: inline-block; margin-top: 14px; font-size: 14px; }
.cv-intro { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.cv-intro p { font-size: 14px; }
.print-button { background: transparent; color: var(--muted); border: 1px solid #cbd0d6; border-radius: 3px; padding: 8px 12px; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.print-button:hover { color: var(--ink); border-color: var(--ink); }
[hidden] { display: none !important; }

/* Keep institutional marks recognizable without turning the page into a grid of cards. */
.affiliation-logos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin-top: 28px;
  padding: 24px 12px 18px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.affiliation-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.affiliation-logo img { display: block; width: min(144px, 100%); height: 52px; object-fit: contain; }
.organization-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; align-items: start; }
.organization-logo { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: #fff; }
.organization-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.organization-content { min-width: 0; }
.organization-logo--chalmers { background: #472dbe; border-color: #472dbe; }
.organization-logo--bupt img, .organization-logo--microsoft img { object-fit: cover; object-position: left center; }
.internship-row { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.internship-row .organization-logo { width: 40px; height: 40px; padding: 5px; border-radius: 6px; }

@media (max-width: 640px) {
  .intro-heading { grid-template-columns: minmax(0, 1fr) 96px; align-items: start; gap: 20px; }
  .profile-portrait { width: 96px; }
  .intro-heading .profile-links { gap: 8px 16px; }

  .affiliation-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; padding: 22px 16px; }
  .organization-row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .organization-logo { width: 44px; height: 44px; padding: 5px; }
  .internship-row { grid-template-columns: 36px minmax(0, 1fr); }
  .internship-row .organization-logo { width: 36px; height: 36px; }

  .wrap { width: calc(100% - 40px); }
  .site-header { padding: 20px 0; gap: 16px; }
  .site-header nav { gap: 18px; }
  .wordmark { font-size: 13px; }
  .header-avatar { width: 36px; height: 36px; border-radius: 8px; }
  .intro, .page-intro { padding: 32px 0 28px; }
  h1 { font-size: 32px; }
  .intro-role { font-size: 15px; }
  .profile-section { padding: 26px 0; }
  .entry-heading { display: block; }
  .entry-heading .entry-date { margin-top: 2px; }
  .internship-row .entry-date { display: block; margin-top: 2px; }
  .cv-intro { display: block; }
  .print-button { margin-top: 18px; }
}

@media (max-width: 360px) {
  .intro-heading { grid-template-columns: minmax(0, 1fr) 80px; gap: 16px; }
  .profile-portrait { width: 80px; }

  .wrap { width: calc(100% - 32px); }
  .site-header nav { gap: 13px; font-size: 12px; }
}

@media print {
  .affiliation-logos { background: none; }
  .organization-row { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
  .organization-logo, .internship-row .organization-logo { width: 34px; height: 34px; padding: 3px; border: 0; }

  @page { margin: 15mm; }
  body { font-size: 10pt; line-height: 1.5; }
  .wrap { width: 100%; max-width: none; }
  .site-header, .site-footer, .print-button, .skip-link { display: none !important; }
  .page-intro { padding: 0 0 18px; }
  h1 { font-size: 25pt; }
  h2 { font-size: 14pt; margin-bottom: 12px; }
  h3, h4, .job-role, .education-row .organization-content > p { font-size: 10pt; }
  .profile-section { padding: 18px 0; }
  .entry-heading { display: flex; }
  .entry-date, .job-detail, .highlights, .cv-intro p { font-size: 9pt; }
  .experience-row + .experience-row { margin-top: 16px; }
  .internships { margin-top: 18px; }
  .internship-row { padding: 4px 0; }
  .internship-row h4, .internship-row p { font-size: 9pt; }
  .publication-row h3, .patent-row h3 { font-size: 10pt; }
  .publication-row p, .patent-row p, .education-row .organization-content > p.muted { font-size: 9pt; }
  .experience-row, .internship-row, .education-row, .publication-row, .patent-row, .award-row { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  a { color: inherit; }
}
