:root {
  --background: #ffffff;
  --foreground: #111111;
  --muted: #555555;
  --border: #d7d7d7;
  --link: #0047cc;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--foreground);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  background: var(--background);
  color: var(--foreground);
}

a,
a:visited,
a:hover,
a:active {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  opacity: 0.72;
}

a:focus-visible,
.lang-button:focus-visible {
  outline: 1px solid var(--foreground);
  outline-offset: 3px;
}

.layout {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 72px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 44px;
}

.side-nav {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.side-nav a,
.side-nav a:visited {
  color: var(--foreground);
}

.side-nav a:hover {
  color: var(--link);
  opacity: 1;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}

.lang-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lang-button:hover {
  color: var(--link);
}

.lang-button.is-active {
  color: var(--foreground);
}

.page {
  min-width: 0;
}

.hero {
  position: relative;
  padding-top: 12px;
  margin-bottom: 48px;
}

.hero,
.section {
  scroll-margin-top: 88px;
}

.hero::before {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin-bottom: 12px;
  background: var(--foreground);
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.05rem, 5.6vw, 3.3rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.lead,
.section p,
.list {
  font-size: 1.02rem;
  line-height: 1.8;
}

.lead {
  margin: 18px 0 0;
  max-width: 42rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 18px 0 0;
  color: var(--muted);
}

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

.section h2 {
  margin: 0 0 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section p {
  margin: 0;
}

.entry {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 18px;
  padding: 10px 0;
}

.entry + .entry {
  border-top: 1px solid var(--border);
}

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

.time {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

.entry-org {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  min-width: 0;
}

.entry-title {
  margin: 0;
  font-weight: 700;
  min-width: 0;
}

.institution-logo {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: 24px;
  max-width: 128px;
  object-fit: contain;
}

.institution-logo--stepfun {
  height: 18px;
  filter: none;
}

.institution-logo--shlab {
  height: 26px;
}

.institution-logo--school,
.institution-logo--pku {
  height: 28px;
}

.institution-logo--tieyi {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

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

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

.list li {
  padding: 8px 0;
}

.list li + li {
  border-top: 1px solid var(--border);
}

#publications .meta {
  display: block;
  margin-top: 3px;
}

#interests .meta {
  display: block;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .layout {
    width: min(980px, calc(100% - 32px));
    padding: 28px 0 56px;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .entry-org {
    gap: 10px;
  }

  .institution-logo--shlab {
    height: 22px;
  }

  .institution-logo--school,
  .institution-logo--pku {
    height: 24px;
  }

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a,
  .side-nav a:visited {
    flex: 0 0 auto;
    padding: 0.42rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.88rem;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.88);
  }

  .side-nav a:hover {
    background: rgba(0, 71, 204, 0.08);
  }

  .lang-switch {
    flex: 0 0 auto;
    margin: 0 2px 0 0;
    padding-right: 12px;
    border-right: 1px solid var(--border);
  }

  .hero {
    margin-bottom: 40px;
  }
}
