:root {
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --accent-dark: #1d4ed8;
  --text: #1f2430;
  --text-soft: #4b5568;
  --muted: #7a8395;
  --border: #e6e8ee;
  --bg: #ffffff;
  --bg-alt: #fafbfc;
  --tag-bg: #eef2fb;
  --tag-text: #2952c8;
  --sidebar-w: 280px;
  --content-max: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .15s ease, border-color .15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.layout { display: flex; align-items: flex-start; max-width: 1120px; margin: 0 auto; padding: 0 32px; gap: 56px; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  padding: 48px 0 32px;
}
.sidebar .photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 44%;
  display: block;
  margin: 0 auto 22px;
  border: 3px solid #fff;
  box-shadow: 0 4px 20px rgba(30,50,90,.15);
}
.sidebar .name { font-size: 1.4rem; font-weight: 700; text-align: center; margin: 0 0 6px; letter-spacing: -.01em; }
.sidebar .affil { font-size: .86rem; color: var(--text-soft); text-align: center; margin: 0 0 4px; line-height: 1.45; }
.sidebar .role-extra { margin-top: 8px; color: var(--muted); }
.sidebar .recruit-mini { margin: 12px 8px 0; padding: 7px 9px; border: 1px solid #cddafc; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; font-weight: 600; line-height: 1.35; text-align: center; }
.sidebar .socials { display: flex; justify-content: center; gap: 16px; margin: 14px 0 26px; }
.sidebar .socials a { color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.sidebar .socials a:hover { color: var(--accent); }
.sidebar .socials svg { width: 20px; height: 20px; fill: currentColor; }
.sidebar nav { border-top: 1px solid var(--border); padding-top: 18px; }
.sidebar nav a { display: block; font-size: .92rem; color: var(--text-soft); padding: 7px 12px; border-radius: 8px; border-left: 2px solid transparent; }
.sidebar nav a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; border-left-color: var(--accent); }

main { flex: 1 1 auto; max-width: var(--content-max); min-width: 0; padding: 48px 0 80px; }
section { margin-bottom: 44px; scroll-margin-top: 24px; }
h2 { font-size: 1.32rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
h2 a { font-size: .82rem; font-weight: 500; color: var(--muted); }
h3.subhead { font-size: 1.02rem; font-weight: 700; color: var(--text); margin: 22px 0 8px; }
p { margin: 0 0 14px; color: var(--text-soft); }
#bio p, #bio li { color: var(--text-soft); }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 8px; }
b { color: var(--text); }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--text); padding: 6px 0; list-style-position: inside; }
summary:hover { color: var(--accent); }
details > *:not(summary) { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.recruit { background: var(--accent-soft); border: 1px solid #cddafc; border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 18px 0; color: var(--text) !important; font-weight: 500; }

.pub-note { font-size: .88rem; color: var(--muted); }
#pubs ul, #pubs .publist { list-style: none; padding-left: 0; }
#pubs .publist { max-height: 42rem; overflow-y: auto; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
#pubs .publist::-webkit-scrollbar { width: 8px; }
#pubs .publist::-webkit-scrollbar-thumb { background: #cdd6ea; border-radius: 8px; }
#pubs .publist::-webkit-scrollbar-thumb:hover { background: #b3c0dd; }
#pubs .publist > li:not(.pub-year) { position: relative; padding: 14px 16px 14px 18px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); line-height: 1.6; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
#pubs .publist > li:not(.pub-year):hover { border-color: #cdd6ea; box-shadow: 0 3px 14px rgba(30,50,90,.07); }
#pubs .publist > li:not(.pub-year) > a:first-child, #pubs .pub-title { font-weight: 600; color: var(--text); }
#pubs .publist > li:not(.pub-year) > a:first-child:hover { color: var(--accent); }
#pubs .publist > .pub-year { position: sticky; top: 0; z-index: 2; margin: 0 -4px 12px; padding: 9px 14px; border-bottom: 1px solid #cdd6ea; background: rgba(255,255,255,.96); color: var(--accent); font-size: 1.04rem; font-weight: 700; letter-spacing: .02em; backdrop-filter: blur(8px); }
#pubs .publist > .pub-year:not(:first-child) { margin-top: 18px; }
#pubs .publist li i { display: inline-block; font-style: normal; font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--tag-text); background: var(--tag-bg); padding: 2px 9px; border-radius: 20px; margin-top: 6px; }
#pubs .publist li a:not(:first-child) { font-size: .82rem; color: var(--accent); font-weight: 500; white-space: nowrap; }
.authors { color: var(--text-soft); font-size: .95rem; }
.paper-note { color: #dc2626; font-size: .82rem; font-weight: 600; }
#honor li, #experience li, #service li { color: var(--text-soft); }
#footer { max-width: 1120px; margin: 0 auto; padding: 28px 32px 48px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .85rem; }
#footer p { color: var(--muted); }

@media (max-width: 860px) {
  .layout { flex-direction: column; gap: 0; padding: 0 20px; }
  .sidebar { width: 100%; flex-basis: auto; position: static; height: auto; overflow: visible; padding: 32px 0 24px; border-bottom: 1px solid var(--border); }
  .sidebar .photo { width: 110px; height: 110px; }
  .sidebar nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; border-top: 1px solid var(--border); }
  .sidebar nav a { padding: 6px 10px; border-left: none; }
  .sidebar nav a:hover { border-left: none; }
  main { max-width: 100%; padding: 32px 0 64px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } details > *:not(summary) { animation: none; } }
