/* ==========================================================================
   Yi Zhang — single-column academic homepage theme
   (clean, minimal; inspired by slhleosun.github.io)
   ========================================================================== */

:root {
  --bg:        #ffffff;
  --text:      #1a1a1a;
  --muted:     #6b7280;
  --accent:    #2f6db3;
  --accent-2:  #4a90e2;
  --border:    #e7e7e7;
  --card-bg:   #fafafa;
  --tag-bg:    #eef3fb;
  --maxw:      760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; }

/* ---------- layout shell ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------- top navigation ---------- */
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: baseline;
}
.site-nav a {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.current {
  color: var(--text);
  font-weight: 700;
}

/* ---------- hero / header ---------- */
.hero { padding-top: 26px; }
.hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.hero .affiliation {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0;
}

/* ---------- intro: bio + photo ---------- */
.intro {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 26px;
}
.intro-text { flex: 1 1 auto; min-width: 0; }
.intro-text p:first-child { margin-top: 0; }
.intro-photo {
  flex: 0 0 180px;
  text-align: center;
}
.intro-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* ---------- social icons ---------- */
.social {
  display: flex;
  gap: 20px;
  font-size: 1.5rem;
  margin: 22px 0 8px;
}
.social a {
  color: var(--muted);
  transition: color 0.15s ease;
}
.social a:hover { color: var(--accent); text-decoration: none; }

/* ---------- section headings ---------- */
.section { margin-top: 48px; }
.section > h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

/* ---------- news ---------- */
.news-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}
.news-item {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  flex: 0 0 92px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  padding-top: 1px;
}
.news-body { flex: 1 1 auto; }
.news-body p { margin: 0; }

/* ---------- publications ---------- */
.pub {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }
.pub-thumb {
  flex: 0 0 180px;
}
.pub-thumb img {
  width: 180px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}
.pub-info { flex: 1 1 auto; min-width: 0; }
.pub-venue {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.pub-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.pub-authors { color: var(--text); font-size: 0.95rem; margin: 0 0 2px; }
.pub-authors .me { font-weight: 700; }
.pub-meta { color: var(--muted); font-size: 0.9rem; font-style: italic; margin: 0 0 8px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--accent);
}
.pub-links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ---------- generic content pages (Research, CV, Blog, Life) ---------- */
.page-content h1 { font-size: 2rem; font-weight: 800; margin-top: 0; }
.page-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 38px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.page-content h3 { font-size: 1.12rem; font-weight: 700; margin-top: 26px; }
.page-content ul { padding-left: 1.25rem; }
.page-content table { border-collapse: collapse; }
.page-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.page-content code {
  background: var(--card-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .intro { flex-direction: column-reverse; align-items: center; text-align: left; }
  .intro-photo { flex-basis: auto; }
  .pub { flex-direction: column; }
  .pub-thumb, .pub-thumb img { width: 100%; }
  .pub-thumb img { height: 160px; }
  .news-date { flex-basis: 74px; }
  .hero h1 { font-size: 1.8rem; }
}
