/* =========================================================
   Haonan He — Personal Homepage (Light Edition)
   Light · Glassmorphism · Colorful gradients · Papers with figures
   ========================================================= */

:root {
  --bg: #f4f6fd;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-dim: #5b6478;
  --accent1: #6366f1;   /* indigo */
  --accent2: #06b6d4;   /* cyan */
  --accent3: #a855f7;   /* purple */
  --pink: #ec4899;
  --amber: #f59e0b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(99, 102, 241, 0.16);
  --font: "Inter", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: rgba(99, 102, 241, 0.25); color: #fff; }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent1), var(--accent2), var(--pink));
  border-radius: 99px;
}

/* ---------- background canvas & orbs ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
}

/* subtle dot grid texture over the whole page */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(99, 102, 241, 0.16) 1.2px, transparent 1.2px);
  background-size: 27px 27px;
  opacity: 0.5;
}

/* top scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--pink));
  border-radius: 0 3px 3px 0;
  transition: width 0.12s linear;
}

/* mouse-follow spotlight */
.spotlight {
  position: fixed;
  width: 520px; height: 520px;
  left: -260px; top: -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.06) 40%, transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
}

.orbs { position: fixed; inset: 0; z-index: -3; overflow: hidden; filter: blur(80px); }
.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: orbFloat 22s ease-in-out infinite alternate;
}
.orb-1 { width: 44vw; height: 44vw; background: radial-gradient(circle, #c7d2fe, transparent 70%); top: -16vw; left: -12vw; }
.orb-2 { width: 38vw; height: 38vw; background: radial-gradient(circle, #a5f3fc, transparent 70%); top: 28vh; right: -14vw; animation-delay: -6s; }
.orb-3 { width: 34vw; height: 34vw; background: radial-gradient(circle, #fbcfe8, transparent 70%); bottom: -14vw; left: 26vw; animation-delay: -12s; }

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5vw, -4vh) scale(1.12); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 24px;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.08);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #4338ca, #0e7490, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-logo .logo-cn {
  -webkit-text-fill-color: var(--text-dim);
  background: none;
}
.logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--pink));
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,0.5); }
  50%      { box-shadow: 0 0 22px rgba(236,72,153,0.65); }
}
.logo-cn { color: var(--text-dim); font-weight: 500; font-size: 0.92rem; }

.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 0; height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--pink));
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active {
  color: var(--accent1);
}
.nav-links a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 15px;
  border-radius: 99px;
  cursor: pointer;
  color: #0e7490;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.4);
  transition: all 0.25s ease;
}
.lang-toggle:hover {
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
}

.menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.menu-btn span { width: 22px; height: 2.5px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.menu-btn.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px 20px 80px;
  position: relative;
  overflow: hidden;
}
.hero-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  font-size: clamp(9rem, 22vw, 19rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: rgba(99, 102, 241, 0.05);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: -1;
}
.hero-inner { max-width: 940px; width: 100%; position: relative; z-index: 1; }

.welcome-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 20px;
  border-radius: 99px;
  margin-bottom: 26px;
  backdrop-filter: blur(8px);
  animation: pulsePill 4s ease-in-out infinite;
}
@keyframes pulsePill {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(99,102,241,0); transform: translateY(0); }
  50% { box-shadow: inset 0 0 14px rgba(99,102,241,0.1); transform: translateY(-2px); }
}

