/* ===== Colors (light / dark) ===== */
:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --link: #1772d0;
  --link-hover: #f09228;
  --highlight: #ffffd0;
  --border: #e5e5e5;
  --note: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --text: #e4e4e4;
    --muted: #9a9a9a;
    --link: #5aa9ff;
    --link-hover: #f5a54a;
    --highlight: #33301a;
    --border: #333333;
    --note: #ff7b6b;
  }
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', Verdana, Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
}

h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: normal;
}

p {
  margin: 0 0 12px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

section {
  padding: 20px 0 8px;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  gap: 5%;
  padding-top: 20px;
}

.header-text {
  flex: 0 0 60%;
}

.header-photo {
  flex: 1;
  text-align: center;
}

.header-photo img {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}

.name {
  margin: 0 0 16px;
  font-size: 32px;
  text-align: center;
}

.links {
  text-align: center;
}

/* ===== News ===== */
.news {
  margin: 0;
  padding-left: 20px;
  max-height: 220px;   /* scrolls when the list gets long */
  overflow-y: auto;
}

.news li {
  margin-bottom: 6px;
}

.date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

/* ===== Publications ===== */
.paper {
  display: flex;
  gap: 20px;
  padding: 16px 12px;
  border-radius: 8px;
}

.paper.highlight {
  background: var(--highlight);
}

.paper-thumb {
  flex: 0 0 25%;
}

.paper-thumb img,
.paper-thumb video {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.paper-info {
  flex: 1;
  align-self: center;
}

.papertitle {
  font-weight: 700;
}

.paper-desc {
  margin: 6px 0 0;
}

.note {
  color: var(--note);
  font-weight: 700;
}

.footnote {
  color: var(--muted);
  font-size: 13px;
}

/* ===== Simple lists (education, awards, service) ===== */
.plain-list {
  margin: 0;
  padding-left: 20px;
}

.plain-list li {
  margin-bottom: 6px;
}

/* ===== Footer ===== */
footer {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .header {
    flex-direction: column-reverse;
  }

  .header-photo img {
    max-width: 180px;
  }

  .paper {
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .paper.highlight {
    padding: 14px 10px;
  }

  .paper-thumb {
    flex: none;
    max-width: 320px;
  }
}
