:root {
  --bg: #f7f7f4;
  --paper: #ffffff;
  --text: #1d1f21;
  --muted: #686d72;
  --line: #d9dddf;
  --accent: #155b88;
  --accent-soft: #eaf2f7;
  --tag-line: #d6e5ee;
  --tag-text: #244d66;
  --chip-bg: #f0f2f3;
  --chip-text: #4a4f54;
  --button-border-active: #b8bec2;
  --photo-bg: #ececea;
  --max-width: 1120px;
}

body[data-theme="night"] {
  --bg: #0f1419;
  --paper: #151c23;
  --text: #e8edf2;
  --muted: #9aa6b2;
  --line: #2a3742;
  --accent: #7ec4f3;
  --accent-soft: #173041;
  --tag-line: #2a4a5d;
  --tag-text: #b9def8;
  --chip-bg: #1c2731;
  --chip-text: #cfdae4;
  --button-border-active: #53616d;
  --photo-bg: #182027;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.65;
  transition: background-color .18s ease, color .18s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: .5rem .75rem;
  z-index: 20;
}
.skip-link:focus { left: .75rem; top: .75rem; }

.page-shell {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 72px;
  padding: 68px 0 44px;
}

.profile-sticky { position: sticky; top: 36px; }
.profile-photo-ring {
  width: 176px;
  height: 176px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8ec5ff 45%, #c7e6ff 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(21, 91, 136, .12);
}
.profile-photo {
  width: 168px;
  height: 168px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  background: var(--photo-bg);
  border: 2px solid var(--paper);
  display: block;
}
body[data-theme="night"] .profile-photo-ring {
  background: linear-gradient(135deg, #7ec4f3, #4b8db6 45%, #29485c 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.name-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.cn-name { color: var(--muted); font-size: 1.02rem; }
.headline { margin: 12px 0 4px; font-weight: 600; }
.affiliation { margin: 0; color: var(--muted); font-size: .95rem; }
.profile-links { margin-top: 24px; display: flex; flex-direction: column; gap: 7px; }
.profile-links a { width: fit-content; font-size: .95rem; }

.language-switch,
.theme-switch {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.language-switch { margin-top: 24px; }
.theme-switch { margin-top: 10px; }
.language-switch button,
.theme-switch button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.language-switch button:hover,
.theme-switch button:hover {
  color: var(--text);
  border-color: var(--button-border-active);
}
.language-switch button.active,
.theme-switch button.active {
  color: var(--text);
  background: var(--paper);
  border-color: var(--button-border-active);
}
.language-switch button:focus-visible,
.theme-switch button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.content-panel { min-width: 0; }
.section-block { padding: 0 0 42px; margin-bottom: 42px; border-bottom: 1px solid var(--line); }
.intro-section { padding-top: 2px; }
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.intro-text {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 1.2rem;
  line-height: 1.75;
}
.section-heading { margin-bottom: 21px; }
.split-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 1.55rem;
  font-weight: 600;
}
.section-note { color: var(--muted); font-size: .86rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  background: var(--accent-soft);
  border: 1px solid var(--tag-line);
  border-radius: 999px;
  color: var(--tag-text);
  padding: 5px 11px;
  font-size: .91rem;
}

.publication-list { margin: 0; padding-left: 1.4rem; }
.publication-item { margin: 0 0 22px; padding-left: .35rem; }
.publication-item:last-child { margin-bottom: 0; }
.pub-title { font-weight: 700; }
.pub-meta, .pub-links { color: var(--muted); font-size: .93rem; }
.pub-links { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 10px; }
.status {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: .77rem;
  font-weight: 700;
  vertical-align: 1px;
}

.research-list { display: grid; gap: 28px; }
.research-card h3 { margin: 0 0 5px; font-size: 1rem; }
.research-card p { margin: 0; color: var(--text); }
.research-card .tools { margin-top: 7px; color: var(--muted); font-size: .9rem; }

.timeline { display: grid; gap: 24px; }
.timeline-item { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 20px; }
.timeline-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .91rem; }
.timeline-main h3 { margin: 0 0 3px; font-size: 1rem; }
.timeline-main p { margin: 0; color: var(--text); }
.timeline-main .subline { color: var(--muted); font-size: .91rem; margin-top: 3px; }
.compact { gap: 16px; }

.site-footer { color: var(--muted); font-size: .84rem; padding-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body,
  .language-switch button,
  .theme-switch button { transition: none; }
}

@media (max-width: 820px) {
  .page-shell { grid-template-columns: 1fr; gap: 42px; padding-top: 36px; }
  .profile-sticky { position: static; }
  .profile-panel { border-bottom: 1px solid var(--line); padding-bottom: 34px; }
  .profile-photo-ring { width: 148px; height: 148px; }
  .profile-photo { width: 140px; height: 140px; }
  .profile-links { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
}

@media (max-width: 540px) {
  .page-shell { width: min(100% - 28px, var(--max-width)); padding-top: 24px; }
  h1 { font-size: 1.9rem; }
  .intro-text { font-size: 1.08rem; }
  .split-heading { display: block; }
  .section-note { display: block; margin-top: 5px; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
}