.avatar-wrap {
  position: relative;
  width: 132px; height: 132px;
  margin: 0 auto 26px;
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 4px solid #fff;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}
.avatar-ring {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent1), var(--accent2), var(--pink), var(--amber), var(--accent1));
  animation: spin 7s linear infinite;
  z-index: 1;
  filter: blur(3px);
  opacity: 0.9;
}
.avatar-wrap::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: #fff;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-name {
  font-size: clamp(2.5rem, 6.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  background: linear-gradient(100deg, #4338ca 0%, #06b6d4 45%, #ec4899 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nameShimmer 8s ease infinite;
}
@keyframes nameShimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.cn-name {
  font-size: 0.5em;
  font-weight: 700;
  background: none;
  -webkit-text-fill-color: var(--text-dim);
  margin-left: 12px;
  letter-spacing: 0.15em;
  vertical-align: 0.5em;
}

.hero-subline {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: clamp(0.88rem, 2vw, 1rem);
  color: var(--accent2);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 20px rgba(6, 182, 212, 0.2);
}

.hero-slogan {
  margin-top: 22px;
}
.hero-slogan-main {
  font-family: "Playfair Display", "Noto Serif SC", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 3.8vw, 2.5rem);
  line-height: 1.4;
  letter-spacing: 0.015em;
  max-width: 880px;
  margin: 0 auto;
  background: linear-gradient(120deg, #6366f1 0%, #06b6d4 50%, #ec4899 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nameShimmer 9s ease infinite;
}
.hero-slogan-sub {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
}
body.minimal .hero-slogan-main {
  background: none;
  -webkit-text-fill-color: #333;
  font-size: 1.15rem;
  line-height: 1.5;
  animation: none;
}
body.minimal .hero-slogan-sub {
  letter-spacing: 0.25em;
  font-size: 0.75rem;
}

.hero-role {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--accent1);
  min-height: 1.8em;
}
.typed-cursor {
  display: inline-block;
  width: 9px; height: 1.15em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--accent1);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-affil { margin-top: 10px; color: var(--text-dim); font-size: 0.98rem; font-weight: 500; }

.hero-meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.hero-meta-item { font-weight: 500; }
.hero-meta-item a {
  color: var(--accent1);
  text-decoration: none;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.5);
  transition: color 0.2s, border-color 0.2s;
}
.hero-meta-item a:hover {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
}

.email-pill {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #0e7490;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 6px 16px;
  border-radius: 99px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.email-pill:hover {
  background: rgba(6, 182, 212, 0.18);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
}

.hero-tags { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tag {
  font-size: 0.83rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(6,182,212,0.12));
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4f46e5;
  transition: all 0.25s ease;
}
.tag:hover {
  border-color: var(--accent2);
  color: #0e7490;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
  transform: translateY(-2px);
}

/* stats */
.stats {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  max-width: 780px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 10px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99,102,241,0.6), rgba(6,182,212,0.6));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s;
}
.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: transparent;
  box-shadow: 0 18px 44px rgba(99, 102, 241, 0.22);
}
.stat-card:hover::after { opacity: 1; }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; font-weight: 500; }

.hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 99px;
  transition: all 0.3s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent1), #8b5cf6, var(--pink));
  background-size: 200% 200%;
  animation: gradShift 5s ease infinite;
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 40px rgba(236, 72, 153, 0.4);
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(15,23,42,0.15);
  box-shadow: var(--shadow);
}
.btn-ghost:hover {
  border-color: var(--accent2);
  color: #0e7490;
  transform: translateY(-3px);
}

/* floating news badges: drift across the hero from left to right */
.float-news {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.fn-badge {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 99px;
  padding: 9px 16px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  animation: drift 15s linear infinite;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.fn-badge:nth-child(2) { animation-duration: 19s; animation-delay: -7s; }
.fn-badge:nth-child(3) { animation-duration: 24s; animation-delay: -14s; }
.fn-badge:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 12px 34px rgba(99, 102, 241, 0.22);
  animation-play-state: paused;
}
.fn-fire { font-size: 0.95rem; }
@keyframes drift {
  0% { transform: translateX(-115vw); }
  100% { transform: translateX(115vw); }
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.65;
  animation: hintBounce 2s ease-in-out infinite;
}
.mouse {
  display: block;
  width: 24px; height: 40px;
  border: 2px solid #94a3b8;
  border-radius: 14px;
  padding-top: 7px;
}
.wheel { display: block; width: 4px; height: 8px; margin: 0 auto; border-radius: 4px; background: var(--accent1); animation: wheelMove 1.6s ease-in-out infinite; }
@keyframes wheelMove { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes hintBounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- sections ---------- */
.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 90px 24px 40px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 34px;
  color: var(--text);
}
.sec-idx {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  border-radius: 8px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(99,102,241,0.45), rgba(236,72,153,0.15), transparent);
}

