:root {
  color-scheme: light dark;
  --canvas: #f3f3f1;
  --paper: #ffffff;
  --ink: #20201e;
  --muted: #64645f;
  --rule: #deded8;
  --edge: #e6e6e0;
  --shadow: 0 2px 16px rgb(0 0 0 / 3%);
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-family: var(--font-sans);
  font-size: 100%;
  font-variant-numeric: lining-nums;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #181818;
    --paper: #222222;
    --ink: #e9e9e4;
    --muted: #b2b2aa;
    --rule: #42423e;
    --edge: #343432;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0 24px 64px;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--ink);
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}
p,
h1,
h2,
h3,
ul,
dl,
dd {
  margin: 0;
}
p,
li {
  text-wrap: pretty;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  max-width: 860px;
  min-height: 72px;
  margin: auto;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.languages {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar a,
.toolbar [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.toolbar a {
  text-decoration-color: transparent;
  transition: text-decoration-color 150ms ease;
}
.toolbar a:hover {
  text-decoration-color: currentColor;
}
.toolbar [aria-current] {
  color: var(--ink);
  font-weight: 600;
}
.toolbar .separator {
  color: var(--rule);
}
.paper {
  max-width: 860px;
  margin: auto;
  padding: 56px 64px 64px;
  border: 1px solid var(--edge);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.resume-header {
  text-align: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink);
}
h1 {
  font-size: clamp(36px, 4.5vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
:lang(zh) h1 {
  letter-spacing: 0;
}
.affiliation {
  margin-top: 12px;
  font-size: 16px;
}
.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  list-style: none;
  padding: 0;
}
.contacts a {
  text-decoration-color: var(--rule);
  overflow-wrap: anywhere;
}
section {
  margin-top: 32px;
}
h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}
h2::after {
  content: '';
  height: 1px;
  background: var(--rule);
  flex: 1;
}
.entry-title,
.entry-meta,
.honor {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}
strong {
  font-weight: 600;
}
h3 a {
  text-decoration: none;
}
h3 a:hover {
  text-decoration: underline;
}
.date {
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.entry + .entry {
  margin-top: 20px;
}
.math {
  white-space: nowrap;
}
.entry-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.details {
  margin-top: 12px;
  padding-left: 20px;
}
.details li + li {
  margin-top: 8px;
}
.details a {
  overflow-wrap: anywhere;
  text-decoration-color: var(--muted);
}
.honor-group + .honor-group {
  margin-top: 20px;
}
.honor-group h3 {
  margin-bottom: 6px;
}
.honors {
  list-style: none;
  padding: 0;
}
.honor + .honor {
  margin-top: 4px;
}
.skills {
  display: grid;
  align-items: baseline;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 6px 16px;
}
.skills dt {
  font-weight: 600;
}
:lang(zh) .skills {
  grid-template-columns: 96px minmax(0, 1fr);
}
.skip-link {
  position: absolute;
  left: 24px;
  top: 8px;
  padding: 8px;
  background: var(--paper);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}

@media (max-width: 640px) {
  body {
    padding: 0 0 32px;
    background: var(--paper);
  }
  .toolbar {
    padding: 0 24px;
    min-height: 64px;
    gap: 20px;
  }
  .paper {
    padding: 24px 24px 40px;
    border: 0;
    box-shadow: none;
  }
  .resume-header {
    padding-bottom: 24px;
  }
  .contacts {
    gap: 4px 12px;
  }
  section {
    margin-top: 28px;
  }
  .entry-title,
  .entry-meta {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .entry-title .date {
    font-size: 14px;
    color: var(--muted);
  }
  .skills {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .skills dd + dt {
    margin-top: 8px;
  }
  :lang(zh) .skills {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px 12px;
  }
  :lang(zh) .skills dd + dt {
    margin-top: 0;
  }
  .honor {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  :root {
    color-scheme: light;
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --rule: #ccc;
  }
  body {
    padding: 0;
    background: #fff;
  }
  .toolbar,
  .skip-link {
    display: none;
  }
  .paper {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  section,
  .honor-group {
    break-inside: avoid;
  }
  a {
    text-decoration: none;
  }
}
