:root {
  --text: #222;
  --muted: #666;
  --link: #2a6ebb;
  --border: #e6e6e6;
  --bg: #fff;
  --sidebar-bg: #fafafa;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

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

a:hover {
  text-decoration: underline;
}

.page {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  gap: 56px;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.sidebar {
  position: sticky;
  top: 32px;
  align-self: start;
  padding: 0 0 24px;
  color: var(--muted);
}

.avatar {
  display: block;
  width: 180px;
  height: 180px;
  margin-bottom: 20px;
  object-fit: contain;
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 4px;
}

h1 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1.2;
}

h1 span {
  display: block;
  margin-top: 3px;
  font-size: 1.1rem;
  font-weight: 500;
}

.role,
.location {
  margin: 0 0 6px;
}

.profile-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.95rem;
}

.wechat-link {
  position: relative;
  width: max-content;
}

.wechat-qr {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 10;
  display: none;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wechat-qr img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.wechat-link:hover .wechat-qr,
.wechat-link:focus .wechat-qr {
  display: block;
}

.content {
  min-width: 0;
}

section {
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

h2 {
  margin: 0 0 14px;
  padding-bottom: 6px;
  color: var(--text);
  font-size: 1.45rem;
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0 0 12px;
}

ul {
  padding-left: 22px;
  margin: 0 0 12px;
}

li {
  margin-bottom: 8px;
}

.paper-list {
  padding-left: 18px;
}

.paper-list li {
  margin-bottom: 14px;
}

.section-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.paper-entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.paper-image {
  display: block;
  width: 120px;
  max-height: 92px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.book-entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.book-cover {
  display: block;
  width: 120px;
  max-height: 150px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.entry {
  margin-bottom: 18px;
}

.entry ul {
  margin-top: 6px;
}

.date {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.95rem;
}

footer {
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin-bottom: 0;
}

@media (max-width: 820px) {
  .page {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
  }

  .sidebar {
    position: static;
    padding-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  .avatar {
    width: 150px;
    height: 150px;
  }

  .paper-entry,
  .book-entry {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
  }

  .paper-image {
    width: 96px;
    max-height: 78px;
  }

  .book-cover {
    width: 96px;
    max-height: 124px;
  }

  .profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 24px;
  }
}

@media (max-width: 520px) {
  .page {
    width: min(100% - 28px, 1080px);
  }
}
