:root {
  --background: #fefffe;
  --foreground: #0f172a;
  --primary: #1e293b;
  --accent: rgb(14, 159, 178);
  --accent-dark: #006f82;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --nav-container: 1216px;
  --page-container: 1088px;
  --header-height: 64px;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Crimson Text", Georgia, serif;
  --transition: 200ms ease;
  --header-bg: rgba(254, 255, 254, 0.8);
  --header-border: rgba(226, 232, 240, 0.5);
  --mobile-menu-bg: rgba(254, 255, 254, 0.95);
  --timeline-gradient-stop: rgba(212, 165, 98, 0.08);
  --timeline-link-hover-bg: rgba(212, 165, 98, 0.1);
  --card-bg: rgba(251, 252, 254, 0.96);
  --card-border: rgba(220, 228, 238, 0.75);
  --grid-line: rgba(220, 228, 238, 0.45);
}

[data-theme="dark"] {
  --background: #0f172a;
  --foreground: #f1f5f9;
  --primary: #f1f5f9;
  --neutral-50: #1e293b;
  --neutral-100: #1e293b;
  --neutral-200: #334155;
  --neutral-300: #475569;
  --neutral-400: #64748b;
  --neutral-500: #94a3b8;
  --neutral-600: #94a3b8;
  --neutral-700: #cbd5e1;
  --neutral-800: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.5),
    0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(15, 23, 42, 0.85);
  --header-border: rgba(51, 65, 85, 0.5);
  --mobile-menu-bg: rgba(15, 23, 42, 0.95);
  --timeline-gradient-stop: rgba(14, 159, 178, 0.15);
  --timeline-link-hover-bg: rgba(14, 159, 178, 0.12);
  --card-bg: rgba(30, 41, 59, 0.92);
  --card-border: rgba(51, 65, 85, 0.6);
  --grid-line: rgba(51, 65, 85, 0.35);
}

@media (min-width: 1024px) {
  :root {
    --header-height: 80px;
  }
}

html[lang="zh-CN"] {
  --font-serif: "Crimson Text", "Source Han Serif SC", "Noto Serif CJK SC",
    "Songti SC", STSong, SimSun, serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--foreground);
  background:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    var(--background);
  background-size: 48px 48px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
  overflow: hidden;
}

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

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

.doodle-img,
.name-spiral-underline {
  pointer-events: none;
  user-select: none;
}

.doodle-img {
  opacity: 0.86;
  object-fit: contain;
}

[data-theme="dark"] .doodle-img,
[data-theme="dark"] .name-spiral-underline {
  opacity: 0.78;
}

.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 {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-height);
  background: transparent;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition:
    background-color 300ms ease-out,
    border-color 300ms ease-out,
    box-shadow 300ms ease-out,
    backdrop-filter 300ms ease-out,
    -webkit-backdrop-filter 300ms ease-out;
}

.site-header.scrolled,
body.menu-open .site-header {
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, var(--nav-container));
  height: 100%;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .nav {
    width: min(100% - 48px, var(--nav-container));
  }
}

@media (min-width: 1024px) {
  .nav {
    width: min(100% - 64px, var(--nav-container));
  }
}

.nav-logo {
  flex-shrink: 0;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.625rem;
  transition: color var(--transition);
}

@media (min-width: 1024px) {
  .nav-logo {
    font-size: 1.375rem;
    line-height: 1.875rem;
  }
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .nav-right {
    gap: 0.75rem;
  }
}

.nav-menu {
  position: relative;
  display: none;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (min-width: 1024px) {
  .nav-menu {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
  }
}

.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--neutral-600);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
}

.theme-toggle,
.language-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  border: 1px solid var(--neutral-200);
  border-radius: 0.5rem;
  color: var(--neutral-600);
  background: var(--background);
  cursor: pointer;
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.theme-toggle {
  width: 2.5rem;
  padding: 0;
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  transition: opacity var(--transition), transform var(--transition);
}

.sun-icon {
  display: block;
}

.moon-icon {
  display: none;
}

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

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

.theme-toggle:hover,
.language-toggle:hover,
.nav-toggle:hover {
  color: var(--primary);
  background: var(--neutral-50);
}

.language-toggle {
  gap: 0.25rem;
  min-width: 3.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
}

