:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --link: #0b57d0;
  --card: #f5f7fb;
  --border: #e6e9ef;
}

:root[data-theme="dark"] {
  --bg: #0b0e14;
  --fg: #e6eaf2;
  --muted: #a3acc4;
  --link: #72a7ff;
  --card: #111522;
  --border: #1e2433;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

header.container {
  padding-top: 40px;
}

.intro .name { font-size: 2rem; margin: 0; }
.intro .title { margin: 6px 0; color: var(--muted); }
.subtle { color: var(--muted); margin-top: 4px; }

.contacts a { color: var(--link); text-decoration: none; }
.contacts a:hover { text-decoration: underline; }
.contacts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.actions { margin-top: 12px; }
.actions button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.nav {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.nav a {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  font-size: 0.95rem;
}

h2 {
  margin-top: 32px;
  font-size: 1.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

section p { margin: 8px 0 0; }

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.timeline {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}
.timeline .time { font-weight: 600; }
.timeline .degree { font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.pubs { padding-left: 18px; }

.awards { padding-left: 18px; }

.footer {
  margin-top: 40px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ---- Avatar and intro layout ---- */
.intro {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px 24px;
  align-items: center;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover; /* fill the box without distortion */
  display: block;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

@media (max-width: 520px) {
  .intro {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

