:root {
  --background: #ffffff;
  --surface: #f6f6f4;
  --text: #1c1c1c;
  --muted: #6d6d69;
  --border: #deded9;
  --accent: #a45117;
  --header-background: rgba(255, 255, 255, 0.94);
  --content-width: 920px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
}

[data-theme="dark"] {
  --background: #181818;
  --surface: #222222;
  --text: #ededeb;
  --muted: #aaa9a3;
  --border: #3b3b39;
  --accent: #dc985e;
  --header-background: rgba(24, 24, 24, 0.94);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

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

button {
  color: inherit;
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  color: var(--background);
  background: var(--text);
  transform: translateY(-180%);
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: var(--header-background);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nav-wrap {
  display: flex;
  width: min(calc(100% - 2.5rem), var(--content-width));
  min-height: 4rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-name {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.site-name:hover {
  color: var(--accent);
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

nav a {
  color: var(--muted);
  font-size: 0.84rem;
}

nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

main,
footer {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin-inline: auto;
}

.about {
  padding: 4.8rem 0 4.2rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--serif);
}

h1 {
  display: flex;
  margin: 0 0 2.25rem;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.5rem;
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.chinese-name {
  color: var(--text);
  font-family: "Kaiti SC", "STKaiti", KaiTi, "Noto Serif CJK SC", serif;
  font-size: 0.48em;
  font-weight: 400;
  letter-spacing: 0.16em;
}

h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

.profile-layout {
  display: grid;
  align-items: start;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(2.2rem, 6vw, 4.5rem);
}

.profile-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  object-fit: cover;
  object-position: center 24%;
}

.profile-links {
  display: flex;
  margin-top: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.82rem;
}

.profile-links svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.bio > p {
  margin: 0;
  font-size: 1.03rem;
}

.bio > p + p {
  margin-top: 1.15rem;
}

.research-interests {
  margin: 2rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.research-interests div {
  display: grid;
  padding: 0.38rem 0;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
}

.research-interests dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.research-interests dd {
  margin: 0;
  font-size: 0.92rem;
}

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

.education-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.education-list li {
  display: grid;
  padding: 1.15rem 0;
  border-top: 1px solid var(--border);
  align-items: center;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  gap: 1.5rem;
}

.education-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.education-list h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.education-logo-wrap {
  display: grid;
  width: 5rem;
  height: 4rem;
  padding: 0.45rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  place-items: center;
}

.education-logo-wrap img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.education-list p,
.education-date {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.education-date {
  margin: 0;
  white-space: nowrap;
}

.publication-list {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.publication {
  display: grid;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 13.5rem minmax(0, 1fr);
  align-items: start;
  gap: 1.65rem;
}

.publication:last-child {
  border-bottom: 1px solid var(--border);
}

.publication-figure {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  aspect-ratio: 16 / 10;
}

.publication-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.publication-figure:hover img {
  transform: scale(1.015);
}

.publication h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
}

.publication h3 a {
  color: var(--text);
}

.publication h3 a:hover {
  color: var(--accent);
}

.authors,
.venue {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.venue {
  color: var(--muted);
  font-weight: 600;
}

.self-author {
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.authors sup,
.publication-note sup {
  color: var(--muted);
  font-size: 0.72em;
}

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

.publication-links a,
.publication-links span {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.publication-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.publication-note {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.contact p {
  max-width: 38rem;
  margin: 1rem 0 0.35rem;
}

.contact > a {
  font-size: 0.95rem;
}

footer {
  display: flex;
  padding: 1.7rem 0 2.5rem;
  border-top: 1px solid var(--border);
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

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

@media (max-width: 660px) {
  html {
    scroll-padding-top: 4.75rem;
  }

  .nav-wrap,
  main,
  footer {
    width: min(calc(100% - 2rem), var(--content-width));
  }

  .nav-wrap {
    min-height: 3.75rem;
  }

  nav {
    gap: 1rem;
  }

  nav a:first-child {
    display: none;
  }

  .about {
    padding: 3.2rem 0;
  }

  h1 {
    margin-bottom: 1.6rem;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .profile-card {
    width: min(68vw, 250px);
  }

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

  .research-interests div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .research-interests div + div {
    margin-top: 0.45rem;
  }

  .section {
    padding: 2.8rem 0;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .publication-figure {
    width: min(100%, 24rem);
  }

  .education-list li {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    gap: 0.85rem;
  }

  .education-logo-wrap {
    width: 4rem;
    height: 3.4rem;
  }

  footer {
    flex-direction: column;
    gap: 0.15rem;
  }
}

@media (max-width: 360px) {
  .site-name {
    font-size: 0.95rem;
  }

  nav {
    gap: 0.6rem;
  }

  nav a {
    font-size: 0.75rem;
  }

  .theme-toggle {
    width: 1.8rem;
    height: 1.8rem;
  }
}

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