/* Thomas Zhao — an academic homepage built for reading. */
:root {
  color-scheme: light;
  --paper: #fdfdfc;
  --ink: #252b32;
  --muted: #64717b;
  --blue: #234b71;
  --blue-hover: #12334f;
  --line: #e3e7e9;
  --soft: #f2f5f7;
  --serif: Georgia, "Times New Roman", "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.77; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a { transition: color .12s ease, background-color .12s ease, border-color .12s ease; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; border-radius: 2px; }
button::-moz-focus-inner { border: 0; }
img, svg { max-width: 100%; }
img { display: block; }
svg { vertical-align: middle; }
p, h1, h2, h3, figure { margin: 0; }
p + p { margin-top: 14px; }
strong { font-weight: 600; }
::selection { background: #dce7f0; color: #152f47; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 20; top: -100px; left: 20px; padding: 8px 14px; background: var(--blue); color: #fff; }
.skip-link:focus { top: 12px; color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { max-width: 1100px; min-height: 78px; margin: 0 auto; display: flex; align-items: center; gap: 34px; }
.wordmark { display: inline-flex; align-items: center; gap: 13px; margin-right: auto; white-space: nowrap; color: var(--ink); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; }
.wordmark:hover { text-decoration: none; }
.wordmark-mark { color: var(--blue); font-family: var(--serif); font-size: 30px; font-weight: 400; letter-spacing: -.08em; line-height: 1; margin-top: -4px; }
.header-nav { display: flex; gap: 26px; align-items: center; font-size: 13px; }
.header-nav a { color: #606a74; }
.header-nav a:hover, .header-nav a[aria-current="location"] { color: var(--blue); }
.header-nav a[aria-current="location"] { text-decoration: underline; text-decoration-color: #aec0ce; }
.language-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 4px 0 4px 24px; border: 0; border-left: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--blue); white-space: nowrap; }
.language-toggle span { color: #64717b; font-size: 13px; }
.language-toggle:hover { color: var(--blue-hover); }

.page-layout { max-width: 1100px; margin: 60px auto 86px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 80px; align-items: start; }
.profile { position: sticky; top: 40px; }
.portrait { width: 180px; height: 180px; object-fit: cover; border-radius: 3px; background: #eef0f1; border: 1px solid #e2e4e6; }
.profile-name { margin: 23px 0 2px; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.25; letter-spacing: -.045em; }
.profile-role { font-size: 13px; color: #4a535b; }
.profile-affiliation { margin-top: 13px; font-size: 13px; line-height: 1.8; max-width: 215px; }
.profile-affiliation a { color: #65717b; }
.profile-affiliation a:hover { color: var(--blue); }
.profile-location { margin-top: 13px; font-size: 13px; color: #64717b; display: flex; align-items: center; gap: 6px; }
.profile-location svg { flex: 0 0 auto; }
.profile-links { max-width: 190px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.profile-links a { display: flex; align-items: center; gap: 9px; width: fit-content; font-size: 13px; line-height: 1.7; }
.profile-links svg { color: #7b8d9c; flex: 0 0 16px; }
.profile-links .link-arrow { margin-left: 3px; color: #64717b; font-size: 12px; }
.profile-note { margin-top: 26px; color: #64717b; font-size: 12px; line-height: 1.8; }
.content { min-width: 0; }

.section { margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); scroll-margin-top: 34px; }
.about-section { margin-top: 0; padding-top: 0; border: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-heading h2 { font-family: var(--serif); font-size: 29px; font-weight: 400; line-height: 1.3; letter-spacing: -.025em; color: #232c34; }
.section-aside { flex-shrink: 0; color: #64717b; font-size: 12px; letter-spacing: .04em; }
.section-link { color: var(--blue); font-size: 12px; letter-spacing: 0; }
.intro-lead { font-size: 17px; line-height: 1.8; }
.about-section > p:not(.intro-lead) { font-size: 15px; color: #59626a; line-height: 1.85; }
.intro-lead a { font-weight: 500; }
.interests-heading { margin-top: 27px; margin-bottom: 14px; font-size: 12px; color: #64717b; font-weight: 600; letter-spacing: .1em; }
.research-interests { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.research-interests li { border-left: 2px solid #dce5ec; padding-left: 12px; }
.research-interests strong { display: block; color: var(--blue); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.research-interests p { font-size: 13px; color: #64717b; line-height: 1.7; }
.section-description { margin-top: -8px; color: #64717b; font-size: 13px; line-height: 1.8; }

.project-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.project-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter { border: 0; background: transparent; color: #64717b; padding: 3px 9px; font-size: 12px; border-radius: 2px; line-height: 1.7; }
.filter:first-child { margin-left: -9px; }
.filter:hover { color: var(--blue); background: var(--soft); }
.filter.is-active { color: var(--blue); background: #eaf0f5; font-weight: 600; }
.project-count { flex-shrink: 0; font-size: 12px; color: #64717b; }
.project-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 25px; padding: 24px 0; border-bottom: 1px solid #edf0f1; align-items: start; }
.project-figure { width: 150px; min-height: 108px; margin: 2px 0 0; display: flex; align-items: center; justify-content: center; background: #f3f6f8; color: #5f7c93; border-radius: 2px; overflow: hidden; }
.project-figure svg { width: 100%; height: auto; display: block; }
.project-figure text { fill: #56748b; stroke: none; font-family: var(--sans); font-size: 9px; text-anchor: middle; letter-spacing: -.01em; }
.project-figure .diagram-caption { font-size: 8px; fill: #8799a7; }
.project-copy { min-width: 0; }
.project-meta { color: #64717b; font-size: 12px; letter-spacing: .04em; line-height: 1.5; margin-bottom: 5px; text-transform: uppercase; }
.project-meta span + span::before { content: " · "; margin: 0 4px; }
.project-title { font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.55; letter-spacing: -.01em; color: var(--blue); }
.project-title a { color: inherit; }
.project-description { color: #64717b; font-size: 14px; line-height: 1.8; margin-top: 6px; }
.project-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 9px; }
.project-links a, .project-links button { font-size: 12px; line-height: 1.7; }
.project-links button, .text-button { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; color: var(--blue); }
.project-links button:hover, .text-button:hover { color: var(--blue-hover); text-decoration: underline; text-underline-offset: 3px; }
.project-details { font-size: 13px; color: #64717b; margin-top: 13px; padding: 10px 0 2px 12px; border-left: 2px solid #dce5ec; line-height: 1.85; }
.project-details ul { margin: 0; padding-left: 16px; }
.project-details li + li { margin-top: 5px; }
.project-details p + p { margin-top: 8px; }
.more-projects { margin-top: 17px; font-size: 12px; }
.more-projects span:last-child { font-size: 13px; }
.empty-state { padding: 20px 0; font-size: 13px; color: #64717b; }

.timeline-list { display: grid; gap: 23px; }
.timeline-entry { display: grid; grid-template-columns: 122px minmax(0, 1fr); gap: 15px; }
.entry-date { color: #64717b; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.8; padding-top: 2px; }
.entry-body h3 { color: #35424d; font-size: 14px; font-weight: 600; line-height: 1.65; }
.entry-body p { color: #64717b; font-size: 14px; line-height: 1.8; margin-top: 3px; }
.entry-body .entry-detail { color: #64717b; font-size: 13px; margin-top: 5px; line-height: 1.8; }
.honor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.honor-list li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 16px; color: #64717b; font-size: 14px; line-height: 1.8; }
.honor-list time { color: #64717b; font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.contact-section > p { color: #64717b; font-size: 14px; max-width: 600px; }
.contact-line { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 13px; }
.contact-line > a { font-size: 14px; }
.contact-line .text-button { font-size: 12px; color: #64717b; padding-left: 18px; border-left: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 1100px; margin: 0 auto; min-height: 78px; display: flex; align-items: center; gap: 25px; color: #64717b; font-size: 12px; }
.footer-inner > :first-child { margin-right: auto; }
.back-top { color: #64717b; }

html[lang="zh-CN"] .section-heading h2 { font-family: var(--serif); font-size: 26px; letter-spacing: .02em; }
html[lang="zh-CN"] .intro-lead { font-size: 15px; line-height: 1.95; }
html[lang="zh-CN"] .about-section > p:not(.intro-lead) { line-height: 1.95; }
html[lang="zh-CN"] .research-interests p { line-height: 1.9; }
html[lang="zh-CN"] .project-description { line-height: 1.9; }
html[lang="zh-CN"] .profile-affiliation { line-height: 2; }

@media (max-width: 1210px) {
  .header-inner, .page-layout, .footer-inner { margin-left: 48px; margin-right: 48px; }
  .page-layout { gap: 60px; grid-template-columns: 205px minmax(0, 1fr); }
  .section-aside:not(.section-link) { display: none; }
}

@media (max-width: 1010px) {
  .header-inner, .page-layout, .footer-inner { margin-left: 36px; margin-right: 36px; }
  .page-layout { gap: 38px; grid-template-columns: 190px minmax(0, 1fr); }
  .header-nav { gap: 20px; }
  .header-inner { gap: 25px; }
  .section-aside:not(.section-link) { display: none; }
  .project-row { grid-template-columns: 125px minmax(0, 1fr); gap: 19px; }
  .project-figure { width: 125px; min-height: 98px; }
  .timeline-entry { grid-template-columns: 105px minmax(0, 1fr); gap: 12px; }
  .research-interests { gap: 17px; }
}

@media (max-width: 820px) {
  html { scroll-padding-top: 25px; }
  .header-inner, .page-layout, .footer-inner { margin-left: 32px; margin-right: 32px; }
  .header-inner { min-height: 70px; gap: 22px; }
  .wordmark { font-size: 9px; gap: 9px; }
  .wordmark-mark { font-size: 28px; }
  .header-nav { gap: 17px; font-size: 13px; }
  .language-toggle { padding-left: 17px; font-size: 13px; }
  .page-layout { display: block; margin-top: 37px; margin-bottom: 56px; }
  .profile { position: static; display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 25px; padding-bottom: 33px; margin-bottom: 32px; border-bottom: 1px solid var(--line); align-items: start; }
  .portrait { width: 120px; height: 120px; grid-row: 1 / 3; }
  .profile-identity { grid-column: 2; }
  .profile-name { margin-top: -4px; font-size: 29px; }
  .profile-role { font-size: 13px; }
  .profile-affiliation { margin-top: 8px; max-width: none; font-size: 13px; }
  .profile-affiliation br { display: none; }
  .profile-affiliation a:first-child::after { content: " · "; color: #a2aab0; }
  .profile-location { margin-top: 8px; font-size: 13px; }
  .profile-links { grid-column: 2; max-width: none; display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 13px; padding-top: 0; border: 0; }
  .profile-links a { font-size: 13px; gap: 6px; }
  .profile-links svg { width: 14px; height: 14px; flex-basis: 14px; }
  .profile-links .link-arrow { display: none; }
  .profile-note { display: none; }
  .content { max-width: none; }
  .section-heading h2 { font-size: 28px; }
  .section { margin-top: 34px; padding-top: 27px; }
  .about-section { margin-top: 0; padding-top: 0; }
  .section-heading { margin-bottom: 16px; }
  .intro-lead { font-size: 16px; }
  .about-section > p:not(.intro-lead) { font-size: 14px; }
  .research-interests { gap: 22px; }
  .project-row { grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
  .project-figure { width: 150px; min-height: 108px; }
  .timeline-entry { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
  .footer-inner { min-height: 70px; gap: 20px; }
}

@media (max-width: 600px) {
  .header-inner, .page-layout, .footer-inner { margin-left: 24px; margin-right: 24px; }
  .header-nav { gap: 15px; }
  .header-nav a:nth-child(n+3) { display: none; }
  .header-inner { gap: 19px; min-height: 65px; }
  .language-toggle { padding-left: 16px; }
  .wordmark { font-size: 8px; letter-spacing: .11em; }
  .wordmark-mark { font-size: 26px; }
  .profile { column-gap: 22px; padding-bottom: 28px; margin-bottom: 28px; }
  .profile-affiliation br { display: initial; }
  .profile-affiliation a:first-child::after { content: none; }
  .research-interests { gap: 17px; }
  .project-row { grid-template-columns: 1fr; gap: 0; }
  .project-figure { display: none; }
  .project-title { font-size: 16px; }
  .project-description { font-size: 14px; }
  .project-meta { font-size: 12px; }
  .project-details { font-size: 14px; }
  .entry-body .entry-detail { font-size: 14px; }
  .contact-line .text-button { font-size: 14px; }
  .timeline-entry { grid-template-columns: 98px minmax(0, 1fr); gap: 15px; }
  .footer-inner { flex-wrap: wrap; gap: 4px 18px; padding: 18px 0; min-height: 75px; line-height: 1.7; }
  .footer-inner > :first-child { flex-basis: calc(50% - 18px); }
  .footer-inner > :nth-child(2) { text-align: right; }
  .back-top { margin-left: auto; }
}

@media (max-width: 520px) {
  .header-inner, .page-layout, .footer-inner { margin-left: 22px; margin-right: 22px; }
  .header-inner { gap: 15px; }
  .wordmark { gap: 8px; }
  .header-nav { gap: 14px; font-size: 13px; }
  .language-toggle { padding-left: 13px; gap: 7px; font-size: 13px; }
  .page-layout { margin-top: 29px; }
  .profile { grid-template-columns: 96px minmax(0, 1fr); column-gap: 20px; }
  .portrait { width: 96px; height: 96px; }
  .profile-name { font-size: 27px; }
  .profile-role { font-size: 13px; }
  .profile-affiliation { font-size: 13px; line-height: 1.7; margin-top: 6px; }
  .profile-location { font-size: 13px; margin-top: 7px; }
  .profile-links { grid-column: 1 / -1; justify-content: flex-start; gap: 14px 20px; margin-top: 18px; }
  .profile-links a { font-size: 14px; }
  .section-heading { gap: 12px; }
  .section-heading h2 { font-size: 27px; }
  html[lang="zh-CN"] .section-heading h2 { font-size: 24px; }
  .intro-lead { font-size: 15px; line-height: 1.85; }
  html[lang="zh-CN"] .intro-lead { font-size: 14px; }
  .about-section > p:not(.intro-lead) { font-size: 14px; }
  .research-interests { display: grid; grid-template-columns: 1fr; gap: 13px; }
  .research-interests li { padding-left: 11px; }
  .research-interests strong { font-size: 14px; margin-bottom: 1px; }
  .research-interests p { font-size: 13px; }
  .interests-heading { margin-top: 22px; margin-bottom: 13px; }
  .section-description { font-size: 14px; }
  .project-toolbar { gap: 7px; margin-top: 18px; flex-wrap: wrap; }
  .project-filters { gap: 3px; }
  .filter { padding: 3px 8px; font-size: 12px; }
  .filter:first-child { margin-left: -8px; }
  .project-count { font-size: 12px; margin-left: auto; }
  .project-row { grid-template-columns: 1fr; gap: 0; padding: 21px 0; }
  .project-meta { font-size: 12px; letter-spacing: .04em; margin-bottom: 5px; }
  .project-title { font-size: 16px; line-height: 1.6; }
  .project-description { font-size: 14px; line-height: 1.8; }
  .project-links { gap: 11px; margin-top: 7px; }
  .project-links a, .project-links button { font-size: 13px; }
  .project-details { font-size: 14px; padding-left: 9px; }
  .timeline-entry { grid-template-columns: 1fr; gap: 4px; }
  .timeline-list { gap: 24px; }
  .entry-date { font-size: 12px; }
  .entry-body h3 { font-size: 16px; }
  .entry-body p { font-size: 14px; }
  .entry-body .entry-detail { font-size: 14px; }
  .honor-list li { grid-template-columns: 35px minmax(0, 1fr); gap: 12px; font-size: 14px; }
  .honor-list time { font-size: 12px; }
  .contact-section > p { font-size: 14px; }
  .contact-line > a { font-size: 14px; }
  .contact-line { gap: 14px; }
  .contact-line .text-button { padding-left: 14px; }
  .footer-inner { font-size: 12px; }
}

@media (max-width: 370px) {
  .header-inner, .page-layout, .footer-inner { margin-left: 18px; margin-right: 18px; }
  .wordmark > span:not(.wordmark-mark) { display: none; }
  .header-nav { margin-left: auto; gap: 18px; }
  .wordmark { margin-right: 0; }
  .profile { column-gap: 16px; }
  .profile-name { font-size: 25px; }
  .profile-links { gap: 15px; }
  .project-row { grid-template-columns: 1fr; gap: 13px; }
  .project-title { font-size: 16px; }
  .project-description { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  body { background: #fff; font-size: 10pt; color: #000; }
  .site-header, .project-toolbar, .more-projects, .text-button, .back-top, .skip-link, .profile-note { display: none !important; }
  .page-layout { max-width: none; margin: 0; grid-template-columns: 155px minmax(0, 1fr); gap: 28px; }
  .profile { position: static; }
  .portrait { width: 130px; height: 130px; }
  .profile-name { font-size: 23px; }
  .section { margin-top: 20px; padding-top: 20px; }
  .about-section { margin-top: 0; padding-top: 0; }
  .section-heading h2 { font-size: 22px; }
  .project-row, .timeline-entry { break-inside: avoid; }
  .project-row { grid-template-columns: 110px minmax(0, 1fr); gap: 18px; padding: 16px 0; }
  .project-figure { width: 110px; min-height: 75px; }
  .project-figure { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-footer { margin-top: 20px; }
  .footer-inner { min-height: 40px; margin: 0; }
  a { color: #234b71; }
}
