:root {
  --text: #333;
  --heading: #222;
  --muted: #6b6b6b;
  --line: #dedede;
  --soft: #f2f2f2;
  --page-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.65; }
a { color: #333; text-decoration-color: #999; text-underline-offset: 3px; }
a:hover { color: #000; text-decoration-color: #000; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 8px 12px; background: #222; color: #fff; }
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { width: min(var(--page-width), calc(100% - 40px)); min-height: 64px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.site-name { color: var(--heading); font-size: 18px; font-weight: 600; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { padding: 21px 0 18px; border-bottom: 2px solid transparent; color: #555; font-size: 14px; text-decoration: none; }
.site-nav a:hover, .site-nav a.active { border-bottom-color: #333; color: #111; }
.nav-toggle { display: none; padding: 6px 0; border: 0; background: transparent; color: #333; font: inherit; cursor: pointer; }

.site-layout { width: min(var(--page-width), calc(100% - 40px)); margin: 0 auto; padding: 54px 0 70px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 62px; }
.single-column { width: min(800px, calc(100% - 40px)); display: block; }
.profile { align-self: start; }
.avatar { position: relative; width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; margin-bottom: 20px; overflow: hidden; border-radius: 3px; background: var(--soft); color: #444; font-family: Georgia, serif; font-size: 42px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.avatar.has-photo img { opacity: 1; }
.profile h1 { margin: 0; color: var(--heading); font-size: 22px; font-weight: 600; line-height: 1.25; }
.name-cn { margin: 3px 0 14px; color: var(--muted); font-size: 14px; }
.position { margin: 0 0 2px; color: #444; line-height: 1.5; }
.affiliation { margin: 0; color: var(--muted); line-height: 1.5; }
.profile-links { margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; }
.profile-links li { margin: 5px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

.main-content { min-width: 0; }
.main-content section + section { margin-top: 42px; }
.main-content h2 { margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid #aaa; color: var(--heading); font-size: 25px; font-weight: 500; line-height: 1.3; }
.main-content h3 { margin: 0 0 4px; color: var(--heading); font-size: 16px; font-weight: 600; line-height: 1.45; }
.main-content p { margin: 0 0 14px; }
.plain-entry p { margin-bottom: 4px; }
.note { color: #555; }
.footnote { color: var(--muted); font-size: 13px; }

.dated-list { margin: 0; padding: 0; list-style: none; }
.dated-list li { display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 10px 0; border-bottom: 1px solid #eee; }
.dated-list li:first-child { border-top: 1px solid #eee; }
.dated-list span { color: var(--muted); font-size: 13px; }
.dated-list p { margin: 0; }

.publication-list { margin: 0; padding-left: 28px; }
.publication-list > li { padding: 0 0 20px 8px; }
.publication-list p { margin: 2px 0; }
.sub-list { margin: 6px 0 0; padding-left: 20px; color: #555; }

.entry-list article { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 0 0 22px; }
.entry-list article + article { padding-top: 2px; }
.entry-list p { margin: 2px 0; }
.entry-list time { flex: 0 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.compact-entries article { padding-bottom: 15px; }

.year-group { display: grid; grid-template-columns: 70px 1fr; gap: 22px; padding: 12px 0; border-bottom: 1px solid #eee; }
.year-group:first-of-type { border-top: 1px solid #eee; }
.year-group h3 { color: var(--muted); font-size: 14px; }
.year-group ul { margin: 0; padding-left: 20px; }
.year-group li { margin: 0 0 6px; }

.award-list { margin: 0; padding: 0; list-style: none; }
.award-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 28px; padding: 10px 0; border-bottom: 1px solid #eee; }
.award-list li:first-child { border-top: 1px solid #eee; }
.award-list time { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.skills { display: grid; grid-template-columns: 110px 1fr; gap: 8px 20px; margin: 0; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; }

.misc-text { max-width: 720px; }
.cat-photo-frame { width: min(100%, 620px); margin: 0; }
.cat-photo-frame img { display: none; width: 100%; min-height: 300px; max-height: 520px; object-fit: cover; border-radius: 3px; }
.cat-photo-frame.has-photo img { display: block; }
.photo-placeholder { display: grid; width: 100%; min-height: 300px; place-items: center; padding: 30px; border: 1px dashed #bbb; border-radius: 3px; background: #fafafa; color: var(--muted); text-align: center; }
.cat-photo-frame.has-photo .photo-placeholder { display: none; }
.cat-photo-frame figcaption { margin-top: 9px; color: var(--muted); font-size: 13px; }

.site-footer { width: min(var(--page-width), calc(100% - 40px)); margin: 0 auto; padding: 20px 0 30px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #888; font-size: 12px; }
.not-found { width: min(620px, calc(100% - 40px)); margin: 100px auto; }
.not-found h1 { margin-bottom: 10px; color: var(--heading); font-size: 30px; font-weight: 500; }

@media (max-width: 800px) {
  .header-inner { width: min(100% - 28px, var(--page-width)); min-height: 58px; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 58px; right: 0; left: 0; z-index: 20; display: none; padding: 8px 20px 12px; border-bottom: 1px solid var(--line); background: #fff; }
  .site-nav.open { display: grid; gap: 0; }
  .site-nav a { padding: 8px 0; border-bottom: 0; }
  .site-nav a.active { font-weight: 600; }
  .site-layout { width: min(100% - 28px, 700px); padding: 36px 0 54px; display: block; }
  .profile { display: grid; grid-template-columns: 96px 1fr; column-gap: 18px; margin-bottom: 42px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .avatar { grid-row: 1 / 6; width: 96px; margin: 0; font-size: 25px; }
  .profile h1 { align-self: end; }
  .name-cn { margin-bottom: 6px; }
  .profile-links { grid-column: 2; margin-top: 10px; padding-top: 10px; }
  .main-content h2 { font-size: 23px; }
  .site-footer { width: min(100% - 28px, 700px); }
}

@media (max-width: 520px) {
  body { font-size: 14px; }
  .profile { grid-template-columns: 80px 1fr; column-gap: 14px; }
  .avatar { width: 80px; font-size: 21px; }
  .profile-links { grid-column: 1 / -1; }
  .dated-list li, .year-group { grid-template-columns: 1fr; gap: 3px; }
  .entry-list article { display: block; }
  .entry-list time { display: block; margin-top: 5px; }
  .award-list li { display: block; }
  .award-list time { display: block; margin-top: 3px; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 8px; }
  .cat-photo-frame img, .photo-placeholder { min-height: 210px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 3px; }
}

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