#about .section-body { padding-left: 8%; }
.section-body p { color: var(--text-dim); font-size: 1.03rem; max-width: 860px; margin-bottom: 16px; }
.section-body b { font-weight: 700; }
.section-body p b {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- cards (research interests) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent1), var(--accent2), var(--pink), transparent);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.35s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(99,102,241,0.4); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- highlights ---------- */
.hl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hl-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, rgba(99,102,241,0.08), rgba(6,182,212,0.06));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: 22px 20px;
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  cursor: pointer;
  min-width: 0;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.hl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 20px 50px rgba(6, 182, 212, 0.2);
}
.hl-card.open { border-color: rgba(99, 102, 241, 0.45); }
.hl-num {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 800;
  color: rgba(99, 102, 241, 0.14);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.hl-venue {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0e7490;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 4px 11px;
  border-radius: 99px;
}
.hl-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: break-word; }
.hl-card p { color: var(--text-dim); font-size: 0.88rem; flex: 1; }
.hl-head { display: flex; align-items: center; gap: 9px; padding-right: 26px; }
.hl-icon { font-size: 1.2rem; flex: none; }
.hl-toggle {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
  flex: none;
  transition: all 0.25s ease;
}
.hl-card:hover .hl-toggle { background: rgba(99, 102, 241, 0.2); }
.hl-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}
.hl-list {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}
.hl-card.open .hl-list { grid-template-rows: 1fr; }
.hl-list-inner { overflow: hidden; }
.hl-list-inner ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 9px; }
.hl-list li { position: relative; padding-left: 14px; }
.hl-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
}
.hl-list a { color: var(--text-dim); font-size: 0.85rem; line-height: 1.55; text-decoration: none; transition: color 0.2s; }
.hl-list a:hover { color: var(--accent1); }
.hl-list b { color: var(--text); font-weight: 700; }
.hl-foot { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-dim); border-top: 1px dashed rgba(15,23,42,0.12); padding-top: 10px; font-weight: 600; }
.hl-foot span:first-child { color: #d97706; }
.hl-cites { font-family: var(--mono); color: #0e7490; }

/* ---------- publications ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; align-items: center; }
.filters::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent1);
  margin-right: 4px;
  box-shadow: 0 0 12px rgba(99,102,241,0.6);
}
.filter-btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 19px;
  border-radius: 99px;
  cursor: pointer;
  color: var(--text-dim);
  background: #fff;
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: 0 3px 10px rgba(15,23,42,0.05);
  transition: all 0.25s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent2); transform: translateY(-1px); }
.filter-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent1), #8b5cf6);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(99,102,241,0.4);
}

.pub-list { display: flex; flex-direction: column; gap: 18px; }

.pub-loading {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 0;
  animation: pulse 2s ease-in-out infinite;
}

.pub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: pubIn 0.55s ease forwards;
}
.pub:hover {
  border-color: rgba(99,102,241,0.35);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.pub::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
}
.pub:hover::before { opacity: 1; }
@keyframes pubIn { to { opacity: 1; transform: translateY(0); } }
.pub[data-cat="peft"] { border-left: 4px solid var(--accent1); }
.pub[data-cat="rl"] { border-left: 4px solid var(--accent2); }
.pub[data-cat="bench"] { border-left: 4px solid var(--accent3); }

.pub-fig {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  align-self: center;
  width: 100%;
  min-height: 260px;
  max-height: 340px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.pub-fig img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: zoom-in;
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.pub-fig img.loaded { opacity: 1; }
.pub:hover .pub-fig img { transform: scale(1.03); }
.pub-fig .fig-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--mono);
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 99px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.pub-fig:hover .fig-zoom-hint { opacity: 1; }

.pub-body { display: flex; flex-direction: column; gap: 9px; min-width: 0; align-self: center; }

.pub-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-title { font-size: 1.02rem; font-weight: 700; color: var(--text); }
.pub-authors { color: var(--text-dim); font-size: 0.86rem; }
.pub-authors .me { color: #d97706; font-weight: 800; }
.pub-note { color: var(--text-dim); font-size: 0.83rem; opacity: 0.9; }

.pub-venue {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.4);
  color: #4f46e5;
}
.pub-venue.neurips { background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.45); color: #7e22ce; }
.pub-venue.iclr { background: rgba(6,182,212,0.1); border-color: rgba(6,182,212,0.4); color: #0e7490; }
.pub-venue.emnlp { background: rgba(236,72,153,0.1); border-color: rgba(236,72,153,0.45); color: #be185d; }
.pub-venue.icml { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.45); color: #047857; }
.pub-venue.arxiv { background: rgba(100,116,139,0.08); border-color: rgba(100,116,139,0.3); color: #475569; }

.badge-fa {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  color: #7c2d12;
  background: linear-gradient(135deg, #fcd34d, #fbbf24);
}
.badge-cofirst {
  color: #7c2d12;
  background: linear-gradient(135deg, #fdba74, #fb923c);
}
.badge-lead {
  color: #075985;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
}
.badge-corresponding {
  color: #14532d;
  background: linear-gradient(135deg, #86efac, #4ade80);
}
.pub-cites { font-family: var(--mono); font-size: 0.78rem; color: #0e7490; font-weight: 600; margin-left: auto; }

.hf-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 10px;
  border-radius: 99px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.hf-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #312e81;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.pub-hl {
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.05);
  padding: 8px 14px;
  margin-top: 2px;
}
.pub-hl summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #0e7490;
  user-select: none;
  transition: color 0.25s;
}
.pub-hl summary:hover { color: var(--accent1); }
.pub-hl[open] summary { margin-bottom: 6px; }
.pub-hl ul { margin: 0; padding-left: 18px; }
.pub-hl li {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 3px;
}
.pub-hl li::marker { color: #0e7490; }

.pub-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pub-links a {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(15,23,42,0.14);
  transition: all 0.25s ease;
}
.pub-links a:hover { color: #0e7490; border-color: var(--accent2); box-shadow: 0 0 14px rgba(6,182,212,0.3); transform: translateY(-1px); }

/* ---------- contact ---------- */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
a.contact-item:hover {
  transform: translateY(-4px);
  border-color: rgba(6,182,212,0.5);
  box-shadow: 0 14px 36px rgba(6,182,212,0.2);
}
.ci-icon { font-size: 1.5rem; }
.contact-item b { display: block; font-size: 0.95rem; }
.contact-item small { color: var(--text-dim); font-size: 0.78rem; }

/* ---------- background effect controls ---------- */
.bg-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  display: flex;
  flex-direction: row;
  gap: 7px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 99px;
  box-shadow: var(--shadow);
}
.bg-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.bg-btn:hover { transform: scale(1.1); color: var(--accent1); }
.bg-btn.active {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 31, 0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.94);
  transition: transform 0.3s ease;
}
.lightbox.open img { transform: scale(1); }
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.lb-close:hover { background: rgba(236, 72, 153, 0.4); transform: rotate(90deg); }

