/* ============================================================
   Haofu Liao — homepage (modern, no-build static)
   Plain CSS: custom properties, flexbox/grid, fluid responsive.
   No framework, no jQuery.
   ============================================================ */

:root {
  --max-width: 880px;
  --nav-height: 56px;

  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --link: #005eb8;
  --link-hover: #0a7cf0;
  --border: #e5e7eb;
  --accent: #005eb8;
  --award: #b91616;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
  text-decoration: none;
}
/* ---------- Layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 64px;
}
section { scroll-margin-top: calc(var(--nav-height) + 16px); }

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 44px 0 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ---------- Profile / hero ---------- */
.profile {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 48px 0 8px;
}
.profile-photo {
  flex-shrink: 0;
  width: 190px;
  text-align: center;
}
.profile-photo img {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.photo-title {
  margin: 12px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.photo-title a { font-weight: 600; }
.profile-photo .contact {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.profile-body h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.name-zh {
  color: var(--text);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Kaiti TC", "Zhi Mang Xing", serif;
  font-weight: 500;
  font-size: 2rem;
  margin-left: 12px;
}
.profile-body p { margin: 0 0 14px; }

/* Social links (icon + label, single-column list under photo) */
.socials {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  text-align: left;
}
.socials a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.socials a:hover { color: var(--accent); }
.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---------- News ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.news-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
  padding-top: 1px;
}
/* ---------- Section head with "see all" ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 44px 0 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.section-head .section-title {
  margin: 0;
  padding: 0;
  border: none;
}
.section-head .see-all { font-size: 0.9rem; white-space: nowrap; }

/* ---------- Research / projects ---------- */
.subsection-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 26px 0 6px;
}
.proj {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
  padding: 16px 6px;
  border-bottom: 1px dashed var(--border);
}
.proj-thumb {
  width: 180px;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.proj-thumb img {
  max-width: 100%;
  max-height: 116px;
  width: auto;
  height: auto;
  border-radius: 6px;
}
.proj-title { font-weight: 600; margin: 0 0 2px; }
.proj-meta { color: var(--text-muted); font-size: 0.84rem; margin: 0 0 5px; }
.proj-desc { font-size: 0.92rem; margin: 0 0 8px; }
.proj-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.proj-links a {
  font-size: 0.8rem;
  padding: 3px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-alt);
}
.proj-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg);
  text-decoration: none;
}

/* ---------- Publications ---------- */
.pub {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 14px;
  border-radius: var(--radius);
}
.pub:nth-child(even) { background: var(--bg-alt); }
.pub-thumb {
  width: 150px;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pub-thumb img {
  max-width: 100%;
  max-height: 95px;
  width: auto;
  height: auto;
  border-radius: 6px;
}
.pub-title { font-weight: 600; margin: 0 0 4px; }
.pub-authors { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 2px; }
.pub-venue { font-size: 0.92rem; margin: 0; }
.pub-venue b { color: var(--text); }
.award { color: var(--award); font-weight: 600; }

/* ---------- Full publications page ---------- */
.pub-year {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin: 30px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.pub-full {
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
}
.pub-full i { color: var(--text); }
.intro { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- Footer ---------- */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .profile { flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .profile-photo img { width: 160px; height: 160px; }
  .profile-body { text-align: left; }
  .profile-body h1 { text-align: center; }
  .pub, .proj { grid-template-columns: 1fr; }
  .pub-thumb, .proj-thumb { width: 100%; height: auto; }
  .pub-thumb img, .proj-thumb img { max-height: 160px; }
  .news-list li { grid-template-columns: 78px 1fr; }
}