.language-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-toggle:hover,
.nav-toggle:hover {
  color: var(--primary);
  background: var(--neutral-50);
}

.nav-toggle {
  position: relative;
  width: 2.5rem;
  padding: 0;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 1.125rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
  transform-origin: center;
  transition:
    top var(--transition),
    transform var(--transition),
    opacity var(--transition);
}

.nav-toggle span:nth-child(1) {
  top: calc(50% - 6px);
}

.nav-toggle span:nth-child(2) {
  top: 50%;
}

.nav-toggle span:nth-child(3) {
  top: calc(50% + 6px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 50%;
  transform: translateX(-50%) rotate(-45deg);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  width: min(100% - 32px, var(--page-container));
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 0 2rem;
}

@media (min-width: 640px) {
  .page-shell {
    width: min(100% - 48px, var(--page-container));
  }
}

@media (min-width: 1024px) {
  .page-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    width: min(100% - 64px, var(--page-container));
  }
}

.profile-column {
  min-width: 0;
}

.profile-sticky {
  position: static;
}

@media (min-width: 1024px) {
  .profile-sticky {
    position: fixed;
    top: calc(var(--header-height) + 2rem);
    left: max(16px, calc((100vw - var(--page-container)) / 2 + 16px));
    width: 16rem;
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow: hidden;
  }
}

.portrait {
  width: 16rem;
  height: 16rem;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--neutral-50);
  box-shadow: var(--shadow-lg);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}

.portrait:hover {
  box-shadow: var(--shadow-xl);
}

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

.profile-heading {
  margin-bottom: 1.5rem;
  text-align: center;
}

.profile-heading h1 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 2.125rem;
}

.profile-title {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
}

.profile-affiliation {
  margin: 0 0 0.5rem;
  color: var(--neutral-600);
  font-size: 0.9rem;
  line-height: 1.35rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .profile-links {
    gap: 1rem;
  }
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--neutral-600);
  transition: color var(--transition);
}

.profile-links a:hover {
  color: var(--accent);
}

.profile-links svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-links a[aria-label="GitHub"] svg,
.profile-links a[aria-label="ORCID"] svg {
  fill: currentColor;
  stroke: none;
}

/* Email popup */
.email-popup-wrapper {
  position: relative;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--neutral-600);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}

.email-btn:hover {
  color: var(--accent);
}

.email-popup {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 2rem);
  background: var(--neutral-800);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  animation: email-popup-enter 200ms ease-out;
}

@keyframes email-popup-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(calc(-100% + 10px)) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) scale(1);
  }
}

.email-popup-inner {
  text-align: center;
}

.email-popup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.email-popup-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.email-popup-hint {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

.email-popup-pin-icon {
  width: 0.5rem;
  height: 0.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.email-popup-hint-text {
  line-height: 1;
}

.email-popup-address {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  word-break: break-all;
  margin-bottom: 0.5rem;
}

.email-popup-action {
  margin-top: 0.5rem;
}

.email-popup-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.25rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color var(--transition);
}

.email-popup-send:hover {
  background: var(--accent-dark);
}

.email-popup-send:active {
  transform: scale(0.96);
}

.email-popup-send svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Arrow pointer - border triangle trick */
.email-popup-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--neutral-800);
  border-bottom: none;
}

.side-panel {
  width: 16rem;
  padding: 1rem;
  margin: 0 auto 1.5rem;
  border-radius: 0.5rem;
  background: var(--neutral-100);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}

.side-panel:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

.side-panel h2 {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5rem;
}

.side-panel ul {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  color: var(--neutral-700);
  font-size: 0.875rem;
  line-height: 1.25rem;
  list-style: none;
}

.content-column {
  display: grid;
  gap: 1.875rem;
  min-width: 0;
  max-width: 100%;
}

.content-section {
  position: relative;
  scroll-margin-top: 6rem;
}

.doodle-about-stars {
  position: absolute;
  top: -2.5rem;
  left: -3.6rem;
  width: 4.2rem;
  transform: rotate(-0deg);
}

.doodle-about-research {
  position: absolute;
  top: -1.4rem;
  right: 2.25rem;
  width: 6.8rem;
  transform: rotate(-7deg);
}

#about .prose {
  padding-right: min(8.25rem, 23vw);
}

