:root {
  --white: #fbfaf5;
  --surface: #f7f4ec;
  --paper: #efe8dc;
  --ink: #1f1d1a;
  --muted: #6b655c;
  --line: #d9d3c5;
  --blue: #2d4a6b;
  --blue-dark: #1f3754;
  --gold: #8b6a3d;
  --body-copy: #322f29;
  --shadow: rgba(31, 29, 26, 0.08);
  --overlay-text: #fbfaf5;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  --white: #ffffff;
  --surface: #171614;
  --paper: #201f1b;
  --ink: #f2efe9;
  --muted: #b2aa9c;
  --line: #39342e;
  --blue: #8fb7d9;
  --blue-dark: #6c9bc1;
  --gold: #d0b27b;
  --body-copy: #e0d9cf;
  --shadow: rgba(0, 0, 0, 0.28);
  --overlay-text: #fbfaf5;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.75;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blue);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 54px;
  padding: 0 max(5vw, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.wordmark-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 10px;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

nav a {
  padding: 16px 0 13px;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

nav a.is-active {
  color: var(--blue);
  border-color: var(--blue);
}

.header-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
}

.language-switch,
.menu-switch,
.theme-switch {
  width: 40px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.menu-switch {
  display: none;
  font-size: 17px;
}

.theme-switch {
  position: relative;
  display: grid;
  place-items: center;
}

.theme-switch svg {
  width: 16px;
  height: 16px;
}

.theme-moon {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: none;
}

:root[data-theme="dark"] .theme-moon {
  display: block;
}

main,
footer {
  width: min(1080px, 90vw);
  margin: 0 auto;
}

.page-shell {
  display: flex;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: flex-start;
  padding: 3.25rem 0 0;
}

.profile-identity {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 5rem;
  align-self: flex-start;
  padding-top: 1rem;
}

.profile-photo-frame {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  width: 142px;
  height: 156px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 10px 18px var(--shadow));
  perspective: 600px;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  clip-path: polygon(50% 0, 93% 24%, 93% 76%, 50% 100%, 7% 76%, 7% 24%);
  object-fit: cover;
  object-position: center 22%;
  transform: perspective(600px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 180ms ease, filter 180ms ease;
}

.profile-photo-frame:hover .profile-photo {
  filter: saturate(1.06) contrast(1.02);
}

.profile-identity h1 {
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.english-name {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 18px;
}

.english-name:empty {
  display: none;
}

.profile-role {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.profile-affiliation,
.profile-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-location {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.profile-location svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.profile-affiliation {
  margin-bottom: 10px;
}

.profile-note {
  margin-bottom: 18px;
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.profile-links .icon-link {
  display: inline-flex;
  width: fit-content;
  height: 31px;
  gap: 9px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.profile-links .icon-link:hover {
  color: var(--blue);
  background: transparent;
  transform: translateX(2px);
}

.profile-links .icon-link svg {
  width: 15px;
  height: 15px;
}

.icon-link {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: var(--surface);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-link svg {
  width: 17px;
  height: 17px;
}

.icon-link:hover {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
  transform: translateY(-2px);
}

.content-column {
  flex: 1;
  min-width: 0;
  max-width: 740px;
}

.profile {
  padding: 0 0 2rem;
  border: 0;
}

.biography {
  padding-top: 0.5rem;
}

.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow[data-index]::before {
  color: var(--blue);
  content: "[" attr(data-index) "]";
}

.biography h2,
.section-title h2,
.contact h2 {
  margin-bottom: 18px;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
}

.biography > p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 16px;
  color: var(--body-copy);
  font-size: 15px;
}

.degree-mark {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.education-list strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.education-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.education-list article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.education-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.education-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.education-list--section {
  gap: 0;
  border-top: 1px solid var(--ink);
}

.education-list--section article {
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
}

.education-list--section article:last-child {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.publication-empty {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.publication-empty > span {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.publication-empty h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.publication-empty p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.content-section {
  padding: 2.75rem 0;
  border-top: 1px solid var(--line);
}

.section-title {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: baseline;
  margin-bottom: 1.35rem;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.section-title .eyebrow {
  padding-top: 0;
}

.section-title h2 {
  margin-bottom: 0;
}

.compact-title {
  grid-template-columns: 130px minmax(0, 1fr);
}

.experience-section {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.5rem;
}

.experience-heading h2 {
  margin: 0;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
}

.experience-timeline {
  --timeline-gutter: 2.5rem;
  position: relative;
  padding-left: var(--timeline-gutter);
}

.experience-timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 1px;
  background: var(--line);
  content: "";
}

.experience-timeline article::before {
  position: absolute;
  top: 9px;
  left: calc(-1 * var(--timeline-gutter) + 2px);
  width: 13px;
  height: 13px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  content: "";
}

.experience-timeline article {
  position: relative;
  margin-bottom: 24px;
  padding: 0 0 24px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.experience-timeline article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.company-name {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.experience-timeline h3 {
  margin-bottom: 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  font-weight: 500;
}

.experience-timeline p {
  margin-bottom: 7px;
  color: var(--body-copy);
  font-size: 14px;
}

.experience-timeline .experience-meta {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 13px;
}

.news-text h3 {
  margin-bottom: 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
}

.news-text p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.news-list {
  position: relative;
  border-top: 1px solid var(--ink);
}

.news-list::before {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 4px;
  width: 1px;
  background: var(--line);
  content: "";
}

.news-list article {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 120px;
  gap: 22px;
  align-items: start;
  padding: 20px 0 20px 24px;
  border-bottom: 1px solid var(--line);
}

.news-list article::before {
  position: absolute;
  top: 27px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  content: "";
}

.news-list time {
  padding-top: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.news-text a {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.news-image {
  display: block;
  width: 120px;
  height: 78px;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
}

.news-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.certificate-image img {
  object-fit: contain;
  padding: 6px;
}

.life-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, 58px);
  gap: 10px;
}

.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--white);
  background: var(--ink);
  text-align: left;
  cursor: zoom-in;
}

.life-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.life-gallery .gallery-item:nth-child(1) {
  grid-column: 1 / 7;
  grid-row: 1 / 4;
}

.life-gallery .gallery-item:nth-child(2) {
  grid-column: 7 / 10;
  grid-row: 1 / 5;
}

.life-gallery .gallery-item:nth-child(3) {
  grid-column: 10 / 13;
  grid-row: 1 / 3;
}

.life-gallery .gallery-item:nth-child(4) {
  grid-column: 10 / 13;
  grid-row: 3 / 7;
}

.life-gallery .gallery-item:nth-child(5) {
  grid-column: 1 / 10;
  grid-row: 4 / 7;
}

.gallery-item img {
  transition: transform 260ms ease, opacity 260ms ease;
}

.gallery-item > span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 35px 16px 13px;
  background: linear-gradient(transparent, rgba(18, 30, 36, 0.72));
  font: 600 12px/1.4 Inter, "Microsoft YaHei", sans-serif;
}

.gallery-item::after {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  content: "+";
  font: 18px/1 Arial, sans-serif;
  opacity: 0;
  transition: opacity 180ms ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
  opacity: 0.92;
}

.gallery-item:hover::after {
  opacity: 1;
}

.lightbox {
  width: min(1100px, 92vw);
  height: min(820px, 90vh);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  color: var(--white);
  background: #101719;
}

.lightbox::backdrop {
  background: rgba(7, 11, 13, 0.86);
  backdrop-filter: blur(6px);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
}

.lightbox figure {
  display: flex;
  height: 100%;
  min-height: 0;
  margin: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox figure img {
  max-width: 100%;
  max-height: calc(100% - 54px);
  object-fit: contain;
}

.lightbox figcaption {
  min-height: 42px;
  padding-top: 12px;
  color: #d7dfe2;
  font-size: 13px;
}

.lightbox button {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--white);
  background: transparent;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  width: 48px;
  height: 48px;
  margin: auto;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
}

.lightbox button svg {
  width: 22px;
  height: 22px;
}

.lightbox-counter {
  position: absolute;
  right: 18px;
  bottom: 12px;
  margin: 0;
  color: #aab6bb;
  font-size: 11px;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  padding: 48px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.contact .eyebrow {
  color: var(--muted);
}

.contact h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.contact-links .icon-link {
  border-color: var(--line);
  color: var(--blue);
  background: var(--surface);
}

.contact-links .icon-link:hover {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 12px;
}

footer p {
  margin-bottom: 0;
}

footer a:hover {
  color: var(--blue);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 62px;
  }

  .menu-switch {
    display: inline-grid;
    place-items: center;
  }

  nav {
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 10px 5vw 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  nav.open {
    display: flex;
  }

  nav a {
    padding: 10px 0;
    border: 0;
  }

  main,
  footer {
    width: min(92vw, 1080px);
  }

  .page-shell {
    flex-direction: column;
    gap: 2rem;
    padding-top: 1.75rem;
  }

  .profile-identity {
    position: static;
    width: min(390px, 100%);
    padding-top: 0;
  }

  .profile-links {
    flex-flow: row wrap;
    gap: 4px 16px;
  }

  .profile-photo-frame {
    width: 150px;
    height: 164px;
  }

  .content-column {
    max-width: none;
  }

  .section-title,
  .compact-title {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-bottom: 12px;
  }

  .experience-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .news-list article {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .news-image {
    grid-column: 2;
    width: 100%;
    height: 165px;
    margin-top: 4px;
  }

  .contact {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 520px) {
  main,
  footer {
    width: 88vw;
    overflow: hidden;
  }

  .site-header {
    padding: 0 6vw;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .profile-identity h1 {
    font-size: 24px;
  }

  .biography > p:not(.eyebrow) {
    font-size: 15px;
  }

  .education-list article {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .content-section {
    padding: 48px 0;
  }

  .experience-timeline {
    --timeline-gutter: 30px;
  }

  .experience-timeline::before {
    left: 7px;
  }

  .news-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .news-image {
    grid-column: 1;
    height: 160px;
    margin-top: 10px;
  }

  .life-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(7, 96px);
    gap: 9px;
  }

  .life-gallery .gallery-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
  }

  .life-gallery .gallery-item:nth-child(2) {
    grid-column: 1;
    grid-row: 3 / 5;
  }

  .life-gallery .gallery-item:nth-child(3) {
    grid-column: 2;
    grid-row: 3 / 4;
  }

  .life-gallery .gallery-item:nth-child(4) {
    grid-column: 2;
    grid-row: 4 / 6;
  }

  .life-gallery .gallery-item:nth-child(5) {
    grid-column: 1 / 3;
    grid-row: 6 / 8;
  }

  .lightbox[open] {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .lightbox {
    width: 96vw;
    height: 82vh;
  }

  footer {
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .profile-photo {
    transform: none !important;
  }
}
