/* ============================================================
   Hao Zhong — academic homepage
   Minimal classic academic style · light/dark via [data-theme]
   ============================================================ */

:root {
  --accent:      #2563b5;
  --accent-soft: #2563b512;
  --bg:          #ffffff;
  --bg-rail:     #ffffff;
  --surface:     #f6f7f9;
  --surface-2:   #eef1f4;
  --border:      #e4e7ec;
  --text:        #1c2530;
  --text-soft:   #56606e;
  --text-mute:   #8a93a0;
  --badge-bg:    #eef2f7;
  --badge-text:  #3a4652;
  --shadow:      0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
:root[data-theme="dark"] {
  --accent:      #6aa9e9;
  --accent-soft: #6aa9e91f;
  --bg:          #0e1116;
  --bg-rail:     #0e1116;
  --surface:     #161b22;
  --surface-2:   #1c232d;
  --border:      #262d38;
  --text:        #e6eaf0;
  --text-soft:   #aab4c0;
  --text-mute:   #6e7885;
  --badge-bg:    #1c232d;
  --badge-text:  #aab4c0;
  --shadow:      0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- layout ---------- */
.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 32px 40px;
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---------- left rail ---------- */
.rail { position: sticky; top: 48px; }
.rail .avatar {
  width: 168px; height: 168px; border-radius: 14px;
  object-fit: cover; display: block;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.rail h1 { font-size: 1.62rem; margin: 0 0 2px; letter-spacing: -.01em; }
.rail .tagline { color: var(--text-soft); font-size: .95rem; margin: 10px 0 2px; }
.rail .affil { color: var(--text-mute); font-size: .88rem; margin: 8px 0 0; }
.rail .affil .loc::before { content: "📍 "; }

.rail .links { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 2px; }
.rail .links a {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; margin-left: -8px; border-radius: 7px;
  color: var(--text-soft); font-size: .92rem;
}
.rail .links a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.rail .links svg { width: 16px; height: 16px; flex: none; }

.cv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 8px 16px;
  background: var(--accent); color: #fff !important;
  border-radius: 8px; font-size: .9rem; font-weight: 500;
}
.cv-btn:hover { text-decoration: none; filter: brightness(1.06); }

/* ---------- content blocks ---------- */
.content { min-width: 0; }
.block { margin-bottom: 44px; }
.block h2 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-mute); font-weight: 600;
  margin: 0 0 16px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head h2 { flex: 1; }
.prose p { margin: 0 0 12px; color: var(--text); }
.prose p:last-child { margin-bottom: 0; }

/* ---------- news ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: flex; gap: 16px; padding: 7px 0; font-size: .95rem; align-items: baseline; }
.news li + li { border-top: 1px dashed var(--border); }
.news .date {
  flex: none; width: 78px; color: var(--text-mute);
  font-variant-numeric: tabular-nums; font-size: .85rem; padding-top: 1px;
}
.news .body { color: var(--text-soft); }

/* ---------- publications ---------- */
.scholar-note { font-size: .84rem; color: var(--text-mute); margin: -6px 0 18px; }
.pub-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.pub-toggle button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .82rem; color: var(--text-soft);
  padding: 4px 12px; border-radius: 6px;
}
.pub-toggle button.on { background: var(--bg); color: var(--text); box-shadow: var(--shadow); }

.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: 16px 0; }
.pub + .pub { border-top: 1px solid var(--border); }
.pub .ptitle { font-weight: 600; font-size: 1.01rem; line-height: 1.4; margin: 0 0 4px; letter-spacing: -.005em; }
.pub .ptitle .selstar { color: var(--accent); margin-left: 6px; font-size: .8em; }
.pub .authors { font-size: .9rem; color: var(--text-soft); margin: 0 0 7px; }
.pub .authors .me { color: var(--text); font-weight: 600; }
.pub .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub .venue { font-size: .84rem; color: var(--text-soft); font-weight: 500; }
.badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-text);
}
.badge.tag { background: var(--accent-soft); color: var(--accent); }
.pub .plinks { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pub .plinks a {
  font-size: .78rem; padding: 2px 9px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--text-soft);
}
.pub .plinks a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pub .pnote { font-size: .8rem; color: var(--text-mute); margin: 6px 0 0; font-style: italic; }
.pub .pnote.confirm::before { content: "⚠ "; }

/* ---------- timeline (exp / edu) ---------- */
.timeline { display: flex; flex-direction: column; gap: 18px; }
.tl-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.tl-item .role { font-weight: 600; }
.tl-item .org { color: var(--text-soft); font-size: .95rem; }
.tl-item .period { color: var(--text-mute); font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tl-item .detail { grid-column: 1 / -1; color: var(--text-soft); font-size: .92rem; margin-top: 2px; }

/* ---------- footer ---------- */
.foot { color: var(--text-mute); font-size: .82rem; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---------- theme button ---------- */
.theme-btn {
  position: fixed; top: 20px; right: 20px; z-index: 10;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 16px;
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding: 40px 22px; }
  .rail { position: static; }
  .rail .links { flex-direction: row; flex-wrap: wrap; margin-top: 12px; }
}
@media (max-width: 460px) {
  .tl-item { grid-template-columns: 1fr; }
  .tl-item .period { text-align: left; }
}
