:root {
  --ink: #242229;
  --ink-soft: #5f5b66;
  --paper: #faf9fb;
  --white: #ffffff;
  --line: rgba(36, 34, 41, 0.16);
  --line-light: rgba(255, 255, 255, 0.34);
  --lavender: #9f91ca;
  --mint: #b1dedc;
  --blush: #fde1d9;
  --morandi-gradient: linear-gradient(118deg, #9f91ca 0%, #b1dedc 52%, #fde1d9 100%);
  --shadow: 0 24px 70px rgba(32, 27, 44, 0.2);
  --max-width: 1180px;
  --header-height: 72px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.editor-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.section-shell,
.nav-shell,
.hero-inner {
  width: min(calc(100% - 64px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  color: var(--white);
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(250, 249, 251, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(16px);
}

.nav-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 100%;
  gap: 28px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 11px;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.wordmark-mark {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--morandi-gradient);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.primary-nav a {
  position: relative;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.primary-nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--morandi-gradient);
  content: "";
  transition: transform 180ms ease;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.icon-button,
.small-button,
.icon-text-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button:hover,
.small-button:hover,
.icon-text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button svg,
.small-button svg,
.icon-text-button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.menu-toggle {
  display: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: transparent;
  color: inherit;
}

.hero {
  position: relative;
  display: flex;
  height: 82svh;
  min-height: 540px;
  max-height: 820px;
  align-items: center;
  overflow: hidden;
  background: #4b4852;
  color: var(--white);
}

.hero-media,
.hero-wash {
  position: absolute;
  inset: 0;
}

.hero-media {
  transform: scale(1.035);
  background-image: url("assets/campus.jpg");
  background-position: center calc(50% + var(--hero-shift, 0px));
  background-size: cover;
  filter: saturate(0.66) contrast(0.94);
  animation: hero-image-enter 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-wash {
  background:
    linear-gradient(90deg, rgba(26, 24, 31, 0.88) 0%, rgba(31, 29, 37, 0.72) 44%, rgba(34, 31, 38, 0.36) 72%, rgba(34, 31, 38, 0.2) 100%),
    linear-gradient(118deg, rgba(159, 145, 202, 0.48), rgba(177, 222, 220, 0.2) 56%, rgba(253, 225, 217, 0.24));
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 760px) 240px;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  padding-top: var(--header-height);
}

.hero-copy {
  animation: hero-copy-enter 780ms 160ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.eyebrow,
.section-index,
.editor-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.84);
}

.eyebrow::before {
  width: 44px;
  height: 3px;
  background: var(--morandi-gradient);
  content: "";
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 76px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-name-zh {
  margin: 10px 0 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: 24px;
  line-height: 1.3;
}

.hero-institution {
  margin: 22px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.hero-bio {
  max-width: 680px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
}

.button-light {
  background: var(--white);
  color: var(--ink);
}

.button-light:hover {
  background: var(--blush);
}

.button-primary {
  background: var(--ink);
  color: var(--white);
}

.button-primary:hover {
  background: #3a3642;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.text-link svg {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.text-link:hover svg {
  transform: translate(3px, 3px);
}

.text-link-light {
  color: var(--white);
}

.portrait-wrap {
  margin: 0 0 8px;
  animation: portrait-enter 700ms 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.portrait-button {
  position: relative;
  display: block;
  width: 220px;
  height: 272px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  background: transparent;
  box-shadow: 18px 22px 0 rgba(177, 222, 220, 0.28);
  color: var(--white);
  cursor: default;
}

.portrait-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--morandi-gradient);
  color: rgba(36, 34, 41, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
}

.portrait-wrap figcaption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  text-align: right;
}

.scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.scroll-cue svg {
  width: 15px;
  animation: scroll-cue 1500ms ease-in-out infinite;
}

.section {
  padding: 112px 0;
}

.education-section {
  background:
    linear-gradient(90deg, rgba(159, 145, 202, 0.1), rgba(177, 222, 220, 0.14) 54%, rgba(253, 225, 217, 0.18)),
    var(--paper);
}

.papers-section {
  background: var(--white);
}

.works-section {
  background: linear-gradient(118deg, rgba(159, 145, 202, 0.34), rgba(177, 222, 220, 0.52) 54%, rgba(253, 225, 217, 0.58));
}

.section-heading {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: start;
  margin-bottom: 64px;
}

.section-index {
  padding-top: 13px;
  color: var(--ink-soft);
}

.section-heading h2,
.contact-section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.section-heading p:not(.section-index) {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.timeline {
  position: relative;
  margin-left: 190px;
  border-top: 1px solid var(--line);
}

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

.timeline-entry {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 180px;
  border-bottom: 1px solid var(--line);
}

.timeline-period {
  position: relative;
  margin: 0;
  padding: 30px 28px 30px 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.timeline-period::after {
  position: absolute;
  top: 34px;
  right: -6px;
  width: 11px;
  height: 11px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--lavender);
  content: "";
}

.timeline-content {
  padding: 26px 0 30px 40px;
}

.timeline-content h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
}

.timeline-school {
  margin: 7px 0 0;
  font-weight: 800;
}

.timeline-location,
.timeline-description {
  margin: 3px 0 0;
  color: var(--ink-soft);
}

.timeline-description {
  max-width: 680px;
  margin-top: 11px;
}

.paper-list {
  counter-reset: papers;
  border-top: 1px solid var(--line);
}

.paper-entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 24px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: papers;
}

.paper-number::before {
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  content: counter(papers, decimal-leading-zero);
}

.paper-main h3 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.35;
}

.paper-authors {
  margin: 9px 0 0;
  font-size: 15px;
}

.paper-citation {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.paper-citation em {
  color: var(--ink);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  margin-top: 14px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(177, 222, 220, 0.48);
  color: #37343d;
  font-size: 12px;
  font-weight: 800;
}

.paper-abstract {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.paper-abstract summary {
  width: fit-content;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.paper-abstract p {
  max-width: 760px;
  margin: 9px 0 0;
}

.paper-links {
  display: flex;
  max-width: 190px;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-link,
.bibtex-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.paper-link:hover,
.bibtex-button:hover {
  border-color: var(--lavender);
  background: rgba(159, 145, 202, 0.1);
}

.paper-link svg,
.bibtex-button svg {
  width: 14px;
  height: 14px;
}

.works-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(36, 34, 41, 0.28);
  border-bottom: 1px solid rgba(36, 34, 41, 0.28);
}

.work-entry {
  position: relative;
  min-height: 330px;
  padding: 34px 32px 34px 0;
}

.work-entry + .work-entry {
  padding-left: 32px;
  border-left: 1px solid rgba(36, 34, 41, 0.28);
}

.work-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.work-entry h3 {
  margin: 56px 0 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.28;
}

.work-description {
  margin: 15px 0 0;
  color: #4e4a54;
}

.work-entry .text-link {
  position: absolute;
  bottom: 32px;
  left: 0;
}

.work-entry + .work-entry .text-link {
  left: 32px;
}

.empty-state {
  margin: 0;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.contact-section {
  padding: 104px 0;
  background: #29262f;
  color: var(--white);
}

.contact-inner {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.contact-inner .section-index {
  padding-top: 12px;
  color: rgba(255, 255, 255, 0.58);
}

.contact-section h2 {
  max-width: 760px;
  font-size: 60px;
}

.contact-section p:not(.section-index) {
  grid-column: 2;
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
}

.contact-email {
  grid-column: 2;
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  border-bottom: 2px solid var(--mint);
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.contact-email svg {
  width: 21px;
  transition: transform 160ms ease;
}

.contact-email:hover svg {
  transform: translate(3px, -3px);
}

.site-footer {
  padding: 28px 0;
  background: #211f25;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 26px;
}

.footer-inner p {
  margin: 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.social-links a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--mint);
}

.back-to-top {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  color: var(--white);
}

.back-to-top svg {
  width: 16px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 680ms ease, transform 680ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

.editor-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(24, 22, 28, 0.52);
  backdrop-filter: blur(4px);
}

.editor {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  display: flex;
  width: min(560px, 100%);
  height: 100dvh;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  animation: editor-enter 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.editor-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.editor-header h2 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.editor-kicker {
  color: var(--ink-soft);
  font-size: 10px;
}

.editor-notice {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(177, 222, 220, 0.28);
  color: #4a4650;
  font-size: 12px;
  line-height: 1.45;
}

.editor-notice svg {
  width: 18px;
  margin-top: 1px;
}

.editor-notice p {
  margin: 0;
}

.editor-notice code {
  color: var(--ink);
  font-weight: 800;
}

.editor-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  overflow-x: auto;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.editor-tab::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 3px;
  background: var(--morandi-gradient);
  content: "";
  opacity: 0;
}

.editor-tab.is-active {
  color: var(--ink);
}

.editor-tab.is-active::after {
  opacity: 1;
}

.editor-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.editor-panel {
  display: none;
}

.editor-panel.is-active {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.panel-heading h3,
.editor-group-title {
  margin: 0;
  font-size: 15px;
}

.small-button,
.icon-text-button {
  min-height: 34px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.editor-field {
  display: block;
  margin-top: 15px;
}

.editor-field > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #4f4b55;
  font-size: 12px;
  font-weight: 800;
}

.editor-field small {
  color: #827d88;
  font-weight: 500;
}

.editor-field input,
.editor-field textarea {
  width: 100%;
  border: 1px solid rgba(36, 34, 41, 0.22);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.editor-field input {
  height: 42px;
  padding: 0 11px;
}

.editor-field textarea {
  min-height: 92px;
  padding: 9px 11px;
  line-height: 1.5;
  resize: vertical;
}

.editor-field input:focus,
.editor-field textarea:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(159, 145, 202, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.media-upload-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 15px;
  margin-top: 16px;
}

.media-preview {
  display: grid;
  width: 82px;
  height: 82px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--morandi-gradient);
  color: #45414c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.media-preview.wide {
  height: 60px;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-controls input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.upload-label svg {
  width: 15px;
  height: 15px;
}

.editor-divider {
  height: 1px;
  margin: 24px 0;
  border: 0;
  background: var(--line);
}

.repeater-item {
  position: relative;
  padding: 20px 0 24px;
  border-top: 1px solid var(--line);
}

.repeater-item:first-child {
  border-top: 0;
}

.repeater-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeater-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.repeater-actions {
  display: flex;
  gap: 3px;
}

.repeater-actions .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.repeater-actions .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
  transform: none;
}

.danger-button {
  color: #9b3c52;
}

.editor-footer {
  display: flex;
  flex: 0 0 auto;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.editor-file-actions {
  display: flex;
  gap: 6px;
}

.toast {
  position: fixed;
  z-index: 160;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 12px 16px;
  border-radius: 4px;
  background: #242229;
  box-shadow: 0 14px 38px rgba(24, 22, 28, 0.22);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

@keyframes hero-image-enter {
  from { opacity: 0; transform: scale(1.09); }
  to { opacity: 1; transform: scale(1.035); }
}

@keyframes hero-copy-enter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portrait-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-cue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes editor-enter {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 960px) {
  .primary-nav {
    gap: 20px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 30px;
  }

  .hero h1 {
    font-size: 60px;
  }

  .portrait-button {
    width: 168px;
    height: 216px;
  }

  .portrait-fallback {
    font-size: 46px;
  }

  .timeline,
  .contact-inner {
    margin-left: 0;
  }

  .works-list {
    grid-template-columns: 1fr;
  }

  .work-entry {
    min-height: 250px;
    padding: 30px 0 72px;
  }

  .work-entry + .work-entry {
    padding-left: 0;
    border-top: 1px solid rgba(36, 34, 41, 0.28);
    border-left: 0;
  }

  .work-entry + .work-entry .text-link,
  .work-entry .text-link {
    bottom: 30px;
    left: 0;
  }

  .work-entry h3 {
    margin-top: 28px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
  }

  .section-shell,
  .nav-shell,
  .hero-inner {
    width: min(calc(100% - 40px), var(--max-width));
  }

  .nav-shell {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: grid;
    max-height: 0;
    gap: 0;
    overflow: hidden;
    background: rgba(250, 249, 251, 0.98);
    color: var(--ink);
    box-shadow: 0 1px 0 var(--line);
    transition: max-height 200ms ease;
  }

  .site-header.menu-open .primary-nav {
    max-height: 250px;
  }

  .primary-nav a {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
  }

  .primary-nav a::after {
    display: none;
  }

  .hero {
    height: 84svh;
    min-height: 520px;
    max-height: 720px;
    align-items: flex-start;
  }

  .hero-media {
    background-position: 58% calc(50% + var(--hero-shift, 0px));
  }

  .hero-wash {
    background:
      linear-gradient(180deg, rgba(26, 24, 31, 0.84) 0%, rgba(30, 28, 35, 0.72) 62%, rgba(33, 30, 37, 0.54) 100%),
      linear-gradient(118deg, rgba(159, 145, 202, 0.5), rgba(177, 222, 220, 0.18) 56%, rgba(253, 225, 217, 0.18));
  }

  .hero-inner {
    display: block;
    padding-top: 106px;
  }

  .hero-copy {
    max-width: 100%;
    padding-bottom: 120px;
  }

  .hero h1 {
    font-size: 44px;
    line-height: 1.05;
  }

  .hero-name-zh {
    font-size: 20px;
  }

  .hero-institution {
    margin-top: 16px;
    font-size: 14px;
  }

  .hero-bio {
    max-width: 100%;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .hero-actions {
    gap: 16px;
    margin-top: 20px;
  }

  .portrait-wrap {
    position: absolute;
    right: 0;
    bottom: 44px;
    margin: 0;
  }

  .portrait-button {
    width: 92px;
    height: 116px;
    box-shadow: 9px 11px 0 rgba(177, 222, 220, 0.28);
  }

  .portrait-fallback {
    font-size: 30px;
  }

  .portrait-wrap figcaption {
    display: none;
  }

  .scroll-cue {
    right: auto;
    bottom: 20px;
    left: 20px;
    transform: none;
  }

  .section {
    padding: 64px 0;
  }

  .education-section {
    padding-top: 40px;
  }

  .section-heading {
    display: block;
    margin-bottom: 42px;
  }

  .section-index {
    padding: 0;
    margin-bottom: 15px;
  }

  .section-heading h2,
  .contact-section h2 {
    font-size: 40px;
  }

  .section-heading p:not(.section-index) {
    font-size: 15px;
  }

  .timeline {
    margin: 0;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-entry {
    display: block;
    min-height: 0;
    padding-left: 30px;
  }

  .timeline-period {
    padding: 22px 0 0;
  }

  .timeline-period::after {
    top: 28px;
    right: auto;
    left: -27px;
  }

  .timeline-content {
    padding: 8px 0 24px;
  }

  .timeline-content h3 {
    font-size: 23px;
  }

  .paper-entry {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 28px 0;
  }

  .paper-main h3 {
    font-size: 22px;
  }

  .paper-links {
    grid-column: 2;
    max-width: none;
    justify-content: flex-start;
  }

  .work-entry h3 {
    font-size: 25px;
  }

  .contact-section {
    padding: 78px 0;
  }

  .contact-inner {
    display: block;
  }

  .contact-section h2 {
    font-size: 42px;
  }

  .contact-section p:not(.section-index),
  .contact-email {
    grid-column: auto;
  }

  .contact-email {
    font-size: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
  }

  .social-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .back-to-top {
    grid-column: 2;
    grid-row: 1;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .editor-form,
  .editor-header,
  .editor-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .editor-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    min-height: 126px;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .editor-file-actions {
    justify-content: space-between;
  }

  .editor-footer .button-primary {
    width: 100%;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 38px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero-copy {
    padding-bottom: 116px;
  }

  .portrait-button {
    width: 82px;
    height: 104px;
  }

  .paper-entry {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .media-upload-row {
    grid-template-columns: 68px 1fr;
  }

  .media-preview {
    width: 68px;
    height: 68px;
  }
}

.friends-page {
  min-width: 320px;
  background: #f5f5f8;
}

.friends-page .site-header {
  background: rgba(250, 249, 251, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(16px);
}

.friends-main {
  min-height: calc(100svh - 140px);
  padding-top: var(--header-height);
}

.friends-intro {
  position: relative;
  overflow: hidden;
  padding: 84px 0 76px;
  background:
    linear-gradient(112deg, rgba(159, 145, 202, 0.3), rgba(177, 222, 220, 0.34) 52%, rgba(253, 225, 217, 0.5)),
    #f8f7fa;
}

.friends-intro::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--morandi-gradient);
  content: "";
}

.friends-intro-inner {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: start;
  gap: 48px;
}

.friends-back {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.friends-back:hover,
.friends-back:focus-visible {
  color: var(--ink);
  transform: translateX(-3px);
}

.friends-back svg {
  width: 17px;
  height: 17px;
}

.friends-heading {
  max-width: 760px;
  animation: friend-heading-enter 620ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.friends-heading .section-index {
  color: #635d6d;
}

.friends-heading h1 {
  margin: 14px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 68px;
  font-weight: 500;
  line-height: 1;
}

.friends-heading > p:last-child {
  max-width: 640px;
  margin: 20px 0 0;
  color: #5f5966;
  font-size: 17px;
  line-height: 1.75;
}

.friends-directory {
  padding: 68px 0 104px;
}

.friends-list {
  display: grid;
  max-width: 980px;
  gap: 18px;
  margin-inline: auto;
}

.friend-card {
  position: relative;
  display: grid;
  min-height: 136px;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 26px;
  overflow: hidden;
  padding: 20px 22px 20px 26px;
  border: 1px solid rgba(36, 34, 41, 0.13);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(36, 34, 41, 0.05);
  color: var(--ink);
  text-decoration: none;
  animation: friend-card-enter 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--friend-delay, 0ms);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.friend-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--morandi-gradient);
  content: "";
}

a.friend-card:hover,
a.friend-card:focus-visible {
  border-color: rgba(159, 145, 202, 0.5);
  box-shadow: 0 18px 38px rgba(36, 34, 41, 0.1);
  transform: translateY(-3px);
}

.friend-avatar {
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  overflow: hidden;
  place-items: center;
  border-radius: 6px;
  background: var(--morandi-gradient);
  color: rgba(36, 34, 41, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-copy {
  min-width: 0;
}

.friend-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.friend-heading-row h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
}

.friend-domain {
  flex: 0 1 auto;
  overflow: hidden;
  color: #7b7580;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-description {
  margin: 13px 0 0;
  color: #615b66;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.friend-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #6d6673;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.friend-arrow svg {
  width: 18px;
  height: 18px;
}

a.friend-card:hover .friend-arrow,
a.friend-card:focus-visible .friend-arrow {
  background: var(--ink);
  color: var(--white);
  transform: translate(2px, -2px);
}

.friend-card.is-disabled .friend-arrow {
  visibility: hidden;
}

.friends-empty {
  margin: 0;
  padding: 58px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 24px;
  text-align: center;
}

.friends-footer {
  margin-top: 0;
}

@keyframes friend-heading-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes friend-card-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .friends-intro {
    padding: 48px 0 44px;
  }

  .friends-intro-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .friends-back {
    margin-top: 0;
  }

  .friends-heading h1 {
    font-size: 50px;
  }

  .friends-heading > p:last-child {
    margin-top: 16px;
    font-size: 15px;
  }

  .friends-directory {
    padding: 40px 0 72px;
  }

  .friends-list {
    gap: 14px;
  }

  .friend-card {
    min-height: 116px;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 17px;
    padding: 18px 46px 18px 20px;
  }

  .friend-avatar {
    width: 76px;
    height: 76px;
    font-size: 23px;
  }

  .friend-heading-row {
    display: block;
  }

  .friend-heading-row h2 {
    font-size: 22px;
  }

  .friend-domain {
    display: block;
    margin-top: 5px;
  }

  .friend-description {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
  }

  .friend-arrow {
    position: absolute;
    top: 17px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
  }
}

@media (max-width: 390px) {
  .friends-heading h1 {
    font-size: 44px;
  }

  .friend-card {
    grid-template-columns: 66px minmax(0, 1fr);
    padding-left: 16px;
  }

  .friend-avatar {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

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