:root {
  color-scheme: light;
  --paper: #f8f7f3;
  --ink: #262c31;
  --muted: #62696c;
  --accent: #8d4934;
  --line: #d7d9d5;
  --sample: #efeee7;
  --selected: #e0ded1;
  --text-small: .875rem;
  --text-label: .8125rem;
  --text-body: 1.0625rem;
  --measure: 68ch;
  --motion-fast: 180ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #202627;
  --ink: #eeeae1;
  --muted: #b6bbb8;
  --accent: #e4a58c;
  --line: #485052;
  --sample: #2a3131;
  --selected: #444b45;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; scrollbar-color: var(--line) var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--text-body)/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--selected); color: var(--ink); }
a { color: inherit; text-underline-offset: 0.3125rem; }
button { color: inherit; font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0.3125rem; border-radius: 2px; }
p { margin: 0 0 1.25rem; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
.wrap { width: min(63rem, calc(100% - 6rem)); margin-inline: auto; }
.site-header { display: flex; align-items: center; gap: 2.25rem; min-height: 5.5rem; border-bottom: 1px solid var(--line); font-size: var(--text-small); }
.home-link { text-decoration: none; font-weight: 600; font-size: 1.0625rem; margin-right: auto; white-space: nowrap; }
.home-link span, h1 span { color: var(--accent); }
.site-header nav { display: flex; gap: 1.5625rem; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); text-decoration: underline; }
.preferences { display: flex; gap: 0.5rem; align-items: center; }
.preferences button { background: transparent; border: 0; padding: 0.5rem; min-height: 2.75rem; min-width: 2.75rem; font-size: var(--text-small); }
#themeToggle { display: inline-grid; place-items: center; }
.icon { width: 1.125rem; height: 1.125rem; vertical-align: -.15em; flex: none; }
.theme-icon { width: 1.375rem; height: 1.375rem; }
.preferences button:hover { color: var(--accent); background: var(--sample); }
.preferences button:active { background: var(--selected); }
.skip-link { position: absolute; top: 0.625rem; left: 1.25rem; z-index: 2; padding: 0.5rem 1rem; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.intro { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 4rem; padding: 4.75rem 0 5rem; }
.intro-name { color: var(--muted); font-size: var(--text-body); margin: 0.75rem 0 0; }
h1 { font: 400 clamp(3.375rem, 6.8vw, 5.5rem)/1.05 var(--serif); letter-spacing: -.035em; }
.intro-role { margin: 1.5rem 0 0; font-size: 1.125rem; }
.project-shortcuts { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; margin-top: 1.5rem; }
.project-shortcuts a { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 2.25rem; font-size: var(--text-small); text-decoration: none; }
.project-shortcuts a .icon { width: 0.9375rem; height: 0.9375rem; color: var(--accent); transition: transform var(--motion-fast) var(--ease-out); }
.project-shortcuts a:hover { text-decoration: underline; }
.project-shortcuts a:hover .icon { transform: translateY(2px); }
.intro-note { padding-top: 0; }
.intro-note p { color: var(--muted); }
.text-link { display: inline-block; font-size: var(--text-small); text-decoration-thickness: 1px; padding: 0.25rem 0; }
.text-link .icon { display: inline-block; margin-left: 0.3125rem; transition: transform var(--motion-fast) var(--ease-out); }
.text-link:hover { color: var(--accent); }
.text-link:hover span[aria-hidden] { transform: translate(2px, -2px); }
.section-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4rem; border-top: 1px solid var(--line); padding: 3rem 0 4rem; }
.section-label h2 { font-size: 0.9375rem; font-weight: 600; margin: 0.1875rem 0 0.625rem; }
.section-label p { color: var(--muted); font-size: var(--text-small); line-height: 1.7; white-space: pre-line; }
.section-content { min-width: 0; }
.section-content p { max-width: var(--measure); }
.section-label h2 { color: var(--accent); }
h3 { font-size: 1.375rem; line-height: 1.35; letter-spacing: -.025em; }
.entry-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--text-label); white-space: nowrap; }
.role { font-size: var(--text-small); color: var(--muted); margin: 0.5rem 0 1rem; }
.work-entry + .work-entry { margin-top: 2.5rem; padding-top: 0; }
.work-entry p:last-child, .research-entry p:last-child { margin-bottom: 0; }
.project-title { font: 400 2.5rem/1.18 var(--serif); letter-spacing: -.025em; margin-bottom: 1rem; }
.project-lead { font-size: 1.25rem; line-height: 1.55; margin-bottom: 1.5rem; }
.reading-sample { margin: 2rem 0 0; padding: 1.75rem 2rem 1.5rem; background: var(--sample); }
.sample-heading { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: var(--text-label); margin-bottom: 1.5rem; }
.sample-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; }
.sample-sentence { font: 400 1.75rem/1.75 var(--serif); }
.word { font: inherit; background: transparent; padding: 0 2px; border: 0; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.3125rem; text-decoration-thickness: 1px; transition: background var(--motion-fast) var(--ease-out); }
.word[aria-pressed="true"] { background: var(--selected); text-decoration-thickness: 2px; }
.word:hover:not(:disabled) { background: var(--selected); }
.word:disabled { cursor: text; text-decoration: none; background: none; }
.sample-hint { font-size: var(--text-label); color: var(--muted); margin-bottom: 0; }
.definition { border-left: 1px solid var(--line); padding-left: 1.5rem; min-height: 11.5rem; }
.definition h4 { font: 400 1.4375rem/1.3 var(--serif); }
.definition p { font-size: var(--text-small); line-height: 1.55; margin: 0.75rem 0 0; }
.definition .word-type { margin-top: 1px; font-size: var(--text-label); font-style: italic; color: var(--muted); }
.definition .word-context { color: var(--muted); }
.sample-caption { font-size: var(--text-label); color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; margin: 1.75rem 0 0; }
.research-entry + .research-entry { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.research-entry + .research-entry h3 { margin-bottom: 0.875rem; }
.implementation { font-size: var(--text-small); color: var(--muted); }
.education-entry { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; margin-bottom: 0.875rem; }
.education-entry h3 { font-size: 1.0625rem; }
.teaching { color: var(--muted); font-size: var(--text-small); margin-top: 1.4375rem; }
.honors { font-size: var(--text-small); color: var(--muted); }
.honors summary { cursor: pointer; width: fit-content; padding-block: 0.6875rem; min-height: 2.75rem; }
.honors ul { padding-left: 1.25rem; }
footer { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--line); padding: 2.6875rem 0 3.4375rem; }
.footer-note { font: 400 1.8125rem/1.3 var(--serif); letter-spacing: -.025em; margin-bottom: 0.875rem; }
.back-top { color: var(--muted); font-size: var(--text-small); padding: 0.625rem 0; min-height: 2.75rem; text-decoration: none; }
.back-top:hover { color: var(--ink); }
html[lang="zh-CN"] .project-title { font-size: 1.875rem; line-height: 1.5; }
@media (max-width: 56.25rem) {
  .wrap { width: calc(100% - 4rem); }
  .site-header { gap: 1.5rem; }
  .site-header nav { gap: 1rem; }
  .intro { gap: 2.5rem; padding: 3.5rem 0 4rem; }
  h1 { font-size: 4.0625rem; }
  .section-row { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 2rem; }
  .sample-body { grid-template-columns: 1fr; gap: 1.4375rem; }
  .definition { padding: 1.125rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 47.5rem) {
  .wrap { width: calc(100% - 2.5rem); }
  .site-header { min-height: 0; padding: 1.25rem 0 0.8125rem; flex-wrap: wrap; gap: 0.625rem 1.25rem; }
  .home-link { font-size: 1rem; }
  .preferences { margin-left: auto; }
  .site-header nav { order: 3; width: 100%; justify-content: space-between; gap: 0.5rem; font-size: var(--text-small); }
  .intro { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 0 3rem; }
  h1 { font-size: clamp(3rem, 12vw, 4.5rem); }
  .intro-role { font-size: 1.0625rem; margin-top: 1.125rem; }
  .intro-note { padding: 0; }
  .section-row { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 0 3rem; }
  .section-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.125rem; }
  .section-label h2, .section-label p { margin: 0; }
  .section-label p { font-size: var(--text-label); }
  .entry-heading { flex-wrap: wrap; gap: 0.1875rem 1rem; }
  h3 { font-size: 1.3125rem; }
  .project-title { font-size: 2.25rem; }
  .project-lead { font-size: 1.1875rem; }
  .reading-sample { padding: 1.25rem; }
  .sample-heading { flex-wrap: wrap; margin-bottom: 1.25rem; }
  .sample-sentence { font-size: 1.625rem; }
  .definition { min-height: 0; }
  .project-shortcuts { flex-direction: row; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 1.25rem; }
  .project-shortcuts a { min-height: 2.75rem; }
  .education-entry { display: block; margin-bottom: 1.1875rem; }
  .education-entry h3 { font-size: 1.0625rem; margin-bottom: 0.1875rem; }
  footer { align-items: flex-start; gap: 1.75rem; flex-wrap: wrap; padding: 2.0625rem 0; }
  .footer-note { font-size: 1.625rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .text-link .icon, .word, .project-shortcuts a .icon { transition: none; }
}