.about-name-mark {
  position: relative;
  display: inline-block;
  padding-bottom: 0.14em;
  color: var(--primary);
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.name-spiral-underline {
  position: absolute;
  right: -0.4em;
  bottom: -0.6em;
  left: -0.18em;
  width: calc(100% + 0.58em);
  height: 1.2em;
  max-width: none;
  opacity: 0.88;
}

.content-section h2 {
  margin: 0 0 1rem;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.8rem;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.doodle-life-acg {
  flex: 0 0 auto;
  width: 6.5rem;
  margin: -0rem 0 -2rem 3rem;
  transform: rotate(10deg);
}

.doodle-publication-book {
  flex: 0 0 auto;
  width: 5.35rem;
  margin: -0.65rem 0 -0.6rem 0.05rem;
  transform: rotate(-4deg);
}

.prose,
.contact-section > p {
  max-width: 100%;
  color: var(--neutral-700);
  font-size: 0.9375rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.prose a,
.timeline-item a {
  border-radius: 0.25rem;
  color: var(--accent);
  font-weight: 500;
  transition:
    color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.prose a:hover,
.timeline-item a:hover {
  color: var(--accent-dark);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: var(--shadow-sm);
}

.prose p,
.contact-section > p {
  margin: 0 0 1rem;
}

.prose p:last-child,
.contact-section > p:last-child {
  margin-bottom: 0;
}

.note-list {
  display: grid;
  gap: 0.75rem;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.note-item time {
  flex-shrink: 0;
  width: 4rem;
  margin-top: 0.25rem;
  color: var(--neutral-500);
  font-size: 0.75rem;
  line-height: 1rem;
}

.note-item p {
  margin: 0;
  color: var(--neutral-700);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.publication-list,
.project-list,
.life-list,
.contact-list {
  display: grid;
  gap: 1rem;
}

.life-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doodle-contact-envelope {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 5.5rem;
  transform: translateY(-50%) rotate(-6deg);
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 820px;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  content: "";
  background: linear-gradient(var(--accent), var(--timeline-gradient-stop));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.timeline-item-pku .timeline-body {
  padding-right: 6.5rem;
}

.doodle-education-stars {
  position: absolute;
  top: 0.85rem;
  right: 6rem;
  width: 4rem;
  transform: rotate(0deg);
}

.timeline-item:hover {
  box-shadow: none;
  transform: none;
}

.timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 26px;
  border: 3px solid var(--background);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  flex-shrink: 0;
}

.timeline-body {
  padding: 18px 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.timeline-item:hover .timeline-body {
  box-shadow: none;
  transform: none;
}

.timeline-meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.timeline-item h3 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.timeline-item p {
  margin: 0.5rem 0 0;
  color: var(--neutral-600);
  font-size: 0.8375rem;
  line-height: 1.35rem;
}

.timeline-item a {
  border-radius: 0.25rem;
  color: var(--accent);
  font-weight: 500;
  transition:
    color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.timeline-item a:hover {
  color: var(--accent-dark);
  background: var(--timeline-link-hover-bg);
  box-shadow: var(--shadow-sm);
}

.timeline-body .muted-text {
  color: var(--neutral-500);
}

.publication-card,
.project-card {
  padding: 1rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: var(--card-bg);
  box-shadow: 0 12px 32px rgba(30, 41, 59, 0.08);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}

.publication-card:hover,
.project-card:hover {
  box-shadow: 0 22px 48px rgba(30, 41, 59, 0.15);
  transform: scale(1.01);
}

.life-item {
  position: relative;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid var(--neutral-200);
  transition: border-color var(--transition);
}

.life-item:hover {
  border-left-color: var(--accent);
}

.life-item h3 {
  margin: 0 0 0.25rem;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.life-item p {
  margin: 0;
  color: var(--neutral-600);
  font-size: 0.8375rem;
  line-height: 1.35rem;
}

.publication-meta {
  margin: 0 0 0.25rem;
  color: var(--neutral-600);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.timeline-meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.publication-card h3 .anonymized-note,
.project-card h3 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.anonymized-note {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--neutral-500);
  font-style: italic;
}

.life-item h3 {
  margin-bottom: 0;
}

.publication-card p,
.project-card p,
.life-item p {
  margin: 0.5rem 0 0;
  color: var(--neutral-600);
  font-size: 0.8375rem;
  line-height: 1.35rem;
}

.publication-card .authors {
  margin-bottom: 0.25rem;
  color: var(--neutral-600);
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.inline-links a {
  border-radius: 0.25rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition:
    color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.inline-links a:hover {
  color: var(--accent-dark);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: var(--shadow-sm);
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1.34;
  border-radius: 0.5rem;
  object-fit: cover;
  background: var(--neutral-100);
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.mini-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--neutral-100);
  border-radius: 0.25rem;
  color: var(--neutral-500);
  background: var(--neutral-50);
  font-size: 0.75rem;
  line-height: 1rem;
}

.life-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-list {
  margin-top: 1rem;
}

.contact-list a {
  position: relative;
  display: grid;
  gap: 0.125rem;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid var(--neutral-100);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition:
    border-color var(--transition),
    padding-left var(--transition);
}

.contact-list a:hover {
  border-bottom-color: var(--accent);
  box-shadow: none;
  transform: none;
  padding-left: 0.5rem;
}

.contact-email-link {
  min-height: 5.6rem;
  padding-right: 6.5rem !important;
}

.contact-list span {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.contact-list strong {
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5rem;
  word-break: break-word;
}

.muted-text {
  color: var(--neutral-500);
}

.footer {
  width: min(100% - 32px, var(--page-container));
  padding: 0 0 2rem;
  margin: 0 auto;
  color: var(--neutral-500);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

@media (min-width: 640px) {
  .footer {
    width: min(100% - 48px, var(--page-container));
  }
}

@media (min-width: 1024px) {
  .footer {
    width: min(100% - 64px, var(--page-container));
  }
}

.footer p {
  margin: 0;
}

@media (max-width: 1023px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.75rem;
    border-bottom: 1px solid var(--header-border);
    background: var(--mobile-menu-bg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(24px);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--neutral-600);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  .nav-link.active {
    border-left: 4px solid var(--accent);
  }

  .profile-sticky {
    display: grid;
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
  }

  .portrait,
  .profile-heading,
  .profile-links {
    margin-right: 0;
    margin-left: 0;
  }

  .profile-heading {
    text-align: left;
  }

  .profile-links {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .side-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 719px) {
  .profile-sticky {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #about .prose {
    padding-right: 0;
    margin-top: 1.5rem;
  }

  .doodle-about-stars {
    top: -3rem;
    left: -0.5rem;
    width: 3rem;
  }

  .doodle-about-research {
    right: -1.5rem;
  }

  .doodle-publication-book {
    width: 4.6rem;
    margin: -0.55rem 0 -0.45rem 0;
  }

  .doodle-life-acg {
    flex: 0 0 auto;
    width: 4.8rem;
    margin: -0.55rem 0 -0.5rem 0.5rem;
    transform: rotate(13deg);
    position: static;
  }

  .life-item-acg {
    padding-right: 0;
    margin-top: 0.5rem;
  }

  .doodle-contact-envelope {
    right: 0;
    width: 4.5rem;
  }

  .timeline-item-pku .timeline-body {
    padding-right: 4.25rem;
  }

  .doodle-education-stars {
    top: 1rem;
    right: 0.1rem;
    width: 3.5rem;
  }

  .contact-email-link {
    min-height: 4.25rem;
    padding-right: 4.6rem !important;
  }

  .portrait {
    margin: 0 auto 1.5rem;
  }

  .profile-heading {
    text-align: center;
  }

  .profile-links {
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card img {
    max-height: 13.75rem;
  }
}

@media (max-width: 480px) {
  .nav {
    width: min(100% - 24px, var(--nav-container));
  }

  .nav-logo {
    min-width: 0;
    max-width: 9.5rem;
    overflow: hidden;
    font-size: 1.0625rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-right {
    flex-shrink: 0;
    gap: 0.375rem;
  }

  .theme-toggle,
  .language-toggle,
  .nav-toggle {
    height: 2.25rem;
    border-radius: 0.45rem;
  }

  .theme-toggle,
  .nav-toggle {
    width: 2.25rem;
  }

  .language-toggle {
    min-width: 3.125rem;
    padding: 0 0.4rem;
  }
}

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

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