/* =========================================================
   Qiyu Kang — simple academic homepage
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg:           #ffffff;
  --text:         #232323;
  --text-2:       #4a4a4a;
  --text-muted:   #767676;
  --link:         #0c5fa3;
  --link-hover:   #093d6c;
  --rule:         #e6e6e6;
  --rule-2:       #f0f0f0;
  --accent:       #c0392b;
  --bg-soft:      #f7f7f5;
  --max:          820px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
  margin: 0;
}

/* ---------- Top nav ---------- */
.nav {
  border-bottom: 1px solid var(--rule);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.nav-brand {
  font-weight: 600;
  color: var(--text);
  font-size: 0.98rem;
}
.nav-brand:hover { color: var(--text); text-decoration: none; }
.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-2);
  font-size: 0.94rem;
}
.nav-links a.current { color: var(--text); font-weight: 600; }
.nav-links a:hover { text-decoration: none; color: var(--link); }

/* ---------- Shell ---------- */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px 32px 60px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  align-items: start;
  margin-bottom: 30px;
}
.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-info h1 {
  font-size: 1.85rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  letter-spacing: -0.005em;
}
.hero-info h1 a {
  color: inherit;
  transition: color .15s ease;
}
.hero-info h1 a:hover {
  color: var(--link);
  text-decoration: none;
}
.hero-info .position {
  font-size: 1.02rem;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.45;
}
.hero-info .position strong { font-weight: 600; }
.hero-info .affil {
  font-size: 0.96rem;
  color: var(--text-2);
  margin: 0 0 14px 0;
  line-height: 1.45;
}
.hero-info .contact {
  font-size: 0.9rem;
  color: var(--text-2);
  margin: 0;
  line-height: 1.85;
}
.hero-info .contact .label {
  display: inline-block;
  min-width: 64px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.hero-info .links {
  margin-top: 10px;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Section ---------- */
.section {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  margin-top: 22px;
}
.section h2 {
  font-size: 1.18rem;
  font-weight: 600;
  margin: 0 0 14px 0;
  color: var(--text);
}
.section p {
  margin: 0 0 12px 0;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.section p:last-child { margin-bottom: 0; }

.section .muted { color: var(--text-2); font-size: 0.96rem; }

/* Research bullets */
.research-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  columns: 2;
  column-gap: 32px;
}
.research-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 0.97rem;
  color: var(--text);
  break-inside: avoid;
}
.research-list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--link);
  font-weight: 700;
}

/* Callout */
.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--link);
  padding: 12px 16px;
  margin: 4px 0 0 0;
  font-size: 0.97rem;
  border-radius: 0 3px 3px 0;
}
.callout strong { font-weight: 600; }

/* News table */
.news {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.news td {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
  line-height: 1.55;
}
.news tr:last-child td { border-bottom: none; }
.news .date {
  width: 100px;
  white-space: nowrap;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  padding-right: 18px;
  padding-top: 10px;
}
.news .content { color: var(--text); }
.news .venue {
  font-weight: 600;
  color: var(--text);
}
.news .spot {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: 1px;
}

/* Publications list */
.pub-year-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin: 26px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
}
.pub-year-head:first-of-type { margin-top: 8px; }

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: pub;
}
.pub-item {
  position: relative;
  padding: 12px 0 12px 38px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 0.95rem;
  line-height: 1.55;
  counter-increment: pub;
}
.pub-item:last-child { border-bottom: none; }
.pub-item::before {
  content: counter(pub) ".";
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  width: 30px;
  text-align: right;
}
.pub-title {
  color: var(--text);
  font-weight: 500;
}
.pub-authors {
  color: var(--text-2);
  margin: 2px 0;
}
.pub-authors b {
  color: var(--text);
  font-weight: 600;
}
.pub-authors sup { color: var(--accent); font-weight: 600; }
.pub-venue {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
}
.pub-venue .place { font-style: normal; }
.pub-badge {
  display: inline-block;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0 5px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: 1px;
}

/* Notes list */
.notes-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}
.note-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
}
.note-item:last-child { border-bottom: none; }
.note-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.note-item h3 a { color: var(--text); }
.note-item h3 a:hover { color: var(--link); text-decoration: none; }
.note-item p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Sublist */
.sub-list { list-style: none; padding: 0; margin: 6px 0 0 0; }
.sub-list li { font-size: 0.94rem; margin-bottom: 4px; }
.sub-list li::before {
  content: "→ ";
  color: var(--text-muted);
}

/* Page titles */
.page-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  letter-spacing: -0.005em;
}
.page-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 26px 0;
}

/* Footer */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding: 22px 32px;
}
.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .hero-photo {
    width: 160px;
    height: 160px;
  }
  .nav-inner, .shell { padding-left: 22px; padding-right: 22px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.88rem; }
  .research-list { columns: 1; }
  .news .date { width: 88px; padding-right: 12px; }
  .pub-item { padding-left: 30px; }
}

::selection { background: #cfe4f7; }