/* ---------- footer ---------- */.footer {
  margin-top: 80px;
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.5);
}
.footer-rule {
  width: 88px;
  height: 3px;
  border-radius: 2px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--pink));
}
.footer p { color: var(--text-dim); font-size: 0.85rem; }
.footer-sub { margin-top: 6px; font-size: 0.75rem; opacity: 0.6; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- minimal mode (text-only, flat) ---------- */
.minimal-toggle {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.15);
  transition: all 0.25s ease;
}
.minimal-toggle:hover { color: var(--accent1); border-color: var(--accent1); }

body.minimal {
  --bg: #ffffff;
  --card: #ffffff;
  --card-border: #eeeeee;
  --text: #111111;
  --text-dim: #333333;
  --shadow: none;
  --shadow-lg: none;
  --radius: 0;
  background: #fff;
  color: #111;
  font-size: 0.92rem;
  line-height: 1.45;
  font-family: -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.minimal .orbs,
body.minimal .grain,
body.minimal #bg-canvas,
body.minimal .spotlight,
body.minimal .progress-bar,
body.minimal .hero-watermark,
body.minimal .welcome-pill,
body.minimal .float-news,
body.minimal .bg-controls,
body.minimal .scroll-hint,
body.minimal .avatar-wrap,
body.minimal .avatar-ring,
body.minimal .typed-cursor,
body.minimal .hero-role,
body.minimal .logo-dot,
body.minimal .sec-idx,
body.minimal .section-title::after,
body.minimal .footer-rule,
body.minimal .hl-num,
body.minimal .hl-toggle,
body.minimal .pub-fig,
body.minimal .pub-note,
body.minimal .pub-hl,
body.minimal .card-icon { display: none !important; }
body.minimal *,
body.minimal *::before,
body.minimal *::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}
body.minimal .reveal { opacity: 1 !important; transform: none !important; }

