/* Homepage styles. posts.html and the posts keep using style.css. */
:root {
  --bg: #ffffff;
  --text: #22262b;
  --ink: #101317;
  --muted: #626a75;
  --line: #e6e7ea;
  --accent: #1a5fb4;
  --award: #b3261e;
  --note-bg: #f4f7fb;
  --note-line: #d9e2f0;
  --font: "Source Sans 3", "Source Sans Pro", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-cn: "STXingkai", "Xingkai SC", "Ma Shan Zheng", "KaiTi", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; }

.wrap { max-width: 920px; margin-inline: auto; padding: 20px 20px 44px; }
section { scroll-margin-top: 18px; }

/* ---------- Top navigation ---------- */
.top { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; font-size: 0.97rem; }
.top a { color: var(--muted); }
.top a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Header: photo, name, links ---------- */
.hero { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 30px; align-items: center; margin-top: 26px; }
.avatar { display: block; width: 132px; height: 132px; border-radius: 50%; object-fit: cover; }
.name { color: var(--ink); font-size: 2.05rem; font-weight: 600; line-height: 1.15; }
.name .cn { margin-left: 0.32em; font-family: var(--font-cn); font-weight: 400; white-space: nowrap; }
.role { margin-top: 5px; color: var(--muted); }
.role br { display: none; }
.icon-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 13px; font-size: 0.97rem; }
.icon-links a { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.icon-links a:hover { color: var(--accent); text-decoration: none; }
.icon-links svg { flex: none; width: 1em; height: 1em; fill: var(--muted); }

.bio { margin-top: 28px; }
.bio p + p { margin-top: 0.7em; }
.notice {
  margin-top: 14px;
  padding: 9px 13px;
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: 6px;
  color: var(--ink);
}

/* ---------- Sections ---------- */
section + section { margin-top: 46px; }
h2 { margin-bottom: 12px; color: var(--ink); font-size: 1.32rem; font-weight: 600; }
.note { margin-top: -6px; color: var(--muted); font-size: 0.9rem; }

/* ---------- Publications ---------- */
.pubs { margin-top: 6px; }
.pub { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: center; padding-block: 13px; }
/* Every thumbnail takes the same 2:1 slot. The files in data/thumb/ are prepared close to 2:1,
   so each one nearly fills it; a new thumbnail should be about 720x360. */
.pub-media { position: relative; aspect-ratio: 2 / 1; }
.pub-media img, .pub-media video, .pub-media model-viewer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.pub-media img, .pub-media video { object-fit: contain; }
.pub-title { margin-bottom: 2px; color: var(--ink); font-size: 1.06rem; font-weight: 600; line-height: 1.35; }
.pub-authors { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.pub-authors a { color: inherit; }
.pub-authors .me { color: var(--ink); font-weight: 700; }
.pub-venue, .pub-links { font-size: 0.95rem; }
.venue { font-style: italic; }
.award { color: var(--award); font-weight: 600; }
.award::before { content: "· "; color: var(--muted); font-weight: 400; }
.sep::before { content: "|"; margin: 0 0.55em; color: var(--line); }

/* ---------- Services, awards, footer ---------- */
.list li + li { margin-top: 4px; }
.label { color: var(--ink); font-weight: 600; }
.awards li { display: grid; grid-template-columns: 3.3em minmax(0, 1fr); column-gap: 8px; }
.awards .year { color: var(--muted); font-variant-numeric: tabular-nums; }
.foot { margin-top: 56px; color: var(--muted); font-size: 0.85rem; }
.visitors { width: 180px; margin-top: 16px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 640px) {
  .top { justify-content: flex-start; gap: 4px 18px; }
  .hero { grid-template-columns: 92px minmax(0, 1fr); gap: 18px; margin-top: 18px; }
  .avatar { width: 92px; height: 92px; }
  .name { font-size: 1.6rem; }
  .icon-links { gap: 6px 18px; margin-top: 4px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pub-media { max-width: 420px; }
}
