:root {
  --accent: #b31b1b;
  --accent-dark: #8a1414;
  --text: #222;
  --muted: #666;
  --line: #e6e6e6;
  --bg: #fff;
  --tag-bg: #f6eaea;
  --maxw: 980px;
  --sans: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

/* ---------- header ---------- */
.site-header {
  position: relative;
  height: 230px;
  /* banner.jpg is cropped so the Cornell seal sits on the image's vertical centre */
  background: url("img/banner.jpg?v=2") 85% center / cover no-repeat;
}
.site-header::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,.15) 55%, rgba(0,0,0,.35));
}
.nav {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex; align-items: center; gap: 48px;
}
.nav .brand {
  color: #fff; font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: .3px;
}
.nav .brand:hover { text-decoration: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.nav ul a {
  color: rgba(255,255,255,.88); font-size: 15px; padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.nav ul a:hover { color: #fff; text-decoration: none; }
.nav ul a.active { color: #fff; border-bottom-color: #fff; }

/* ---------- main ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px 60px;
}

h1 {
  font-family: var(--serif);
  color: var(--accent);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: .2px;
  margin: 0 0 18px;
}
h1 .zh { font-size: 26px; font-weight: 500; margin-left: 8px; letter-spacing: 2px; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin: 40px 0 18px;
}
h2:first-child { margin-top: 0; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 44px;
  align-items: start;
}
.about img.photo {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.about p { margin: 0 0 14px; }

.topic-1 { color: var(--accent); font-weight: 600; }
.topic-2 { color: #2e7d32; font-weight: 600; }
.topic-3 { color: #1565c0; font-weight: 600; }

.info {
  display: grid;
  grid-template-columns: 130px 1fr;
  row-gap: 8px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.info dt { font-weight: 600; color: var(--muted); }
.info dd { margin: 0; }

.affil-logo { margin-top: 22px; width: 100%; max-width: 270px; display: block; }

/* ---------- papers ---------- */
.paper {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}
.paper:last-child { border-bottom: none; }
.paper .title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17.5px;
  line-height: 1.4;
  color: var(--text);
}
.paper .num {
  color: var(--accent);
  margin-right: 10px;
}
.paper .authors { color: var(--muted); margin-top: 2px; }
.paper .venue { font-style: italic; margin-top: 2px; }
.paper .links { margin-top: 6px; font-size: 14px; }
.paper .links a {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 9px;
  margin: 2px 6px 2px 0;
}
.paper .links a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent-dark);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 10px;
  padding: 0 10px;
  margin-left: 10px;
  vertical-align: 2px;
  white-space: nowrap;
}
.tag + .tag { margin-left: 5px; }

.intro { margin: 0 0 10px; }

/* ---------- blog ---------- */
main > .back { font-size: 14px; display: inline-block; margin-bottom: 10px; }
.page-title { margin-bottom: 6px; }
.lang-switch { margin: 14px 0 6px; }
.lang-switch a {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 1px 14px;
  margin-right: 8px;
  font-size: 14px;
}
.lang-switch a:hover { background: var(--accent); color: #fff; text-decoration: none; }
h2[id], h3[id] { scroll-margin-top: 20px; }

.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 24px 0 8px;
}
.module {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.module:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.module-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--tag-bg);
  display: flex; align-items: center; justify-content: center;
}
.module-icon svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.module-title { font-family: var(--serif); font-weight: 600; font-size: 19px; margin-top: 4px; }
.module-desc { color: #555; font-size: 14.5px; line-height: 1.55; flex: 1; }
.module-go { color: var(--accent); font-size: 14px; }

.blog-lang {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
  margin: 26px 0 0;
}

.post {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.post:last-of-type { border-bottom: none; }
.post .cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: #f2f2f2;
}
.post .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.post .cover:hover img { transform: scale(1.04); }
.post-meta { color: var(--muted); font-size: 13px; }
.post-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.4;
  margin: 4px 0 6px;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt { margin: 0 0 6px; color: #444; font-size: 15px; }
.read-more { font-size: 14px; }
.empty-note { color: var(--muted); font-style: italic; }

/* ---------- single post ---------- */
.post-page { max-width: 720px; margin: 0 auto; }
.post-page .back { font-size: 14px; display: inline-block; }
.post-page-title {
  font-size: 30px;
  line-height: 1.35;
  margin: 14px 0 6px;
}
.post-subtitle {
  font-family: var(--serif);
  font-size: 19px;
  color: #555;
  margin: 0 0 8px;
}
.post-page .post-meta { margin-bottom: 22px; }
.hero { margin: 0 0 28px; }
.hero img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 4px; display: block; }
.hero figcaption { color: var(--muted); font-size: 13px; text-align: center; margin-top: 6px; }
.post-page p { margin: 0 0 1.1em; line-height: 1.9; text-align: justify; }
.post-page h2 { margin-top: 36px; }
.post-page .sec-num {
  color: var(--accent);
  margin-right: 10px;
}
.refs {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  padding-left: 1.6em;
}
.refs li { margin-bottom: 6px; }
.post-page .post-source {
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 32px;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 22px 24px 30px;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .site-header {
    height: 170px;
    background-position: 84.5% center;
  }
  .nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav ul { gap: 14px; }
  .nav ul a { font-size: 14px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .about .side { max-width: 170px; }
  .affil-logo { display: none; }
  .info { grid-template-columns: 105px 1fr; }
  .post { grid-template-columns: 1fr; gap: 12px; }
  .modules { grid-template-columns: 1fr; }
  main { padding-top: 30px; }
}
