/* Zheng Gao — academic homepage
   Sidebar-profile layout in the spirit of academic themes like al-folio:
   clean, typographic, one accent color, no animation gimmicks. */

:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --text: #1d2129;
  --text-2: #4b5563;
  --text-3: #8a919c;
  --accent: #34558b;
  --accent-soft: #e8eef7;
  --rule: #e7e7e4;
  --card-border: #e4e6ea;
  --card-shadow: 0 1px 2px rgba(20, 30, 50, 0.05);
  --card-shadow-hover: 0 4px 14px rgba(20, 30, 50, 0.1);
  --badge-pub-bg: #e3efe6;
  --badge-pub-fg: #22623a;
  --badge-review-bg: #f7edd8;
  --badge-review-fg: #8a5d10;
  --badge-preprint-bg: #ebebeb;
  --badge-preprint-fg: #555;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --surface: #1c1f26;
    --text: #e8e9eb;
    --text-2: #b3b9c2;
    --text-3: #828a94;
    --accent: #8fb0e0;
    --accent-soft: #26324a;
    --rule: #2b2f37;
    --card-border: #2b2f37;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.5);
    --badge-pub-bg: #1e3527;
    --badge-pub-fg: #8fcea5;
    --badge-review-bg: #3a2f17;
    --badge-review-fg: #d8ab4e;
    --badge-preprint-bg: #2a2d33;
    --badge-preprint-fg: #aab0b8;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ======================= Layout ======================= */

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 3.5rem;
}

/* ======================= Sidebar ======================= */

.sidebar {
  position: sticky;
  top: 3rem;
  align-self: start;
}

.avatar,
.avatar-img {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 50%;
  margin-bottom: 1.25rem;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #5b7fb5 100%);
  color: #fff;
  font-family: var(--serif);
  font-size: 2.6rem;
  letter-spacing: 0.05em;
}

.avatar-img {
  object-fit: cover;
}

.sidebar h1 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.role {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.org {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.4rem;
}

.side-links {
  list-style: none;
  font-size: 0.875rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  margin-bottom: 1.4rem;
}

.side-links li {
  margin-bottom: 0.45rem;
}

.side-links a {
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.side-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.li-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  font-size: 0.925rem;
}

.side-nav a {
  color: var(--text-2);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
}

.side-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

/* ======================= Main ======================= */

main {
  min-width: 0;
}

section {
  margin-bottom: 3.25rem;
}

h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--rule);
}

#about p {
  font-size: 1.03rem;
  color: var(--text-2);
  max-width: 44rem;
}

#about em {
  color: var(--text);
  font-style: italic;
}

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
}

/* ======================= News ======================= */

.news-list {
  list-style: none;
  max-width: 44rem;
}

.news-list li {
  display: flex;
  gap: 1.3rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.95rem;
  color: var(--text-2);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  flex: 0 0 5.2rem;
  color: var(--text-3);
  font-size: 0.85rem;
  font-weight: 500;
  padding-top: 0.1rem;
}

.news-list strong {
  color: var(--text);
}

/* ======================= Publications ======================= */

.pub-year {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-3);
  margin: 1.6rem 0 0.9rem;
}

.pub {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pub:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.pub-thumb {
  flex: 0 0 10.5rem;
  display: flex;
  align-items: center;
}

.pub-thumb img {
  width: 100%;
  height: auto;
  max-height: 8rem;
  object-fit: contain;
  border-radius: 6px;
}

.pub-thumb-placeholder {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg));
  border: 1px solid var(--card-border);
  border-radius: 6px;
  min-height: 6.5rem;
  align-items: center;
  justify-content: center;
  display: flex;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.3;
}

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

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.badge-pub {
  background: var(--badge-pub-bg);
  color: var(--badge-pub-fg);
}

.badge-review {
  background: var(--badge-review-bg);
  color: var(--badge-review-fg);
}

.badge-preprint {
  background: var(--badge-preprint-bg);
  color: var(--badge-preprint-fg);
}

.pub-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-2);
}

.pub-authors strong {
  color: var(--text);
}

.pub-venue {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-3);
  margin-bottom: 0.35rem;
}

.pub-links {
  display: flex;
  gap: 0.5rem;
}

.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.14rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
}

.pub-links a:hover {
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
}

/* ======================= Projects ======================= */

/* Same card geometry as .pub, so a project reads as a peer of the entries above. */

.project {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.project:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.project-mark {
  flex: 0 0 10.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6.5rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg));
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--accent);
}

.project-mark-image {
  padding: 0.65rem;
  overflow: hidden;
}

.project-mark-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 8.5rem;
  object-fit: contain;
}

.project-body {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-tagline {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 0.8rem;
}

.project .pub-links {
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ======================= Timeline ======================= */

.timeline {
  list-style: none;
  max-width: 44rem;
}

.timeline li {
  display: flex;
  gap: 1.3rem;
  position: relative;
  padding: 0 0 1.6rem 0;
}

.timeline-date {
  flex: 0 0 7.2rem;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 500;
  padding-top: 0.15rem;
}

.timeline-body {
  border-left: 2px solid var(--rule);
  padding-left: 1.3rem;
  position: relative;
}

.timeline-body::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-role {
  font-weight: 600;
}

.timeline-org {
  font-size: 0.92rem;
  color: var(--text-2);
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

/* ======================= Footer ======================= */

footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ======================= Paper landing pages ======================= */

.paper-page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.paper-back {
  font-size: 0.875rem;
  margin-bottom: 1.6rem;
}

.paper-back a {
  color: var(--text-2);
}

.paper-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0.3rem 0 0.6rem;
}

.paper-page .pub-authors {
  font-size: 0.97rem;
}

.paper-page .pub-venue {
  margin-bottom: 1rem;
}

.paper-page .pub-links {
  margin-bottom: 2rem;
}

.paper-page h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.8rem;
}

.paper-fig {
  margin: 2rem 0;
}

.paper-fig img {
  width: 100%;
  height: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.paper-abstract {
  color: var(--text-2);
  text-align: justify;
}

.paper-bibtex {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-2);
}

.paper-page footer {
  margin-top: 3rem;
}

/* ======================= Responsive ======================= */

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 2.5rem;
  }

  .sidebar {
    position: static;
    text-align: center;
  }

  .avatar,
  .avatar-img {
    margin-left: auto;
    margin-right: auto;
  }

  .side-links a {
    justify-content: center;
  }

  .side-nav {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .pub,
  .project {
    flex-direction: column;
  }

  .pub-thumb,
  .project-mark {
    flex-basis: auto;
  }

  .pub-thumb img {
    max-height: none;
    max-width: 20rem;
  }

  .news-list li,
  .timeline li {
    flex-direction: column;
    gap: 0.1rem;
  }

  .news-date,
  .timeline-date {
    flex: none;
  }

  .timeline-body {
    border-left: none;
    padding-left: 0;
  }

  .timeline-body::before {
    display: none;
  }
}
