/* ============================================================
   Han Xu — personal site
   Style follows the classic academic template (Jon Barron lineage):
   Newsreader serif, blue links that turn orange on hover, clean white page.
   Layout is modern flexbox, so it reflows correctly on mobile.
   ============================================================ */

:root {
  --link:        #1772d0;
  --link-hover:  #f09228;
  --text:        #1a1a1a;
  --muted:       #555;
  --rule:        #e6e6e6;
  --accent:      #0074d9;
  --sans:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --maxw:        800px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 20px;
  background: #fff;
  color: var(--text);
  font-family: 'Newsreader', Georgia, 'Noto Serif TC', serif;
  font-size: 16px;
  line-height: 1.6;
}

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

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

img { max-width: 100%; }

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

/* ---------- Header: bio + photo ---------- */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.header .bio { flex: 1 1 340px; min-width: 0; }

.header .photo { flex: 0 0 210px; text-align: center; }
.header .photo img {
  width: 210px;
  height: 210px;
  object-fit: cover;
  border-radius: 6px;
}

.name {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.name-note {
  margin: 0 0 18px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

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

.links {
  margin-top: 20px;
  text-align: center;
}

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

h2 {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}

/* ---------- News ---------- */
.item { margin-bottom: 12px; }

/* ---------- Publications ---------- */
.pub {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 20px 0;
}

.pub.featured {
  background: #fffbe6;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 20px;
}

.pub .thumb { flex: 0 0 150px; }
.pub .thumb img {
  width: 150px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: block;
}

.pub .info { flex: 1 1 auto; min-width: 0; }

.papertitle { font-weight: 700; font-size: 15px; }

.venue { font-style: italic; color: var(--muted); }

.desc { margin: 8px 0 0; color: #333; }

/* ---------- Footer ---------- */
footer {
  margin-top: 60px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .container { padding: 28px 0 48px; }

  .header { gap: 22px; }
  .header .photo { order: -1; flex-basis: auto; }   /* photo above bio */
  .header .photo img { width: 170px; height: 170px; }

  .pub { flex-direction: column; align-items: center; gap: 14px; }
  .pub .thumb { flex-basis: auto; }
  .pub .info { width: 100%; }
}
