:root {
  color-scheme: light;
  --bg: #fffefc;
  --surface: #ffffff;
  --surface-soft: #f7f5f1;
  --text: #2f2d28;
  --muted: #6f6a61;
  --subtle: #8a8378;
  --border: #e6e1d8;
  --accent: #6f5f45;
  --accent-strong: #413728;
  --link: #5a4c35;
  --link-hover: #2e261b;
  --shadow: 0 12px 36px rgba(54, 43, 25, 0.08);
  --focus: #7a6a4d;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191918;
  --surface: #20201f;
  --surface-soft: #252523;
  --text: #eeeae2;
  --muted: #beb7aa;
  --subtle: #9f978b;
  --border: #37342f;
  --accent: #d2c3a3;
  --accent-strong: #eee2c5;
  --link: #dbcaa7;
  --link-hover: #f3e7cc;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  --focus: #dbcaa7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease, background-color 160ms ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

strong {
  font-weight: 650;
}

.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 10;
  transform: translateY(-140%);
  border-radius: 6px;
  background: var(--accent-strong);
  color: var(--bg);
  padding: 8px 12px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 10px 24px;
}

.breadcrumb {
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 550;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.site-nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.site-nav a {
  padding: 4px 8px;
}

.site-nav a:hover,
.theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.theme-toggle {
  width: 34px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.theme-icon {
  line-height: 1;
}

.layout-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 940px);
  align-items: start;
  gap: 56px;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.page {
  min-width: 0;
}

.profile-card {
  display: grid;
  gap: 16px;
  justify-items: stretch;
  position: sticky;
  top: 86px;
}

.hero {
  padding-bottom: 24px;
}

.monogram {
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 85%, var(--accent) 15%), var(--surface)),
    var(--surface);
  box-shadow: var(--shadow);
}

.monogram span {
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.55rem;
  font-weight: 650;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 8vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.chinese-name {
  margin-block-end: 22px;
  color: var(--muted);
  font-size: 1.08rem;
}

.contact-row {
  display: grid;
  gap: 10px;
}

.contact-row a,
.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--link);
  font-size: 0.94rem;
  font-weight: 520;
  line-height: 1.2;
  padding: 8px 12px;
  text-decoration: none;
}

.contact-row a {
  --chip: var(--link);
  --chip-bg: var(--surface);
  --chip-border: var(--border);
  width: 100%;
  border-color: color-mix(in srgb, var(--chip) 30%, var(--chip-border));
  background: color-mix(in srgb, var(--chip-bg) 88%, var(--surface));
  color: var(--chip);
  gap: 9px;
  justify-content: flex-start;
}

.contact-row .contact-email {
  --chip: #c9473f;
  --chip-bg: #fff0ee;
}

.contact-row .contact-github {
  --chip: #9a7214;
  --chip-bg: #fff7d6;
}

.contact-row .contact-scholar {
  --chip: #2b66c3;
  --chip-bg: #eef4ff;
}

.contact-row .contact-cv {
  --chip: #2f855a;
  --chip-bg: #edf9f1;
}

.contact-row .contact-linkedin {
  --chip: #0a66c2;
  --chip-bg: #eef6ff;
}

:root[data-theme="dark"] .contact-email {
  --chip: #ff9a92;
  --chip-bg: #3b221f;
}

:root[data-theme="dark"] .contact-github {
  --chip: #f1ce62;
  --chip-bg: #332b17;
}

:root[data-theme="dark"] .contact-scholar {
  --chip: #94bbff;
  --chip-bg: #1d2a3c;
}

:root[data-theme="dark"] .contact-cv {
  --chip: #8fdfa9;
  --chip-bg: #1d3126;
}

:root[data-theme="dark"] .contact-linkedin {
  --chip: #91c8ff;
  --chip-bg: #18304a;
}

.contact-row a:hover {
  border-color: color-mix(in srgb, var(--chip) 58%, var(--border));
  background: color-mix(in srgb, var(--chip-bg) 72%, var(--surface));
  color: var(--chip);
}

.contact-row a[aria-disabled="true"] {
  cursor: default;
}

.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 5px;
  color: var(--chip);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1;
}

.contact-icon-github {
  background: #24292f;
  color: #ffffff;
}

.contact-icon-scholar {
  border-radius: 50%;
  background: #4285f4;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
}

.contact-icon-cv {
  background: #2f855a;
  color: #ffffff;
}

.contact-icon-linkedin {
  background: #0a66c2;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.contact-svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.contact-svg-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.links a:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--surface-soft);
  color: var(--link-hover);
}

.intro {
  max-width: 820px;
  color: var(--text);
  font-size: 1.05rem;
}

.intro p {
  margin-bottom: 12px;
}

.section {
  padding-top: 28px;
}

.section h2 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.46rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}

.section h3 {
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.36;
}

.section-note,
.footnote {
  color: var(--muted);
  font-size: 0.94rem;
}

.interest-list,
.service-list {
  margin: 0;
  padding-left: 24px;
}

.interest-list li,
.service-list li {
  margin-bottom: 6px;
}

.news-list {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-soft));
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.news-item {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 14px;
}

.news-item time {
  color: var(--subtle);
  font-size: 0.92rem;
  font-weight: 560;
}

.news-item p {
  margin-bottom: 0;
}

.publication-list {
  display: grid;
  gap: 18px;
  margin: 18px 0 0;
  padding-left: 22px;
}

.publication {
  padding-left: 4px;
}

.authors,
.venue,
.meta,
.compact-list p,
.experience p {
  margin-bottom: 4px;
}

.authors {
  color: var(--muted);
}

.venue {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 560;
}

.award-icon {
  display: inline-block;
  margin-right: 5px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  margin-bottom: 0;
}

.links a {
  min-height: 27px;
  border-radius: 6px;
  font-size: 0.84rem;
  padding: 4px 9px;
}

.link-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  margin-right: 5px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.link-icon-code {
  font-size: 0.58rem;
}

.link-icon-review {
  font-size: 0.56rem;
}

.experience-list,
.compact-list {
  display: grid;
  gap: 12px;
}

.experience {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: flex-start;
  border-left: 3px solid var(--accent);
  padding: 4px 0 6px 14px;
}

.org-logo {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 6px;
  box-shadow: 0 4px 14px rgba(54, 43, 25, 0.07);
}

.logo-shopee,
.logo-yale,
.logo-ecnu {
  padding: 0;
}

.logo-inspur {
  background: #005bac;
  padding: 7px;
}

.experience-body {
  min-width: 0;
}

.experience .meta,
.compact-list p {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 52px;
  padding-top: 18px;
  color: var(--subtle);
  font-size: 0.92rem;
}

.footer p {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .topbar-inner {
    padding-inline: 16px;
  }

  .site-nav a {
    display: none;
  }

  .layout-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 46px 18px 36px;
  }

  .profile-card {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    position: static;
  }

  .monogram {
    width: 104px;
  }

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

  .news-item {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
