/* Design tokens */
:root{
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: rgba(29,29,31,.68);
  --card: rgba(255,255,255,.78);
  --border: rgba(0,0,0,.08);
  --shadow: 0 12px 30px rgba(0,0,0,.10);
  --shadow-soft: 0 10px 24px rgba(0,0,0,.08);
  --radius: 18px;
  --radius-lg: 28px;
  --maxw: 1120px;

  --header-h: 56px;
}

*{ box-sizing: border-box; }

html{ overflow-y: scroll; }

body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(0,122,255,.10), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(175,82,222,.12), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a{ color: inherit; text-decoration: none; }

:focus-visible{
  outline: 3px solid rgba(0,122,255,.35);
  outline-offset: 3px;
  border-radius: 10px;
}

.container{
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / Nav */
header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 1000;

  background: rgba(19,19,19,.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border-bottom: 1px solid rgba(255,255,255,.10);
}

nav{ width: 100%; }

nav ul{
  list-style: none;
  margin: 0;
  padding: 0 12px;
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

nav a{
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .2px;

  color: rgba(255,255,255,.75);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

nav a:hover{
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

nav a.active{
  color: rgba(255,255,255,.98);
  background: rgba(255,255,255,.16);
}


html, body{
  height: 100%;
}

body{
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.is-home{
  overflow: hidden;
}

main{
  flex: 1 0 auto;
  min-height: 0;
  padding-top: calc(var(--header-h) + 18px);
  padding-bottom: 24px;
}

/* Section switching */
section{
  display: none;
  width: 100%;
  padding: 28px 0 56px;
}

#home{
  padding: 10px 0 18px;
  min-height: calc(100dvh - var(--header-h) - 56px);
}

#home.active-section{
  display: flex;
  align-items: center;
}

section.active-section{
  display: block;
  animation: sectionIn .28s ease both;
}

@keyframes sectionIn{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* Typography */
h1{
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  margin: 18px 0 10px;
  letter-spacing: -0.02em;
}

h2{
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.25;
  margin: 36px 0 14px;
  letter-spacing: -0.02em;
}

h3{
  font-size: 18px;
  margin: 0 0 6px;
}

.lead{
  font-size: 18px;
  color: var(--muted);
  max-width: 72ch;
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card-pad{ padding: 18px; }

/* team card 鍩虹瀹藉害缁熶竴 */
.team-card {
  max-width: 520px;
  margin: 0 auto;
}


/* Home / Hero */
#home{
  min-height: auto;
}

.hero{
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.carousel{
  position: relative;
  width: min(100%, 780px);
  height: auto;

  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.06);
}


.carousel-track{
  position: relative;
  width: 100%;
  height: clamp(520px, 44dvh, 520px);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.carousel-track img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity .35s ease;
}

.carousel-track img.active{
  opacity: 1;
}

.carousel-button{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: transform .18s ease, background .18s ease;
}

.carousel-button:hover{
  background: rgba(0,0,0,.50);
  transform: translateY(-50%) scale(1.03);
}

.carousel-button.prev{ left: 12px; }
.carousel-button.next{ right: 12px; }

.carousel-caption{
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

/* Research */
.research-content{
  display: grid;
  gap: 18px;
}

.research-content img{
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

/* Team */


.team-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-grid--two{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 840px){
  .team-grid--two{
    grid-template-columns: 1fr;
  }
}

.team-member{
  --avatar-w: 112px;
  --avatar-h: 140px;

  display: grid;
  grid-template-columns: var(--avatar-w) 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.80);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}

.team-member:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0,0,0,.12);
}

.team-member img{
  width: var(--avatar-w);
  height: var(--avatar-h);
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.06);
}

.member-info p{
  margin: 2px 0;
  color: var(--muted);
  font-size: 14px;
}

.divider{
  margin: 28px 0;
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.10);
}

/* Publications */
.publication-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.publication-list li{
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
  color: rgba(29,29,31,.84);
}

.google_scholar{
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  transition: transform .18s ease, box-shadow .18s ease;
}

.google_scholar:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* Join us */
.join-info{
  display: grid;
  gap: 14px;
}

.join-content{
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}

.join-content ul{
  margin: 8px 0 0;
  padding-left: 18px;
}

.join-content p{ margin: 8px 0; }

/* Footer */
footer{
  border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0px 0;
  text-align: center;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 980px){
  .team-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  nav ul{ gap: 10px; }
  nav a{ font-size: 13px; padding: 0 10px; }
  .team-grid{ grid-template-columns: 1fr; }
  .team-member{ grid-template-columns: 84px 1fr; }
  .team-member img{ width: 84px; height: 108px; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
  section.active-section{ animation: none; }
  .team-member, .google_scholar, nav a, .carousel-track img, .carousel-button{
    transition: none !important;
  }
}

/* Additional styles for panels */
/* Research: square image + tighter spacing */
#research .panel{
  grid-template-columns: 220px 1fr;
  gap: 10px;
  align-items: start;

}

#research .panel--media > img{
  width: 220px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 0;
}

