/* ──────────────────────────────────────────────
   Zizhao Li — academic homepage
   Plain CSS, no dependencies.
─────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:      #c0392b;   /* crimson */
  --accent-soft: #fbeae8;   /* tinted accent background */
  --text:        #1f2733;
  --muted:       #515a67;
  --faint:       #6b7480;
  --border:      #e6e9ef;
  --page:        #f4f5f8;   /* page background tint */
  --bg:          #ffffff;   /* card / surface */
  --card:        #eef1f6;
  --shadow:      0 1px 2px rgba(20,30,50,.04), 0 4px 16px rgba(20,30,50,.05);
}

:root[data-theme="dark"] {
  --accent:      #ff7a6b;
  --accent-soft: #3a1f1c;
  --text:        #e7eaf0;
  --muted:       #b3bccb;
  --faint:       #8c95a4;
  --border:      #2a2f3a;
  --page:        #0f1115;   /* page background tint */
  --bg:          #181b22;   /* card / surface */
  --card:        #232831;
  --shadow:      0 1px 2px rgba(0,0,0,.2), 0 4px 18px rgba(0,0,0,.35);
}

html { scroll-behavior: smooth; }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--page);
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 32px 96px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); }

/* ── Header ── */
header {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
}

.avatar,
.avatar-placeholder {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
}

.avatar { object-fit: cover; background: var(--card); }

.avatar-placeholder {
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--faint);
  user-select: none;
}

.header-text h1 {
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.header-text .subtitle { color: var(--accent); font-weight: 600; font-size: 1rem; margin-top: 6px; }
.header-text .affiliation { color: var(--muted); margin-top: 1px; font-size: 0.95rem; }

.contact-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 13px;
  transition: color .15s, border-color .15s, background .15s;
}
.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.contact-links svg { width: 14px; height: 14px; }

#theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* divider under header */
header + section { margin-top: 36px; }

/* ── Sections ── */
section { margin-top: 46px; }

h2 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
h2 svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  flex-shrink: 0;
}

.note { font-size: 0.82rem; color: var(--faint); margin-top: -12px; margin-bottom: 16px; }
.equal { color: var(--accent); }

/* ── Bio ── */
.bio p { margin-bottom: 12px; color: var(--text); }
.bio p:last-child { margin-bottom: 0; }

/* ── Interests ── */
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.86rem;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ── Publications ── */
.pub-list { list-style: none; }
.pub-list li {
  position: relative;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.pub-list li:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}

.pub-title { font-weight: 600; color: var(--text); line-height: 1.4; }
.pub-authors { font-size: 0.9rem; color: var(--muted); margin-top: 2px; }
.pub-authors strong { color: var(--text); font-weight: 700; }
.pub-venue { font-size: 0.86rem; margin-top: 4px; color: var(--muted); }

.venue-tag {
  display: inline-block;
  background: #196ca3;   /* conference — dblp blue */
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.venue-tag.journal  { background: #c32b72; }   /* journal — dblp magenta */
.venue-tag.preprint { background: #606b70; }   /* preprint — dblp grey */

.oral {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.metric {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.award {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.award.gold {
  color: #8a6400;
  background: #fff6da;
  border: 1px solid #ecc94b;
}
.award.champion {
  color: #1e6b4f;
  background: #dcf5ea;
  border: 1px solid #4fb98c;
}
:root[data-theme="dark"] .award.gold {
  color: #ffd866;
  background: #352b0f;
  border-color: #b8941f;
}
:root[data-theme="dark"] .award.champion {
  color: #7fe0b6;
  background: #11302470;
  border-color: #2e9e74;
}

.pub-links { margin-top: 9px; display: flex; gap: 7px; flex-wrap: wrap; }
.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 11px;
  transition: background 0.15s, color 0.15s;
}
.pub-links a:hover { background: var(--accent); color: #fff; }

/* ── Scholarships, Awards & Funding ── */
.award-list { list-style: none; }
.award-list li {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text);
}
.award-year {
  flex-shrink: 0;
  width: 46px;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
}
.award-body { flex: 1; line-height: 1.5; }
.award-for {
  font-style: italic;
  color: var(--muted);
}
.award-for::before {
  content: "— ";
  font-style: normal;
  color: var(--faint);
}

/* ── Education & Experience ── */
.entry { margin-bottom: 24px; }
.entry:last-child { margin-bottom: 0; }
.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}
.entry-header .org { font-weight: 700; color: var(--text); }
.entry-header .period {
  color: var(--faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.entry-role { color: var(--accent); font-size: 0.92rem; font-weight: 500; margin-top: 1px; }
.entry-loc { color: var(--faint); font-size: 0.85rem; font-weight: 400; }
.entry ul { margin-top: 7px; padding-left: 18px; font-size: 0.92rem; color: var(--muted); }
.entry ul li { margin-bottom: 4px; }
.entry ul li::marker { color: var(--faint); }

/* ── Skills ── */
.skills-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.skills-table td { padding: 8px 10px 8px 0; vertical-align: top; border-top: 1px solid var(--border); }
.skills-table tr:first-child td { border-top: none; }
.skills-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
  padding-right: 22px;
  width: 180px;
  color: var(--text);
}
.skills-table td:last-child { color: var(--muted); }

/* ── Footer ── */
footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: 0.8rem;
  color: var(--faint);
  text-align: center;
}

@media (max-width: 560px) {
  body { padding: 40px 20px 72px; }
  header { flex-direction: column; align-items: center; text-align: center; }
  .header-text h1 { font-size: 2rem; }
  .contact-links { justify-content: center; }
  .entry-header { flex-direction: column; }
  #theme-toggle { position: static; margin-top: 14px; }
}
