/* Yichong Nie — academic homepage. Standalone stylesheet, no external assets. */
:root {
  --ink: #0b2545;
  --body: #26364a;
  --muted: #5a6b80;
  --line: #dfe5ec;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --accent: #2e74b5;
  --accent-dark: #1f4d78;
  --radius: 10px;
  --wrap: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-dark); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { font-weight: 700; letter-spacing: .12em; color: var(--ink); font-size: 14px; }
.anchor-nav { display: flex; gap: 18px; overflow-x: auto; }
.anchor-nav a { font-size: 14px; color: var(--muted); white-space: nowrap; }
.anchor-nav a:hover { color: var(--accent-dark); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.hero-inner { display: flex; align-items: center; gap: 36px; justify-content: space-between; }
.hero-text { min-width: 0; }
h1 { margin: 0 0 10px; font-size: 40px; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
.tagline { margin: 0 0 10px; font-size: 19px; color: var(--accent-dark); }
.affiliation { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.hero-links { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-link {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; color: var(--ink); background: #fff;
}
.hero-link:hover { border-color: var(--accent); text-decoration: none; }
.hero-link.download {
  background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; font-weight: 600;
}
.hero-link.download:hover { background: #17406a; text-decoration: none; }
.hero-link.download .ico { color: #fff; }
.ico { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.pub-meta sup.star, .star { color: #c0392b; font-weight: 700; }
.note { color: var(--muted); font-size: 12.5px; }
.meta.advisors a, .meta a { color: var(--accent-dark); }
.portrait { margin: 0; flex: 0 0 auto; }
.portrait img {
  width: 200px; height: 200px; object-fit: cover;
  border-radius: 50%; border: 4px solid #fff; box-shadow: 0 8px 24px rgba(11, 37, 69, .12);
}

/* ---------- sections ---------- */
.section { padding: 44px 0; }
.section.alt { background: var(--bg-alt); }
h2 {
  margin: 0 0 18px; font-size: 22px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block;
}
h3 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.sub { margin: 22px 0 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 14px; }
.lead { font-size: 17px; color: var(--ink); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.tags li {
  background: #eaf1f8; color: var(--accent-dark);
  border-radius: 999px; padding: 5px 13px; font-size: 13.5px;
}

/* ---------- news ---------- */
/* 超过 5 条时，News 区域内滚动（不撑长整页） */
.news-scroll { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
.news-scroll.scrollable { padding-right: 8px; border-right: 1px solid var(--line); }
.news-scroll::-webkit-scrollbar { width: 8px; }
.news-scroll::-webkit-scrollbar-track { background: #eef1f5; border-radius: 4px; }
.news-scroll::-webkit-scrollbar-thumb { background: #c3ccd8; border-radius: 4px; }
.news-scroll::-webkit-scrollbar-thumb:hover { background: #a9b4c2; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.news li:last-child { border-bottom: 0; }
.news .date { flex: 0 0 78px; color: var(--accent-dark); font-variant-numeric: tabular-nums; font-size: 14px; }
.news .txt { flex: 1; min-width: 0; }

/* ---------- publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; margin-bottom: 0; }
.pub-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.pub-meta, .pub-venue { color: var(--muted); font-size: 14.5px; margin-bottom: 4px; }
.pub-venue { font-style: italic; }
.pill {
  display: inline-block; border: 1px solid var(--accent); color: var(--accent-dark);
  border-radius: 999px; padding: 3px 12px; font-size: 13px; margin-right: 6px;
}
.pill:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ---------- research items ---------- */
.items { display: flex; flex-direction: column; gap: 26px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.item .meta { color: var(--muted); font-size: 14.5px; margin-bottom: 6px; }
.item .period { float: right; font-variant-numeric: tabular-nums; }
.bullets { margin: 8px 0 0; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }
.links { margin-top: 10px; }

/* ---------- deliverables / education ---------- */
.deliverables, .edu-list { list-style: none; margin: 0; padding: 0; }
.deliverable, .edu { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.deliverable .meta, .edu .meta { color: var(--muted); font-size: 14.5px; margin: 4px 0 0; }
.edu-degree { font-weight: 600; color: var(--ink); margin: 0; }

/* ---------- contact / footer ---------- */
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 24px 0 32px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.foot-meta { color: var(--muted); font-size: 13px; margin: 0; }

@media (max-width: 720px) {
  .hero { padding: 34px 0 28px; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  h1 { font-size: 30px; }
  .tagline { font-size: 17px; }
  .portrait img { width: 132px; height: 132px; }
  .section { padding: 32px 0; }
  .news li { gap: 10px; }
  .news .date { flex-basis: 66px; font-size: 13px; }
  .item .period { float: none; display: block; }
}

@media print {
  .topbar, .skip { display: none; }
  body { font-size: 11.5pt; }
  a { color: #000; text-decoration: none; }
  .item, .deliverable, .edu { break-inside: avoid; }
}
