:root {
  --background: #fbfbfa;
  --surface: #f4f6f7;
  --text: #20262c;
  --muted: #5f6870;
  --subtle: #889198;
  --accent: #2b5d7a;
  --accent-soft: #e9f0f4;
  --border: #d9dee2;
  --max-width: 1140px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.64;
}

a {
  color: inherit;
}

.container {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--text);
  color: #ffffff;
  transform: translateY(-150%);
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.masthead-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.site-brand strong {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.site-brand span {
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  outline: none;
}

.language-toggle {
  min-width: 48px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #b8c2c8;
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.page-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 52px;
  padding-block: 42px 68px;
}

.profile-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  display: block;
  border-radius: 50%;
  border: 1px solid #c9d5dc;
  background: var(--surface);
  object-fit: cover;
}

.profile-sidebar h1 {
  margin: 14px 0 2px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.35;
}

.profile-role {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-bio {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.sidebar-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sidebar-section h2 {
  margin: 0 0 11px;
  font-family: var(--serif);
  font-size: 14px;
}

.skill-list,
.tag-list,
.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list {
  display: grid;
  gap: 10px;
}

.skill-list li {
  display: grid;
  gap: 2px;
}

.skill-list strong {
  font-size: 12px;
}

.skill-list span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.contact-list {
  display: grid;
  gap: 9px;
  font-style: normal;
}

.contact-list div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.contact-list span {
  color: var(--subtle);
  font-size: 11px;
}

.contact-list p,
.contact-list a {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.page-content {
  min-width: 0;
}

.content-section {
  padding: 0 0 48px;
  scroll-margin-top: 90px;
}

.content-section + .content-section {
  padding-top: 2px;
}

.content-section h2 {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid #8b989f;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.35;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
}

.timeline-entry time {
  color: var(--muted);
  font-size: 12px;
}

.timeline-entry h3,
.project-entry h3,
.paper-entry h3 {
  margin: 0;
  line-height: 1.45;
}

.timeline-entry h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 650;
}

.timeline-entry p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.education-heading span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.project-entry,
.paper-entry {
  padding-block: 22px;
  border-bottom: 1px solid var(--border);
}

.entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.entry-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.project-entry h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 650;
}

.entry-status {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.project-entry > p,
.paper-entry > p {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 11px;
}

.result-list li {
  position: relative;
  padding-left: 12px;
  color: var(--muted);
  font-size: 11px;
}

.result-list li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.tag-list li {
  padding: 2px 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.project-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.project-link-muted {
  color: var(--subtle);
}

.paper-entry h3 {
  max-width: 780px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 650;
}

.paper-entry .paper-title-cn {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.contact-list a:hover,
.contact-list a:focus-visible,
.project-link:hover,
.project-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--subtle);
  font-size: 11px;
}

@media (max-width: 860px) {
  .page-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 34px;
  }

  .profile-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 20px;
  }

  .profile-avatar {
    grid-row: 1 / span 3;
    width: 88px;
    height: 88px;
    font-size: 18px;
  }

  .profile-sidebar h1 {
    margin-top: 5px;
  }

  .profile-bio {
    max-width: 620px;
  }

  .sidebar-section {
    grid-column: 1 / -1;
  }

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

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

  .contact-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(calc(100% - 36px), var(--max-width));
  }

  .masthead-inner {
    min-height: 62px;
  }

  .site-brand span {
    display: none;
  }

  .site-nav {
    gap: 12px;
  }

  .header-actions {
    gap: 14px;
  }

  .site-nav a {
    font-size: 12px;
  }

  .language-toggle {
    min-width: 44px;
    padding-inline: 7px;
  }

  .page-grid {
    gap: 34px;
    padding-block: 28px 48px;
  }

  .profile-sidebar {
    grid-template-columns: 68px minmax(0, 1fr);
    column-gap: 16px;
  }

  .profile-avatar {
    width: 68px;
    height: 68px;
    font-size: 15px;
  }

  .profile-sidebar h1 {
    margin-top: 0;
    font-size: 20px;
  }

  .profile-bio {
    grid-column: 1 / -1;
    margin-top: 18px;
  }

  .skill-list,
  .contact-list {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding-bottom: 44px;
  }

  .content-section h2 {
    font-size: 22px;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-block: 17px;
  }

  .education-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3px 12px;
  }

  .education-heading span {
    white-space: normal;
  }

  .entry-heading {
    flex-direction: column;
    gap: 10px;
  }

  .entry-status {
    align-self: flex-start;
  }

  .paper-entry h3 {
    font-size: 18px;
  }

  .footer-inner {
    min-height: auto;
    padding-block: 24px;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

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