/* keep existing mobile behavior */
@media (max-width: 820px){
  #research .panel{
    grid-template-columns: 1fr;
  }

  #research .panel--media > img{
    width: 100%;
  }
}

/*  */


.panel-list{
  display: grid;
  gap: 16px;
}

.panel{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
}

.panel img{
  width: 100%;
  height: 220px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.06);
}

.panel-body{
  display: grid;
  gap: 10px;
}

@media (max-width: 820px){
  .panel{
    grid-template-columns: 1fr;
  }

  .panel img{
    height: 200px;
  }
}


@media (max-width: 540px){
  .team-member{
    --avatar-w: 100px;
    --avatar-h: 126px;
  }
}


/* Home v3 (chenlab-inspired) */
body.home-v3{
  overflow: hidden;
}

body.home-v3 #home.active-section{
  display: block;
}

#home .homev3{
  position: relative;
  width: min(100%, 1180px);
}

#home .homev3::before{
  content: "";
  position: absolute;
  inset: -18px -22px;
  background:
    radial-gradient(900px 520px at 20% 12%, rgba(182,216,255,.55), transparent 60%),
    radial-gradient(760px 520px at 80% 18%, rgba(232,205,255,.55), transparent 60%),
    radial-gradient(760px 520px at 60% 92%, rgba(255,220,186,.55), transparent 60%);
  filter: blur(18px);
  z-index: -1;
}

#home .homev3-top{
  text-align: left;
  padding: 14px 0 10px;
}

#home .homev3-kicker{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  color: rgba(0,0,0,.68);
  font-weight: 650;
  letter-spacing: .2px;
}

#home .homev3-kickerDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(62,129,255,.9);
  box-shadow: 0 0 0 6px rgba(62,129,255,.12);
}

#home .homev3-title{
  margin: 12px 0 10px;
  font-size: clamp(32px, 4.6vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1.02;
}

#home .homev3-lead{
  margin: 0;
  font-size: 18px;
  color: var(--muted);
  max-width: 118ch;
}

#home .homev3-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

#home .homev3-card{
  border-radius: 28px;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

#home .homev3-cardHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 10px;
}

#home .homev3-pill{
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  /* letter-spacing: .18em; */
  font-size: 12px;
  color: rgba(0,0,0,.72);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.10);
}

/* #home .homev3-meta{
  color: rgba(0,0,0,.55);
  font-weight: 650;
  font-size: 13px;
  text-align: right;
} */

#home .homev3-figureStage{
  padding: 0 16px 8px;
}

#home .homev3-figure{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,.08);
}

#home .homev3-pre{
  margin: 0;
  padding: 10px 18px 6px;
  overflow: auto;

  font-family: "JetBrains Mono","Fira Code","Cascadia Code","SF Mono",Menlo,Monaco,Consolas,
    ui-monospace,"Liberation Mono","Courier New",monospace;
  font-size: 13.5px;
  line-height: 1.7;
  font-variant-ligatures: contextual;
  color: rgba(0,0,0,.78);

  white-space: pre;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#home .homev3-pre code{
  display: block;
  min-width: 520px;
  background: transparent;
}



/* #home .homev3-codeLegend{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 6px;
  color: rgba(0,0,0,.56);
  font-weight: 650;
  flex-wrap: wrap;
}

#home .homev3-legendItem{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(0,0,0,.08);
} */

#home .homev3-swatch{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(0,0,0,.06);
}

#home .homev3-swatch.sw1{ background: rgba(62,129,255,.9); box-shadow: 0 0 0 5px rgba(62,129,255,.14); }
#home .homev3-swatch.sw2{ background: rgba(168,108,255,.92); box-shadow: 0 0 0 5px rgba(168,108,255,.14); }
#home .homev3-swatch.sw3{ background: rgba(255,159,62,.92); box-shadow: 0 0 0 5px rgba(255,159,62,.14); }

#home .homev3-cardFoot{
  padding: 12px 18px 18px;
  color: rgba(0,0,0,.62);
  font-size: 15px;
}

#home .homev3-cardFoot strong{
  color: rgba(0,0,0,.78);
}

#home .homev3-bottom{
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

#home .homev3-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#home .homev3-tag{
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.08);
  color: rgba(0,0,0,.62);
  font-weight: 650;
  font-size: 13px;
}

#home [data-reveal]{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}

#home .is-revealed{
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
  #home [data-reveal]{ transition: none; }
  #home .homev3-card{ transform: none !important; }
}

@media (max-width: 980px){
  body.home-v3{ overflow: auto; }
  body.is-home{ overflow: auto; }
  #home{ min-height: auto; }
  #home.active-section{ display: block; }
  #home .homev3-grid{ grid-template-columns: 1fr; }
  #home .homev3-pre code{ min-width: 0; }
}
