/* ==========================================================================
   Zonghao Guo — academic homepage
   Sidebar + content layout in the style of academic Jekyll homepages, with
   tabbed sections. Plain CSS, no build step.
   ========================================================================== */

:root {
  --link: #2f7d95;
  --link-hover: #358ca7;
  --venue: #c62828;
  --btn: #6f777d;
  --btn-hover: #5c6368;

  --ink: #3d4144;
  --ink-strong: #202325;
  --ink-dim: #6b7278;
  --line: #f2f3f3;
  --line-strong: #e4e6e7;
  --bg: #ffffff;
  --bg-alt: #fafafa;

  /* Everything is sized in rem, so --base scales the whole page at once. */
  --base: 22px;
  --sidebar-w: 340px;
  --font: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI",
          "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--base); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink-strong); line-height: 1.3; margin: 0; font-weight: 700; }
p { margin: 0 0 1.3em; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
sup { font-size: .72em; }
b, strong { color: var(--ink-strong); font-weight: 700; }

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

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 50%; z-index: 50;
  transform: translate(-50%, -200%);
  padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: #fff; font-size: .9rem; font-weight: 600;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* -------------------------------- layout --------------------------------- */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 38px 28px 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* -------------------------------- sidebar -------------------------------- */
.sidebar { position: sticky; top: 28px; }

.avatar {
  width: 210px; height: 210px;
  margin-bottom: 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 4px;
  background: #fff;
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover; object-position: center center;
}

.author-name { font-size: 1.45rem; font-weight: 700; }
.author-name-cn {
  margin: 2px 0 12px;
  color: var(--ink-dim); font-size: 1rem; letter-spacing: .16em;
}
.author-bio { margin: 0 0 18px; color: var(--ink); font-size: .96rem; }
.author-topic { color: var(--ink-dim); font-size: .88rem; }

.author-links { font-size: .9rem; }
.author-links li {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 5px 0;
  color: var(--ink);
  word-break: break-word;
}
.author-links .ico {
  flex: none; width: 16px; height: 16px; margin-top: 5px;
  color: var(--ink-dim);
}
.author-links svg { width: 100%; height: 100%; fill: currentColor; }

.visitors { margin-top: 22px; line-height: 0; }

/* ------------------------------- sections -------------------------------- */
.page-content { padding-bottom: 40px; }

.section + .section { margin-top: 2.4em; }

.section h2 {
  font-size: 1.4rem;
  padding-bottom: .45em; margin: 0 0 1em;
  border-bottom: 1px solid var(--line);
}
.section * + h2 { margin-top: 2.2em; }
.section h3 { font-size: 1.06rem; }

/* body copy is justified on both edges; short lines such as publication
   metadata stay left-aligned, where justification would look stretched */
.section > p, .bullets li, .cv-body p { text-align: justify; }

.bullets li {
  position: relative;
  padding-left: 18px; margin-bottom: 9px;
}
.bullets li::before {
  content: ""; position: absolute; top: .72em; left: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-dim);
}
.awards li { color: var(--ink); }

/* ----------------------------- publications ------------------------------ */
.pub-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 12px;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  padding: 5px 12px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  background: #fff; color: var(--ink-dim);
  font-family: var(--font); font-size: .84rem; font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.filter:hover { color: var(--ink-strong); border-color: var(--ink-dim); }
.filter.is-active { background: var(--btn); border-color: var(--btn); color: #fff; }

.search { margin-left: auto; }
.search input {
  width: 300px; max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  background: #fff; color: var(--ink);
  font-family: var(--font); font-size: .86rem;
}
.search input::placeholder { color: #9aa0a5; }
.search input:focus { outline: none; border-color: var(--link); }

.filter-status { margin: 0 0 1.6em; color: var(--ink-dim); font-size: .85rem; }

.pub {
  display: grid; grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px; align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.pub:first-child { border-top: 0; padding-top: 0; }
.pub[hidden] { display: none; }

.pub-thumb { border: 1px solid var(--line); background: var(--bg-alt); }
.pub-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* stand-in used until a paper figure is added to files/PaperFig/ */
.pub-thumb.is-placeholder {
  display: grid; place-items: center;
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(-45deg, #fafbfc, #fafbfc 8px, #f4f6f8 8px, #f4f6f8 16px);
}
.pub-thumb.is-placeholder span {
  color: var(--ink-dim); font-size: .9rem; font-weight: 700;
  letter-spacing: .04em; line-height: 1.25; text-align: center;
}

.pub-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--bg-alt);
  color: var(--ink-dim); font-size: .78rem; font-weight: 600;
}
.chip b { color: var(--ink-strong); font-weight: 700; }
.chip-ico { width: 1em; height: 1em; fill: currentColor; vertical-align: -.14em; }
.chip-emoji { font-size: 1em; line-height: 1; }

.pub-body { min-width: 0; }
.pub-title { font-size: 1.04rem; font-weight: 700; margin: -2px 0 4px; }
.pub-venue {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px;
  margin: 0 0 5px;
}
.pub-venue .venue { color: var(--venue); font-size: .9rem; font-weight: 700; }
.venue-note { color: var(--ink-dim); font-size: .84rem; font-weight: 500; }

/* authorship role, the first thing a reviewer looks for */
.role {
  padding: 1px 9px;
  border: 1px solid; border-radius: 3px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.role.is-first { border-color: #b9d4bd; background: #eef7ef; color: #1f6b39; }
.role.is-corr { border-color: #c3d2ea; background: #eef3fb; color: #1a4f8a; }
.role.is-other { border-color: var(--line-strong); background: var(--bg-alt); color: var(--ink-dim); }

/* paper-level distinctions: best paper candidate, influential paper lists */
.honor {
  padding: 1px 9px;
  border: 1px solid #e3c98f; border-radius: 3px;
  background: #fdf6e6; color: #8a5a12;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
a.honor:hover { background: #fbeecd; color: #6f460b; text-decoration: none; }
.pub-authors { margin: 0 0 4px; font-size: .93rem; }
.pub-note { margin: 0; color: var(--ink-dim); font-size: .91rem; }

.pub-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 15px;
  border-radius: 3px;
  background: var(--btn); color: #fff;
  font-size: .84rem; font-weight: 600;
}
.btn .chip-ico { width: .95em; height: .95em; }
.btn:hover { background: var(--btn-hover); color: #fff; text-decoration: none; }

.pub-empty { color: var(--ink-dim); }

/* ------------------------------- experience ------------------------------ */
.cv-list li {
  display: grid; grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.cv-list li:first-child { border-top: 0; padding-top: 0; }
.cv-period { color: var(--ink-dim); font-size: .9rem; font-weight: 600; }
.cv-body h3 { margin: 0 0 4px; }
.cv-body p { margin: 0; font-size: .94rem; }

/* --------------------------------- footer -------------------------------- */
.page-footer {
  padding: 18px 0 34px;
  border-top: 1px solid var(--line);
}
.page-footer p { margin: 0; color: var(--ink-dim); font-size: .84rem; }

/* ------------------------------- responsive ------------------------------ */
@media (max-width: 1240px) {
  :root { --base: 20px; --sidebar-w: 300px; }
  .pub { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  :root { --base: 19px; }
  .layout {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 30px 24px 0;
  }
  .sidebar { position: static; }
  .sidebar-inner {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 8px 30px;
    align-items: start;
  }
  .avatar { width: 190px; height: 190px; margin: 0; grid-row: span 5; }
  .author-name, .author-name-cn, .author-bio, .author-links { grid-column: 2; }
  .author-bio { margin-bottom: 10px; }
  .visitors { grid-column: 1 / -1; margin-top: 16px; }
}

@media (max-width: 780px) {
  :root { --base: 18px; }
  .sidebar-inner { grid-template-columns: 1fr; }
  .avatar { width: 150px; height: 150px; grid-row: auto; }
  .author-name, .author-name-cn, .author-bio, .author-links { grid-column: 1; }
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub-thumb { max-width: 420px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .cv-list li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 480px) {
  :root { --base: 17px; }
  .layout { padding: 22px 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --------------------------------- print --------------------------------- */
@media print {
  .skip-link, .pub-toolbar, .filter-status, .visitors, .page-footer { display: none !important; }
  :root { --base: 11pt; }
  .layout { display: block; max-width: none; padding: 0; }
  .sidebar { position: static; float: left; width: 170px; margin: 0 24px 12px 0; }
  .avatar { width: 150px; height: 150px; }
  .pub { grid-template-columns: 150px minmax(0, 1fr); }
  .section h2 { margin-top: 20pt; break-after: avoid; }
  .pub, .cv-list li { break-inside: avoid; }
  a { color: var(--ink-strong); }
  .btn { background: none; color: var(--ink-strong); padding: 0; }
  .btn::after { content: ""; }
}