/* nav: plain text */
body.minimal .nav-links a.active { color: #111; text-decoration: underline; text-underline-offset: 4px; }
body.minimal .lang-toggle,
body.minimal .minimal-toggle {
  background: none;
  border: none;
  color: #111;
  padding: 2px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.minimal .nav.scrolled { background: rgba(255, 255, 255, 0.95); }

/* --- hero: dense CV header --- */
body.minimal .hero { padding: 56px 24px 28px; min-height: 0; }
body.minimal .hero-name { font-size: 1.75rem; margin-bottom: 6px; }
body.minimal .hero-name,
body.minimal .cn-name,
body.minimal .stat-num {
  background: none;
  -webkit-text-fill-color: #111;
  color: #111;
}
body.minimal .hero-affil,
body.minimal .hero-meta,
body.minimal .email-pill,
body.minimal .stats,
body.minimal .hero-cta {
  display: inline-block;
  vertical-align: middle;
  margin: 0 7px;
  font-size: 0.88rem;
}
body.minimal .hero-affil { color: #333; }
body.minimal .hero-meta { margin: 0; }
body.minimal .hero-meta-item { font-size: 0.88rem; }
body.minimal .hero-meta-item + .hero-meta-item::before { content: " · "; color: #999; }
body.minimal .hero-meta-item a { color: #111; text-decoration: underline; border: none; }
body.minimal .email-pill {
  background: none;
  border: none;
  padding: 0;
  color: #111;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.minimal .stats {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 8px auto 0;
  font-size: 0.88rem;
}
body.minimal .stat-card { background: none; border: none; padding: 0 7px; }
body.minimal .stat-card + .stat-card { border-left: 1px solid #bbb; }
body.minimal .stat-num { font-size: 0.88rem; font-weight: 600; }
body.minimal .stat-label { display: inline; font-size: 0.88rem; color: #333; margin-left: 4px; }
body.minimal .btn {
  background: none;
  border: none;
  padding: 0;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.88rem;
}
body.minimal .btn svg { display: none; }
body.minimal .email-pill,
body.minimal .hero-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 4px 0 0;
  font-size: 0.88rem;
}

/* --- sections: compact CV blocks --- */
body.minimal .section { padding: 30px 24px 6px; }
body.minimal .section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
body.minimal .section-body p { color: #333; font-size: 0.9rem; margin-bottom: 8px; }
body.minimal .section-body p b { color: #111; background: none; -webkit-text-fill-color: #111; }

/* filters: inline text */
body.minimal .filters { margin-bottom: 10px; }
body.minimal .filter-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: #555;
  padding: 2px 10px;
  font-size: 0.85rem;
  border-radius: 0;
}
body.minimal .filter-btn.active { background: none; color: #111; text-decoration: underline; text-underline-offset: 4px; }

/* highlights: dense two-column lists */
body.minimal .hl-grid { grid-template-columns: repeat(2, 1fr); gap: 4px 28px; align-items: start; }
body.minimal .hl-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  cursor: default;
  min-height: 0 !important;
}
body.minimal .hl-head h3 { font-size: 0.9rem; }
body.minimal .hl-desc { color: #444; font-size: 0.82rem; margin: 2px 0 4px; }
body.minimal .hl-list { grid-template-rows: 1fr; }
body.minimal .hl-list-inner ul { gap: 3px; }
body.minimal .hl-list a { color: #333; font-size: 0.82rem; }
body.minimal .hl-list b { color: #111; font-weight: 700; }
body.minimal .hl-list li::before { background: #111; width: 4px; height: 4px; }

/* publications: reference/citation style */
body.minimal .pub-list { gap: 0; counter-reset: pub; }
body.minimal .pub::before {
  counter-increment: pub;
  content: "[" counter(pub) "]";
  position: static;
  opacity: 1;
  background: none !important;
  font-weight: 700;
  color: #111;
  margin-right: 8px;
  height: auto;
}
body.minimal .pub {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  background: none;
  border: none;
  border-bottom: 1px dashed #ddd;
  border-radius: 0;
  padding: 7px 0;
  gap: 2px 6px;
  opacity: 1 !important;
  transform: none !important;
}
body.minimal .pub:last-child { border-bottom: none; }
body.minimal .pub[data-cat] { border-left: none; }
body.minimal .pub-body,
body.minimal .pub-head { display: contents; }
body.minimal .pub-title {
  font-size: 0.92rem;
  font-style: italic;
  font-weight: 600;
}
body.minimal .pub-venue,
body.minimal .badge-fa,
body.minimal .badge-cofirst,
body.minimal .badge-lead,
body.minimal .hf-badge {
  background: none;
  border: none;
  color: #555;
  padding: 0;
  font-size: 0.82em;
  font-family: inherit;
}
body.minimal .pub-cites { color: #333; font-size: 0.8rem; margin-left: 0; }
body.minimal .pub-authors { font-size: 0.82rem; color: #444; order: 10; width: 100%; }
body.minimal .pub-authors .me { color: #111; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
body.minimal .pub-links { margin-top: 0; order: 11; }
body.minimal .pub-links a {
  border: none;
  padding: 0;
  margin-right: 12px;
  font-size: 0.8rem;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* contact: one inline line */
body.minimal .contact-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
body.minimal .contact-item {
  background: none;
  border: none;
  border-radius: 0;
  padding: 4px 0;
  gap: 8px;
}
body.minimal .ci-icon { font-size: 1rem; }
body.minimal .contact-item b { font-size: 0.88rem; }
body.minimal .contact-item small { color: #555; font-size: 0.78rem; }

/* footer */
body.minimal .footer { background: #fff; border-top: 1px solid #eee; margin-top: 40px; padding: 18px; }
@media (max-width: 1100px) {
  .hl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .pub { grid-template-columns: 1fr; }
  .pub-fig { min-height: 0; max-height: none; }
  .float-news { display: none; }
  .menu-btn { display: flex; }
  .nav-links {
    position: fixed;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(15,23,42,0.1);
    transform: translateY(-130%);
    transition: transform 0.4s ease;
    z-index: 99;
  }
  .nav-links.open { transform: translateY(0); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 100px; }
}
@media (max-width: 600px) {
  .hl-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
