/* ============================================================
   Yuan He — Academic Homepage
   Clean academic style · light theme
   ============================================================ */

:root {
  --accent: #5b2c8d;          /* Tsinghua purple, muted */
  --accent-dark: #43216a;
  --ink: #1f2328;
  --ink-soft: #495057;
  --ink-faint: #868e96;
  --paper: #ffffff;
  --bg: #fafafa;
  --line: #e3e6ea;
  --tag-bg: #f1eaf8;
  --tag-ink: #5b2c8d;
  --link: #2b6cb0;
  --maxw: 1000px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .cn { font-weight: 400; color: var(--ink-faint); font-size: 16px; margin-left: 6px; }

nav.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }

nav.main-nav a {
  display: block;
  padding: 6px 12px;
  font-size: 15px;
  color: var(--ink-soft);
  border-radius: 6px;
}
nav.main-nav a:hover { color: var(--accent); background: var(--tag-bg); text-decoration: none; }
nav.main-nav a.active { color: var(--accent); font-weight: 600; background: var(--tag-bg); }

/* ---------- Hero (home) ---------- */
.hero {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 48px 0 24px;
}

.hero .photo {
  flex: 0 0 220px;
}

.hero .photo img {
  width: 220px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.hero .intro { flex: 1; }

.hero h1 {
  font-size: 34px;
  margin: 0 0 2px;
}
.hero .title-line {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.hero .title-line .cn-name { font-size: 15px; color: var(--ink-faint); }

.hero p { margin: 0 0 14px; }

.contact-box {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}
.contact-box strong { color: var(--accent); }

.recruit-callout {
  margin-top: 20px;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--tag-bg);
  border-radius: 0 8px 8px 0;
  font-size: 15.5px;
}
.recruit-callout a { font-weight: 600; }

/* ---------- Sections ---------- */
section { padding: 28px 0; }

.section-title {
  font-size: 24px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ---------- News list ---------- */
ul.news-list { list-style: none; margin: 0; padding: 0; }

ul.news-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  border-bottom: 1px dashed var(--line);
  font-size: 15.5px;
}
ul.news-list li:last-child { border-bottom: none; }
ul.news-list li::before {
  content: "◆";
  position: absolute;
  left: 4px;
  top: 8px;
  color: var(--accent);
  font-size: 10px;
}

/* ---------- Venue tags ---------- */
.tag {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--tag-ink);
  background: var(--tag-bg);
  border: 1px solid #e0d3ee;
  border-radius: 4px;
  vertical-align: 1px;
  white-space: nowrap;
}

.tag.award {
  color: #9a5b00;
  background: #fdf3e0;
  border-color: #f0dfc0;
}

/* ---------- Publications ---------- */
.pub-note {
  padding: 12px 16px;
  background: #fffaf0;
  border: 1px solid #f0e2c0;
  border-radius: 8px;
  margin-bottom: 28px;
  font-size: 15px;
}

.pub-section-title {
  font-size: 20px;
  margin: 34px 0 14px;
}

ol.pub-list {
  margin: 0;
  padding: 0 0 0 0;
  list-style: none;
  counter-reset: pub;
}

ol.pub-list li {
  counter-increment: pub;
  position: relative;
  padding: 10px 0 10px 44px;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
}
ol.pub-list li::before {
  content: counter(pub) ".";
  position: absolute;
  left: 8px;
  top: 12px;
  color: var(--ink-faint);
  font-family: Georgia, serif;
  font-size: 14px;
}

ol.pub-list .authors { color: var(--ink-soft); }
ol.pub-list .venue { font-style: italic; color: var(--ink); }
ol.pub-list .paper-title { font-weight: 600; }
ol.pub-list em.star { color: var(--accent); font-style: normal; font-weight: 700; }

/* ---------- Services / Talks ---------- */
.svc-block { margin-bottom: 30px; }

.svc-block h3 {
  font-size: 18px;
  margin: 0 0 10px;
  color: var(--accent-dark);
}

ul.svc-list { list-style: none; margin: 0; padding: 0; }
ul.svc-list li {
  padding: 5px 0 5px 20px;
  position: relative;
  border-bottom: 1px dashed var(--line);
  font-size: 15.5px;
}
ul.svc-list li:last-child { border-bottom: none; }
ul.svc-list li::before {
  content: "–";
  position: absolute;
  left: 4px;
  color: var(--ink-faint);
}

.year-range { color: var(--ink-faint); font-size: 14px; }
.distinction { color: #9a5b00; font-size: 13.5px; font-weight: 600; }

/* ---------- Recruit page ---------- */
.recruit-section { margin-bottom: 36px; }
.recruit-section h2 { font-size: 22px; margin: 0 0 12px; }

ol.plain-list li, ul.plain-list li { margin-bottom: 6px; }

.remun-box {
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 26px 0 34px;
  font-size: 14px;
  color: var(--ink-faint);
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { flex-direction: column; align-items: center; text-align: left; }
  .hero .photo { flex: none; }
  .site-header .container { justify-content: center; }
}

/* ---------- Collapsible blocks ---------- */
.list-hint {
  font-size: 14px;
  color: var(--ink-faint);
  margin: -6px 0 18px;
}

details.year-group,
details.collapse-block {
  border-bottom: 1px solid var(--line);
  padding: 4px 0 8px;
}

details.year-group > summary,
details.collapse-block > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--accent-dark);
}
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }

details.year-group > summary::before,
details.collapse-block > summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 13px;
  transition: transform 0.15s ease;
}
details[open] > summary::before { content: "▾"; }
details > summary:hover { color: var(--accent); }

details.collapse-block > summary .block-title {
  font-size: 18px;
  color: var(--accent-dark);
}

details > summary .count {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-faint);
}

@media print {
  .site-header, .site-footer { display: none; }
  details { display: block; }
  details > summary { display: none; }
}


.tag.keynote {
  color: #5b2c8d;
  background: #f1e8fa;
  border-color: #ddc9f0;
}

.selected-talks {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px 14px;
  margin-bottom: 34px;
  background: #fbf9fd;
}

.selected-talks h3 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 20px;
  color: var(--accent-dark);
  margin: 0 0 12px;
}

.archive-title {
  margin: 0 0 4px;
}
