/* ---------- Base (same modern-minimal look as the personal site) ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --maxw: 860px;
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h2 {
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); height: 100%; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); letter-spacing: 0.02em; }
.brand:hover { color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-toggle {
  display: none; background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--text); line-height: 1;
}

/* ---------- Sections ---------- */
main { display: block; }
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: 64px 24px; scroll-margin-top: var(--nav-h);
}
.section.alt { max-width: none; background: var(--bg-alt); }
.section.alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

/* ---------- Hero / Home ---------- */
.hero { position: relative; text-align: center; padding-top: 72px; overflow: hidden; }
.hero-content { position: relative; z-index: 1; }
.hero-image { width: 100%; max-width: 720px; border-radius: 12px; margin-bottom: 20px; }
.hero h1 { font-size: 2.6rem; margin: 0 0 0.25rem; letter-spacing: -0.02em; }
.lab-fullname { font-size: 1.15rem; color: var(--text); font-weight: 600; margin: 0 0 0.25rem; }
.lab-affil { color: var(--muted); margin: 0 0 1.5rem; }
/* Decorative lab logo: a faint, shape-clipped watermark behind the hero text. */
.hero-logo { position: absolute; z-index: 0; pointer-events: none; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero-logo.pos-right { right: 6%; top: 50%; transform: translateY(-50%); }
.hero-logo.pos-left { left: 6%; top: 50%; transform: translateY(-50%); }
.hero-logo.pos-center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hero-logo.shape-circle { border-radius: 50%; overflow: hidden; }
.hero-logo.shape-rounded { border-radius: 20%; overflow: hidden; }
.hero-logo.shape-square { overflow: hidden; }
.hero-logo.shape-triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.intro { text-align: justify; max-width: 720px; margin: 0 auto 1rem; color: #374151; }
.highlights {
  list-style: none; margin: 1rem auto; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.highlights li {
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--accent-dark); padding: 6px 14px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600;
}
.cta-row { margin-top: 1.5rem; }
.cta {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 9px 20px; border-radius: 8px; font-weight: 600;
  margin: 0 6px; transition: background 0.15s ease;
}
.cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------- News list ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: flex; gap: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--border); align-items: baseline;
}
.news-list li:last-child { border-bottom: none; }
.date {
  flex: 0 0 84px; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; font-size: 0.92rem;
}
.item-text { color: #374151; }

/* ---------- People ---------- */
.people-subhead { font-size: 1.15rem; margin: 2rem 0 1rem; }
.people-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.person {
  text-align: center; padding: 8px;
}
.person-photo {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 10px; display: flex;
  align-items: center; justify-content: center;
  background: var(--bg-alt); border: 1px solid var(--border);
  font-size: 2rem; font-weight: 700; color: var(--muted);
}
.person-photo.no-img { background: var(--bg-alt); }
.person-name { font-weight: 700; font-size: 1rem; }
.person-role { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.person-note { color: var(--accent-dark); font-size: 0.8rem; font-style: italic; margin-top: 2px; }
.person-links { margin-top: 6px; font-size: 0.8rem; }
.person-links .sep { color: var(--border); }

/* ---------- Publications ---------- */
.pub-subhead { font-size: 1.15rem; margin: 2rem 0 1rem; color: var(--text); }
.pub {
  display: flex; gap: 22px; padding: 20px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.pub:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07); transform: translateY(-1px); }
.pub-thumb {
  flex: 0 0 150px; width: 150px; height: 100px;
  background: var(--bg-alt); border-radius: 8px; overflow: hidden; cursor: zoom-in;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-thumb.no-img img { display: none; }
.pub-body { min-width: 0; }
.pub-title { font-size: 1.05rem; }
.pub-authors { font-size: 0.92rem; color: #4b5563; margin: 0 0 4px; }
.author-note { color: var(--muted); font-size: 0.85rem; }
.pub-venue { font-size: 0.92rem; color: #4b5563; margin: 0 0 6px; }
.pub-links { margin: 0 0 4px; }
.pub-links a { font-weight: 600; }
.soon { color: var(--muted); }
.pub-keywords { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }

/* ---------- Hover preview popover ---------- */
#pub-preview {
  position: fixed; z-index: 200; max-width: 360px; pointer-events: none;
  opacity: 0; transition: opacity 0.12s ease;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border); background: var(--bg);
}
#pub-preview.show { opacity: 1; }
#pub-preview img { display: block; width: 360px; max-width: 100%; height: auto; }

/* ---------- Resources ---------- */
.resources { display: grid; gap: 14px; grid-template-columns: 1fr; }
.resource {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.resource-badge {
  flex: 0 0 auto; background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 6px; margin-top: 2px;
}
.resource-body { min-width: 0; }
.resource-title { font-weight: 700; font-size: 1rem; }
.resource-desc { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; gap: 32px; grid-template-columns: 1fr 1fr; align-items: start;
}
.contact-info { font-size: 0.95rem; }
.contact-info > div { margin-bottom: 8px; }
.contact-pi { font-weight: 700; }
.contact-address { color: var(--muted); line-height: 1.5; }
.contact-links { margin-top: 8px; }
.contact-links .sep { color: var(--border); }
.contact-map iframe { width: 100%; height: 280px; border: 0; border-radius: 10px; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 48px;
  text-align: center; color: var(--muted); font-size: 0.88rem;
}

/* ---------- Recruitment ---------- */
.recruit-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
.recruit-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px;
}
.recruit-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.recruit-title { font-size: 1.1rem; margin: 0; }
.recruit-badge {
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--accent-dark);
  font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.recruit-desc { color: #374151; margin: 0; }
.recruit-apply { margin-top: 10px; }

/* ---------- Achievements carousel ---------- */
.ach-carousel { position: relative; display: flex; align-items: center; gap: 8px; padding-bottom: 30px; }
.ach-viewport { overflow: hidden; flex: 1 1 auto; }
.ach-track { display: flex; transition: transform 0.32s ease; }
.ach-card {
  flex: 0 0 100%; box-sizing: border-box;
  display: flex; gap: 20px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
}
.ach-img {
  flex: 0 0 var(--ach-w, 360px); width: var(--ach-w, 360px); height: var(--ach-h, 240px);
  background: var(--bg-alt); border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ach-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ach-body { min-width: 0; flex: 1 1 auto; }
.ach-title { font-size: 1.1rem; margin: 0 0 6px; }
.ach-desc { color: #374151; margin: 0 0 8px; }
.ach-link { font-weight: 600; }
.ach-nav {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ach-nav:hover { background: var(--bg-alt); border-color: var(--accent); color: var(--accent); }
.ach-dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 6px; }
.ach-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; padding: 0; }
.ach-dot.active { background: var(--accent); }

/* ---------- Gallery (album covers on the lab page) ---------- */
.album-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.album-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.album-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07); transform: translateY(-2px); }
.album-cover {
  width: 100%; height: 180px; background: var(--bg-alt); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-body { padding: 14px 16px; }
.album-title { font-size: 1.05rem; margin: 0 0 4px; }
.album-desc { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }
.album-count { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

/* ---------- Album page (gallery/<slug>/index.html) ---------- */
.album-page { max-width: 1100px; }
.album-intro { color: #374151; margin: 0 0 1.5rem; }
.album-photos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.album-photo {
  margin: 0; cursor: zoom-in; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; transition: transform 0.15s ease;
}
.album-photo:hover { transform: translateY(-2px); }
.album-photo img { width: 100%; height: 200px; object-fit: cover; display: block; }
.album-photo figcaption { padding: 6px 10px; font-size: 0.82rem; color: var(--muted); }
.album-empty { color: var(--muted); }
.album-back { margin-top: 2rem; }
.album-back a { font-weight: 600; }

/* ---------- Album lightbox ---------- */
#alb-lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.88);
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
#alb-lightbox.show { display: flex; }
#alb-lightbox img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.alb-caption { color: #fff; margin-top: 12px; font-size: 0.92rem; text-align: center; max-width: 80vw; }
.alb-close, .alb-prev, .alb-next {
  position: absolute; background: rgba(255, 255, 255, 0.12); color: #fff; border: none;
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.alb-close { top: 18px; right: 18px; width: 42px; height: 42px; font-size: 1.5rem; }
.alb-prev { left: 18px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2rem; }
.alb-next { right: 18px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2rem; }
.alb-close:hover, .alb-prev:hover, .alb-next:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; border-bottom: none; }

  .section { padding: 44px 20px; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 1.9rem; }
  .hero-logo { display: none; }

  .pub { flex-direction: column; gap: 14px; }
  .pub-thumb { flex: none; width: 100%; height: 150px; }

  .ach-card { flex-direction: column; gap: 14px; }
  .ach-img { flex: none; width: 100%; height: 220px; }

  .album-cover { height: 150px; }
  .album-photo img { height: 150px; }

  .people-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .person-photo { width: 96px; height: 96px; }

  .contact-grid { grid-template-columns: 1fr; }
  .date { flex: 0 0 70px; }
}
