/* ============================================================
   Tianyu Jiang, academic website
   Standard academic layout: top bar, left sidebar with photo,
   main content column. Colors are set once in :root.
   ============================================================ */

:root {
  --text: #3a3f44;
  --heading: #222222;
  --muted: #7a8288;
  --border: #e3e6e8;
  --link: #2a6eb5;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.masthead { border-bottom: 1px solid var(--border); }
.masthead-inner {
  max-width: 940px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-title { color: var(--heading); font-weight: 700; font-size: 1.1rem; }
.site-title:hover { text-decoration: none; }
.masthead nav { display: flex; gap: 24px; }
.masthead nav a { color: var(--text); }
.masthead nav a[aria-current="page"] { color: var(--heading); font-weight: 600; border-bottom: 2px solid var(--link); padding-bottom: 2px; }
.masthead nav a:hover { color: var(--link); text-decoration: none; }

/* ---------- page: sidebar + content ---------- */
.page {
  max-width: 940px; margin: 0 auto; padding: 40px 24px 24px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px;
}

.sidebar { font-size: .92rem; }
.photo { display: block; width: 100%; height: auto; border-radius: 4px; margin-bottom: 16px; }
.sidebar .name { font-size: 1.2rem; color: var(--heading); margin: 0 0 6px; }
.sidebar p { margin-bottom: 8px; }

.content { max-width: 620px; }   /* ~70 characters per line */
.content h1 { font-size: 1.8rem; color: var(--heading); margin: 0 0 20px; }
.content h2 {
  font-size: 1.25rem; color: var(--heading);
  margin: 32px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.content h1 + h2 { margin-top: 0; }
.content ul { padding-left: 20px; margin: 0 0 14px; }
.content li { margin-bottom: 6px; }

/* papers */
.paper { margin-bottom: 22px; }
.paper .title { font-weight: 600; margin-bottom: 6px; }
.paper .title .muted { font-weight: 400; }
.abstract { font-size: .95rem; }
details summary { cursor: pointer; color: var(--link); font-size: .95rem; width: max-content; }
details .abstract { margin-top: 8px; }

/* references */
.refs { list-style: none; padding-left: 0 !important; }
.refs li { margin-bottom: 10px; }

/* footer */
.footer {
  max-width: 940px; margin: 24px auto 0; padding: 20px 24px 32px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem; text-align: center;
}

/* ---------- phones: sidebar above content ---------- */
@media (max-width: 760px) {
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .page { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px; }
  .photo { max-width: 180px; }
}
