:root {
  --background: #ffffff;
  --display: "Crimson Text", Georgia, serif;
  --foreground: #142640;
  --body: #41516a;
  --quiet: #5c6d85;
  --accent: #225eb7;
  --line: #dce5f0;
  --hover: #eff5ff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  padding: 0 0 44px;
  background: var(--background);
  color: var(--body);
  font: 400 15px/1.65 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--foreground); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex='0']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
strong { font-weight: 600; color: var(--foreground); }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
section[id], article[id], header[id] { scroll-margin-top: 30px; }
.skip-link { position: fixed; top: 10px; left: 15px; z-index: 100; padding: 8px 14px; background: var(--accent); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.academic-page {
  width: min(960px, calc(100% - 96px));
  margin-inline: auto;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 0 17px;
  border-bottom: 1px solid var(--line);
}
.name-signature {
  color: var(--foreground);
  font: 500 20px/1.4 "Songti SC", SimSun, serif;
  letter-spacing: .16em;
  white-space: nowrap;
}
.section-nav, .profile-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.section-nav a { color: var(--body); font-size: 13px; padding: 4px 0; }
.section-nav a[aria-current='location'] { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.biography-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  grid-template-areas: "identity portrait" "bio portrait";
  column-gap: clamp(28px, 4.5vw, 68px);
  align-items: center;
  padding-block: clamp(32px, 4.4vw, 64px) clamp(32px, 4vw, 58px);
}
.identity { grid-area: identity; }
.personal-header h1 {
  font: 600 clamp(50px, 5.1vw, 74px)/1.04 var(--display);
  letter-spacing: -.035em;
}
.affiliation { margin-top: 12px; color: var(--accent); font-size: 14px; font-weight: 500; }
.biography { grid-area: bio; max-width: 60ch; }
.biography p { font-size: 15px; line-height: 1.73; margin-top: 15px; }
.biography a:not(.profile-links a), .news-list a { text-decoration: underline; text-decoration-color: #a9c3e5; text-underline-offset: 3px; }
.profile-links { gap: 8px 21px; margin-top: 20px; }
.profile-links a { color: var(--foreground); font-size: 13px; font-weight: 600; }
.profile-links a::after { content: '↗' / ''; display: inline-block; margin-left: 4px; color: var(--accent); }
.profile-visual {
  grid-area: portrait;
  margin: 0;
  padding: 7px;
  border: 1px solid #c6d8ef;
  border-radius: 15px;
  background: #f2f7ff;
}
.profile-visual a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 9px;
}
.profile-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.9);
  transform-origin: 51% 65%;
}
.news-section, .academic-section, .education-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 46px;
}
#publications { margin-top: 0; }
.news-section h2, .section-title h2, .education-section h2 {
  font: 600 clamp(29px, 3vw, 40px)/1.15 var(--display);
  letter-spacing: -.02em;
  margin-bottom: 25px;
}
.news-list, .experience-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 12px; padding-block: 7px; }
.news-list time, .experience-date, .education-entry > span { color: var(--quiet); font-variant-numeric: tabular-nums; }
.news-list time { font-size: 12px; padding-top: 2px; }
.news-list p { font-size: 14px; }
.section-body { min-width: 0; }
.publication {
  display: grid;
  grid-template-columns: minmax(210px, 32%) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 3vw, 42px);
  padding: 24px;
}
.publication + .publication { padding-bottom: 0; margin-top: 6px; }
.publication > div, .project-content { min-width: 0; }
.publication.representative {
  border-radius: 12px;
  background: #edf4ff;
  border: 1px solid #d8e5f7;
}
.publication-image { display: block; overflow: hidden; margin: 0; border-radius: 6px; }
.publication-image > img { width: 100%; height: auto; max-height: 205px; object-fit: contain; }
.hardware-preview { border: 1px solid #d8e5f7; background: #f7faff; }
.hardware-preview video { width: 100%; height: 210px; object-fit: contain; }
.hardware-preview figcaption { font-size: 11px; padding: 7px 10px; text-align: center; color: #526981; }
.publication h3, .project-content h3 {
  font: 600 clamp(21px, 1.85vw, 27px)/1.18 var(--display);
  letter-spacing: -.015em;
  margin-bottom: 11px;
  text-wrap: pretty;
}
.publication h3 a { color: var(--foreground); }
.authors { font-size: 13px; line-height: 1.6; }
.venue { margin-top: 5px; font-size: 12px; color: var(--quiet); line-height: 1.55; }
.publication-summary { font-size: 14px; line-height: 1.65; margin-top: 12px; }
.publication-links { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 17px; margin-top: 13px; font-size: 12px; font-weight: 500; }
.bibtex { position: relative; min-width: 0; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.bibtex > summary { color: var(--accent); }
.bibtex[open] { flex-basis: 100%; }
.bibtex > button { position: absolute; top: 0; right: 0; padding: 3px 8px; border: 1px solid #d7dfe8; border-radius: 3px; color: var(--accent); background: white; font-size: 11px; }
.bibtex pre { overflow-x: auto; max-width: 100%; padding: 12px; margin: 13px 0 0; border: 1px solid var(--line); background: #f7f9fb; border-radius: 4px; font-size: 10px; line-height: 1.8; }
.bib-status { color: var(--accent); font-size: 11px; margin-top: 8px; }
.bib-status:empty { display: none; }

.project-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 36px; }
.project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}
#project-craft, #project-dummy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 17px;
  grid-column: auto;
  border: 0;
  padding: 0;
}
.project-preview { width: 100%; min-width: 0; margin: 0; }
.project-preview video, .project-preview button {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #12191d;
}
.project-preview video { object-fit: contain; }
.project-preview figcaption { margin-top: 7px; color: var(--quiet); font-size: 12px; line-height: 1.45; }
.project-preview button { padding: 0; }
.project-preview .pose-strip { display: flex; align-items: center; background: #000; }
.pose-strip img { width: 33.333%; height: 100%; object-fit: cover; }
.project-preview .still-preview { background: white; }
.still-preview img { width: 100%; height: 100%; object-fit: contain; }
.project-title { display: inline; padding: 0; border: 0; background: none; color: var(--foreground); text-align: left; font: inherit; }
.project-title > span { font-size: 12px; margin-left: 3px; }
.project-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-content > p { font-size: 13px; line-height: 1.9; }
.project-content .project-context { font-size: 12px; line-height: 1.8; color: var(--quiet); margin-top: 10px; }
.technology-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 11px; color: var(--quiet); }
.technology-list li + li::before { content: '·'; margin-right: 7px; color: #a0a8af; }
.project-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 12px; font-size: 12px; }
.project-links button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; }
.project-links button:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-archive { margin-top: 22px; }
.project-archive > summary, .background-details > summary { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-size: 14px; padding: 9px 0; }
details[open] > summary > span { transform: rotate(90deg); }
.archive-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 36px; padding-top: 12px; }
.archive-project { border-top: 1px solid var(--line); padding: 17px 0; }
.archive-project .project-preview { margin-bottom: 13px; }
.archive-project h3 { font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.archive-project h3 button { border: 0; padding: 0; background: none; color: var(--accent); text-align: left; font: inherit; }
.archive-project p { font-size: 13px; line-height: 1.8; }
.archive-project div > span { display: block; color: var(--quiet); font-size: 11px; margin-top: 7px; }

.experience { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 25px; margin-bottom: 26px; }
.experience-date { font-size: 11px; line-height: 1.8; padding-top: 2px; color: var(--quiet); }
.experience h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.experience div > p { font-size: 13px; line-height: 1.85; }
.experience div > span { display: block; color: var(--quiet); font-size: 11px; margin-top: 9px; }
.education-entry { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 25px; }
.education-entry > span { font-size: 12px; line-height: 1.7; color: var(--quiet); }
.education-entry h3 { font-size: 15px; font-weight: 600; line-height: 1.6; margin-bottom: 6px; }
.education-entry p { font-size: 14px; }
.background-details { margin-top: 35px; }
.background-details > div { padding-top: 15px; }
.background-details p { font-size: 13px; line-height: 1.9; margin-bottom: 16px; }
.background-details h3 { font-size: 15px; font-weight: 500; margin: 25px 0 10px; }
.toolbox { font-size: 13px; }
.toolbox > div { padding: 10px 0; }
.toolbox dt { font-weight: 600; color: var(--foreground); }
.toolbox dd { margin: 4px 0 0; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; margin-top: 55px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 10px; color: var(--quiet); }
.page-footer a { color: #6c849b; }

body:has(.project-dialog[open]) { overflow: hidden; }
.project-dialog { width: min(1020px, calc(100% - 40px)); max-height: calc(100dvh - 56px); padding: 0; border: 1px solid #dce3eb; border-radius: 10px; background: white; color: var(--body); box-shadow: 0 25px 100px #17304a40; font-family: inherit; }
.project-dialog::backdrop { background: #2534469c; backdrop-filter: blur(7px); }
.dialog-topbar { position: sticky; top: 0; z-index: 2; background: white; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 18px 28px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dialog-close { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 6px 0 6px 14px; font-size: 13px; }
.dialog-close span { font-size: 23px; line-height: 1; }
.dialog-content { padding: 35px 40px 40px; }
.dialog-category { color: var(--accent); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.dialog-content h2 { font: 600 32px/1.2 var(--display); margin: 14px 0 18px; letter-spacing: -.6px; }
.dialog-description { max-width: 780px; font-size: 15px; line-height: 1.9; }
.dialog-context { color: var(--quiet); font-size: 12px; line-height: 1.9; margin-top: 14px; }
.media-tabs { display: flex; flex-wrap: wrap; gap: 20px; margin: 25px 0 20px; border-bottom: 1px solid var(--line); }
.media-tabs button { padding: 10px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: #707b86; font-size: 13px; line-height: 1.5; }
.media-tabs button[aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.dialog-media { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: white; }
.dialog-media video, .dialog-media img { width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.dialog-media video { background: #131c25; }
.media-description { font-size: 12px; color: var(--quiet); margin-top: 14px; line-height: 1.8; }
.dialog-extra { margin-top: 28px; }
.dialog-extra h3 { font: 600 17px/1.5 Inter, sans-serif; margin-bottom: 13px; }
.dialog-extra p, .dialog-extra li { font-size: 14px; line-height: 1.9; }
.dialog-extra p { margin-bottom: 14px; }
.dialog-extra ul { padding-left: 18px; margin: 0 0 22px; }
.dialog-extra a { color: var(--accent); font-size: 13px; }
.command-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 25px 0 12px; }
.command-header h3 { margin: 0; }
.command-header button { padding: 6px 10px; border: 1px solid #d9e0e7; border-radius: 4px; background: var(--hover); color: var(--accent); font-size: 12px; }
.dialog-extra pre { margin: 0; padding: 18px; overflow-x: auto; border-radius: 4px; background: #f4f7fa; font-size: 12px; line-height: 2; }
.copy-status { color: var(--accent); font-size: 12px !important; margin-top: 10px; }
.copy-status:empty { display: none; }


@media (max-width: 760px) {
  .academic-page { width: min(100% - 40px, 620px); }
  .masthead { padding: 15px 0; gap: 12px; }
  .section-nav { gap: 2px 15px; }
  .section-nav a { font-size: 12px; }
  .name-signature { font-size: 17px; }
  .biography-layout {
    grid-template-columns: minmax(0, 1fr) clamp(100px, 28vw, 160px);
    grid-template-areas: "identity portrait" "bio bio";
    gap: 18px;
    padding-block: 30px 32px;
  }
  .personal-header h1 { font-size: clamp(42px, 8vw, 58px); }
  .affiliation { font-size: 13px; margin-top: 8px; }
  .profile-visual { padding: 4px; }
  .biography p:first-child { margin-top: 0; }
  .academic-section, .news-section, .education-section { margin-top: 32px; padding-top: 18px; }
  .section-title h2, .news-section h2, .education-section h2 { margin-bottom: 18px; }
  .publication { grid-template-columns: 1fr; gap: 18px; padding: 17px; }
  .publication + .publication { padding: 20px 0 0; }
  .hardware-preview video { height: 210px; }
  .publication-image > img { max-height: 200px; }
  .archive-list { grid-template-columns: 1fr; }
  .project-list { grid-template-columns: 1fr; gap: 24px; }
  .project, #project-craft, #project-dummy { display: grid; grid-template-columns: 1fr; gap: 15px; }
  #project-dummy { border-top: 1px solid var(--line); padding-top: 23px; }
  .news-list li { grid-template-columns: 66px minmax(0, 1fr); gap: 10px; }
  .news-list p { font-size: 13px; }
  .experience, .education-entry { grid-template-columns: 1fr; gap: 6px; }
  .page-footer { gap: 8px 16px; margin-top: 32px; }
  .project-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 8px; }
  .dialog-topbar { padding: 14px 20px; }
  .dialog-content { padding: 24px 20px 30px; }
  .dialog-content h2 { font-size: 26px; }
  .dialog-description { font-size: 14px; }
  .media-tabs { gap: 16px; }
  .media-tabs button { font-size: 12px; }
  .dialog-extra pre { font-size: 11px; padding: 14px; }
}
@media (max-width: 360px) {
  .academic-page { width: calc(100% - 32px); }
  .section-nav { column-gap: 9px; }
  .masthead { gap: 6px; }
  .name-signature { font-size: 15px; }
  .affiliation { max-width: 19ch; }
}
@media(prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
