/* Modern academic homepage — sidebar layout */

:root {
  --primary: #1a365d;
  --accent: #2b6cb0;
  --accent-light: #ebf4ff;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.7;
  font-size: 15px;
  text-align: left;
}

/* ── Two-column layout ── */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 300px;
  min-width: 300px;
  background: var(--bg);
  color: var(--text);
  padding: 36px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--border);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.sidebar-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

.sidebar-name-cn {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.sidebar-name-en {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.sidebar-role {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.6;
}

.sidebar-role a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.2s;
}

.sidebar-role a:hover {
  border-bottom-color: var(--accent);
}

/* Sidebar navigation */
.sidebar-nav {
  width: 100%;
  margin-bottom: 24px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Sidebar contact info */
.sidebar-contact {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: auto;
}

.sidebar-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-light);
  text-align: left;
}

.sidebar-contact-item .icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-size: 14px;
  margin-top: 2px;
}

.sidebar-contact-item a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.2s;
  word-break: break-all;
}

.sidebar-contact-item a:hover {
  border-bottom-color: var(--accent);
}

/* Sidebar social links */
.sidebar-links {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-links a {
  color: var(--text-light);
  font-size: 18px;
  transition: color 0.2s;
}

.sidebar-links a:hover {
  color: var(--accent);
  border-bottom: none;
}

/* Sidebar logos */
.sidebar-logos {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-logos img {
  height: 48px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.sidebar-logos img:hover {
  opacity: 1;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 40px 56px 60px;
  background: var(--bg);
}

/* ── Sections ── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── Text ── */
p {
  margin-bottom: 12px;
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1a4e8a;
  border-bottom: 1px dotted var(--accent);
}

strong { font-weight: 600; }

/* ── Research tags ── */
.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.research-tag {
  display: inline-block;
  padding: 7px 18px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

/* ── Publication cards ── */
.pub-card {
  display: flex;
  gap: 20px;
  padding: 18px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow 0.25s, transform 0.25s;
}

.pub-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pub-img-wrap {
  flex-shrink: 0;
  position: relative;
  width: 170px;
}

.pub-img-wrap img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pub-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.pub-badge.arxiv {
  background: #555;
}

.pub-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pub-text p { margin: 0; line-height: 1.6; }

.pub-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 14.5px;
  margin-bottom: 5px !important;
}

.pub-authors {
  color: var(--text-light);
  font-size: 13.5px;
  margin-bottom: 5px !important;
}

.pub-authors b {
  color: var(--accent);
  font-weight: 600;
}

.pub-venue {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

.pub-links {
  margin-top: 8px;
}

.pub-links a {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 5px;
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-right: 6px;
  transition: all 0.2s;
}

.pub-links a:hover {
  background: var(--accent);
  color: #fff;
  border-bottom: 1px solid var(--accent);
}

/* ── Contact list ── */
.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  font-size: 14.5px;
}

.contact-list li:last-child { border-bottom: none; }

.contact-label {
  font-weight: 600;
  color: var(--primary);
  min-width: 64px;
  flex-shrink: 0;
}

/* ── Footer ── */
#footer {
  margin-top: 48px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

#footer img {
  opacity: 0.8;
  transition: opacity 0.2s;
}

#footer img:hover {
  opacity: 1;
}

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
  z-index: 100;
}

#back-to-top:hover {
  background: var(--primary);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .page-wrapper {
    flex-direction: column;
    max-width: 100%;
    box-shadow: none;
  }

  .sidebar {
    position: relative;
    width: 100%;
    min-width: auto;
    height: auto;
    padding: 32px 24px;
  }

  .sidebar-photo {
    width: 120px;
    height: 120px;
  }

  .sidebar-contact {
    margin-top: 20px;
  }

  .sidebar-links {
    margin-top: 12px;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .sidebar-logos img {
    height: 40px;
  }

  .main-content {
    padding: 28px 20px 40px;
  }

  .pub-card {
    flex-direction: column;
  }

  .pub-img-wrap {
    width: 100%;
    max-width: 280px;
  }

  .section-title {
    display: block;
  }
}
