:root {
  --accent: #2a7ae2;
  --accent-dark: #1756a9;
  --text: #333;
  --text-light: #6b6b6b;
  --border: #e8e8e8;
  --bg: #ffffff;
  --sidebar-bg: #fafafa;
  --tag-bg: #eef4fd;
  --badge-bg: #3c5be7;
  --max-width: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

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

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  padding: 0 24px;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  padding: 48px 24px 48px 0;
  text-align: center;
}

.avatar {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.name { font-size: 1.7rem; font-weight: 900; margin-top: 20px; letter-spacing: .5px; }
.name-cn { font-size: 1.05rem; color: var(--text-light); font-weight: 700; }
.tagline { font-size: .92rem; color: var(--text-light); margin-top: 8px; }

.affil {
  list-style: none;
  margin: 22px 0;
  text-align: left;
  display: inline-block;
  font-size: .88rem;
  color: var(--text-light);
}
.affil li { margin: 6px 0; }
.affil i { color: var(--accent); width: 18px; text-align: center; margin-right: 6px; }

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin: 0 5px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-light);
  border: 1px solid var(--border);
  font-size: 1.15rem;
  transition: all .2s ease;
}
.social a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.social a.social-img {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  border-radius: 0;
}
.social a.social-img:hover { background: transparent; border: none; transform: translateY(-2px); }
.social a.social-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; display: block; }
.social .sidebar-wechat {
  margin: 0 5px;
  line-height: normal;
  vertical-align: middle;
}
.social-wechat-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: #07c160;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all .2s ease;
}
.sidebar-wechat:hover .social-wechat-trigger,
.sidebar-wechat:focus-within .social-wechat-trigger {
  border-color: #07c160;
  background: #07c160;
  color: #fff;
  transform: translateY(-2px);
}
.social-wechat-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cv-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 22px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 22px;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s ease;
}
.cv-btn:hover { background: var(--accent-dark); text-decoration: none; }

/* ============ CONTENT ============ */
.content {
  flex: 1;
  min-width: 0;
  padding: 48px 0 48px 40px;
  border-left: 1px solid var(--border);
}

section { margin-bottom: 42px; }

.content h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.content p { margin-bottom: 12px; }

/* News / lists with dates */
.news-list, .honors-list, .contact-list { list-style: none; }
.news-list li, .honors-list li { margin-bottom: 10px; padding-left: 4px; }
.news-list .date, .honors-list .date {
  display: inline-block;
  min-width: 66px;
  font-weight: 700;
  color: var(--accent);
  font-size: .85rem;
}

/* Entry cards (education / experience / projects) */
.entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 120px;
  column-gap: 16px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--border);
}
.entry:last-child { border-bottom: none; }
.entry-logo {
  grid-column: 1;
  grid-row: 1;
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--tag-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.entry-logo-img {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.entry-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.entry-body { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
.entry-body h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 2px; padding-right: 136px; }
.entry-body h3 a, .pub-body h3 a { color: inherit; }
.entry-body h3 a:hover, .pub-body h3 a:hover { color: var(--accent); text-decoration: underline; }
.entry-body h3 .dept {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-light);
  margin-left: 6px;
}
.entry-sub { color: var(--text); font-size: .95rem; margin-bottom: 2px !important; }
.entry-note { color: var(--text-light); font-size: .85rem; font-style: italic; }
.entry-body ul { margin: 8px 0 0 18px; }
.entry-body li { margin-bottom: 6px; font-size: .93rem; }
.entry-date {
  grid-column: 3;
  grid-row: 1;
  justify-self: stretch;
  width: 120px;
  text-align: left;
  font-size: .85rem;
  color: var(--text-light);
  font-weight: 700;
  white-space: nowrap;
  padding-top: 2px;
}

.badge {
  display: inline-block;
  background: var(--badge-bg);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}

.tags { margin: 4px 0 6px !important; }
.tags span {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  margin: 2px 4px 2px 0;
}

/* Publications */
.pub-note { font-size: .82rem; color: var(--text-light); margin-bottom: 14px; }
.pub {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.pub:last-child { border-bottom: none; }
.pub-mark {
  flex-shrink: 0;
  width: 78px; height: 78px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-weight: 900;
  font-size: .82rem;
  line-height: 1.2;
}
.pub-fig {
  display: block;
  width: 80%;
  max-width: 100%;
  margin: 12px auto 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.pub-fig:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.14); transform: translateY(-2px); text-decoration: none; }
.pub-fig img {
  display: block;
  width: 100%;
  height: auto;
}
.pub-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.authors { font-size: .92rem; margin-bottom: 2px !important; }
.venue { font-size: .88rem; color: var(--text-light); margin-bottom: 4px !important; }
.pub-desc { font-size: .9rem; color: var(--text); }

.contact-list li { margin-bottom: 8px; }
.contact-list i { color: var(--accent); width: 20px; margin-right: 8px; }

/* WeChat QR hover */
.wechat { position: relative; display: inline-block; }
.wechat-id {
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px dashed var(--accent);
}
.wechat-qr {
  position: absolute;
  left: 0;
  bottom: 130%;
  z-index: 10;
  display: block;
  width: 180px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.wechat-qr img { display: block; width: 100%; height: auto; border-radius: 6px; }
.wechat:hover .wechat-qr {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.wechat:focus-within .wechat-qr {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sidebar-wechat .wechat-qr {
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translate(-50%, 6px);
}
.sidebar-wechat:hover .wechat-qr,
.sidebar-wechat:focus-within .wechat-qr { transform: translate(-50%, 0); }

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-light);
  text-align: center;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 820px) {
  .wrapper { flex-direction: column; padding: 0 18px; }
  .sidebar {
    width: 100%;
    position: static;
    padding: 36px 0 12px;
    border-bottom: 1px solid var(--border);
  }
  .content { padding: 32px 0; border-left: none; }
  .affil { text-align: center; }
  .entry { grid-template-columns: 46px minmax(0, 1fr); row-gap: 6px; }
  .entry-body { grid-column: 2; }
  .entry-body h3 { padding-right: 0; }
  .entry-date { grid-column: 1 / -1; grid-row: 2; width: 100%; padding-left: 62px; }
}
