/* Single-column, plain academic page: one narrow column, sans-serif text,
   blue links, photo beside the bio, papers as figure-left / text-right rows. */

:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --rule: #e6e6e6;
  --link: #1772d0;
  --link-hover: #f09228;
  --highlight: #ffffd0;
  --sans: "Lato", Verdana, Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  --width: 820px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --text: #dcdcdc;
    --muted: #9a9a9a;
    --rule: #303236;
    --link: #6cb0f5;
    --link-hover: #f5a94a;
    --highlight: #2b2a1c;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

p { margin: 0 0 1em; }
strong { font-weight: 700; }

main { max-width: var(--width); margin: 0 auto; padding: 0 20px; }

section { padding: 18px 0; }

h2 { font-size: 23px; font-weight: 400; margin: 0 0 12px; }

/* ---------- About ---------- */
.about { display: flex; gap: 36px; align-items: center; padding-top: 44px; }
.about-text { flex: 1; min-width: 0; }
.about h1 { font-size: 34px; font-weight: 400; text-align: center; margin: 0 0 18px; }
.role { text-align: center; color: var(--muted); margin-bottom: 18px; }

.photo {
  flex: none; width: 230px; height: 230px;
  border-radius: 50%; object-fit: cover;
}

.links { list-style: none; padding: 0; margin: 18px 0 0; text-align: center; }
.links li { display: inline; }
.links li + li::before { content: "/\00a0"; color: var(--text); }

/* ---------- Research interests ---------- */
.interests { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.interests h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.interests p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Dated lists (news, experience, awards, teaching) ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: flex; gap: 16px; padding: 3px 0; }
.news time { flex: none; width: 70px; color: var(--muted); font-variant-numeric: tabular-nums; }
.news.wide time { width: 105px; }

/* ---------- Publications ---------- */
.year { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
#publications .year:first-of-type { margin-top: 4px; }

.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: flex; gap: 24px; align-items: center; padding: 14px 12px; margin: 0 -12px; border-radius: 4px; }
.pub.highlight { background: var(--highlight); }
.note { color: var(--muted); margin: 0 0 6px; }
.pub-img { flex: none; width: 200px; height: auto; aspect-ratio: 8 / 5; object-fit: contain; border-radius: 3px; background: #fff; }
.pub-body { flex: 1; min-width: 0; }
.pub p { margin: 0; }
.pub-title { font-size: 16px; font-weight: 700; margin-bottom: 2px !important; }
.pub-venue { color: var(--text); }
.pub-desc { margin-top: 6px !important; color: var(--muted); font-size: 14px; }

.refs { margin: 0; padding-left: 26px; }
.refs li { padding: 4px 0 4px 2px; }
.refs li::marker { color: var(--muted); font-size: 13px; }
.ref-link::before { content: "["; color: var(--text); }
.ref-link::after { content: "]"; color: var(--text); }
.ref-link { white-space: nowrap; text-transform: lowercase; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 4px 0; }
address { font-style: normal; }

/* ---------- Footer ---------- */
.site-footer { max-width: var(--width); margin: 0 auto; padding: 24px 20px 40px; text-align: right; font-size: 12px; color: var(--muted); }
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .about { flex-direction: column-reverse; gap: 20px; padding-top: 28px; }
  .photo { width: 170px; height: 170px; }
  .interests { grid-template-columns: 1fr; gap: 12px; }
  .news li { flex-direction: column; gap: 0; padding: 5px 0; }
  .pub { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pub-img { width: 100%; max-width: 320px; }
}

@media print {
  section { break-inside: avoid; }
  a { color: inherit; }
}

/* ---------- CV page header ---------- */
.page-head { padding: 44px 0 10px; text-align: center; }
.page-head h1 { font-size: 34px; font-weight: 400; margin: 0 0 4px; }
.page-head h1 a { color: var(--text); }
.page-head .role { color: var(--muted); margin: 0; }

/* ---------- Publication tabs ---------- */
.pub-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 4px; }
.pub-head h2 { margin: 0; }
.pub-tabs { display: flex; gap: 2px; }
.pub-tabs button {
  font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 3px 10px; border-bottom: 2px solid transparent;
}
.pub-tabs button:hover { color: var(--link-hover); }
.pub-tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--link); }
.pub-tabs button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }

.pub-year { font-size: 17px; font-weight: 700; margin: 20px 0 4px; }
#pub-list[data-view="highlighted"] .pub-year,
#pub-list[data-view="highlighted"] .pub:not(.highlight) { display: none; }
#pub-list[data-view="highlighted"] .pub.highlight { margin-bottom: 8px; }
#pub-list[data-view="highlighted"] { padding-top: 8px; }

/* ---------- Venue badge ---------- */
.badge {
  display: inline-block; padding: 1px 8px; margin-right: 6px;
  font-size: 12px; font-weight: 700; line-height: 1.6; letter-spacing: 0.02em;
  color: #3d5a80; background: #e9eef5; border-radius: 3px; white-space: nowrap;
  vertical-align: 1px;
}
@media (prefers-color-scheme: dark) {
  .badge { color: #a9c1e0; background: #232b36; }
}

/* ---------- Award / note line ---------- */
.pub-note { color: #e2495b; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .pub-note { color: #ff8a94; }
}
