/* ===== Variables（科技感蓝黑色调）===== */
:root {
  --color-bg: #0a0e14;
  --color-bg-alt: #0d1219;
  --color-bg-card: #111820;
  --color-text: #e6edf3;
  --color-text-muted: #8b949e;
  --color-accent: #58a6ff;
  --color-accent-hover: #79b8ff;
  --color-cyan: #00d4ff;
  --color-border: #21262d;
  --color-border-glow: rgba(88, 166, 255, 0.25);
  --font-serif: "Cormorant Garamond", "Georgia", serif;
  --font-sans: "Source Sans 3", "Helvetica Neue", sans-serif;
  --max-width: 1140px;
  --header-height: 72px;
  --spacing-section: 4rem;
  /* ========== 首页全屏背景图（任选其一，取消对应行注释）========== */
  /* ----- 与研究主题更相关（神经渲染 / 3D / AI）----- */
  /* 推荐：7. 3D 节点结构（红蓝球体，类点云/神经渲染风） */
    /*--hero-image: url('https://images.unsplash.com/photo-1645839072940-bb2a4f189ed3?auto=format&fit=crop&w=1920');
  /* 8. 深色背景 + 红蓝光效（AI/数据感） */
  /* --hero-image: url('https://images.unsplash.com/photo-1645839078449-124db8a049fd?auto=format&fit=crop&w=1920'); */
  /* 9. 粉蓝球体网络（神经网络/节点可视化） */
   /* --hero-image: url('https://images.unsplash.com/photo-1645839057098-5ea8761a6b09?auto=format&fit=crop&w=1920'); */
  /* 10. 彩色漂浮对象（生成式 AI / 多模态） */
    /* --hero-image: url('https://images.unsplash.com/photo-1717501218003-3c89682cfb3b?auto=format&fit=crop&w=1920'); */
  /* 11. 抽象彩色光斑（AI 可视化） */
  /* --hero-image: url('https://images.unsplash.com/photo-1717503159960-bf398715c19e?auto=format&fit=crop&w=1920'); */
  /* ----- 通用科技风 ----- */
  /* 1. 抽象科技节点 */
  /* --hero-image: url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?auto=format&fit=crop&w=1920'); */
  /* 本地图书馆背景 */
  --hero-image: url('library.png'); 
  /* 2. 蓝黑像素线条 / AI 编码风 */
  /* --hero-image: url('https://images.unsplash.com/photo-1620712943543-bcc4688e7485?auto=format&fit=crop&w=1920'); */
  /* 3. 深蓝光晕 / 科技光效 */
  /* --hero-image: url('https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?auto=format&fit=crop&w=1920'); */
  /* 4. 抽象网络与点线（蓝紫调） */
  /* --hero-image: url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&w=1920'); */
  /* 5. 深色数据 / 代码感 */
  /* --hero-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1920'); */
  /* 6. 纯渐变（无图，仅蓝黑渐变） */
  /* --hero-image: linear-gradient(145deg, #0a0e14 0%, #0d1520 40%, #0f1a2e 70%, #0a1628 100%); */
  /* ----- 杭州/西湖景色（Unsplash 免费图）----- */
  /* 12. 西湖/杭州风景（按关键词随机，可能较慢；若失效可改用下方本地图） */
  /* --hero-image: url('https://source.unsplash.com/1920x1080/?west,lake,china,hangzhou'); */
  /* 更多杭州/西湖图：在 unsplash.com 搜索 "hangzhou" 或 "west lake" 下载到 images/ 后使用：--hero-image: url('images/hangzhou.jpg'); */
  /* ----- 浙江大学（Unsplash 免费图）----- */
  /* 13. 浙大/杭州校园（按关键词随机） */
  /* --hero-image: url('https://source.unsplash.com/1920x1080/?zhejiang,university,hangzhou'); */
  /* 14. 浙大：水畔建筑（湖/河与高楼） */
  /* --hero-image: url('https://images.unsplash.com/photo-1700629888425-3d9ac0687e3a?auto=format&fit=crop&w=1920'); */
  /* 15. 浙大：校园绿地/山坡长椅 */
  /* --hero-image: url('https://images.unsplash.com/photo-1732511154676-f5adfa1a00f0?auto=format&fit=crop&w=1920'); */
  /* 16. 浙大：湖景与城市天际 */
  /* --hero-image: url('https://images.unsplash.com/photo-1731152394399-5eb036bbf26f?auto=format&fit=crop&w=1920'); */
  /* 更多浙大图：在 unsplash.com 搜索 "zhejiang university" 下载到 images/ 后使用：--hero-image: url('images/zju.jpg'); */
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 166, 255, 0.06), transparent);
  overflow-x: hidden;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 14, 20, 0.9);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s;
}

.site-header.is-over-hero {
  background: rgba(0, 0, 0, 0.35);
  border-bottom-color: rgba(88, 166, 255, 0.2);
}

.site-header.is-over-hero .logo,
.site-header.is-over-hero .main-nav a {
  color: #fff;
}

.site-header.is-over-hero .logo {
  background: linear-gradient(135deg, #fff 0%, rgba(0, 212, 255, 0.95) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header.is-over-hero .logo::after {
  background: linear-gradient(90deg, rgba(255,255,255,0.9), var(--color-cyan));
}

.site-header.is-over-hero .logo:hover,
.site-header.is-over-hero .main-nav a:hover {
  color: var(--color-cyan);
}

.site-header.is-over-hero .logo:hover {
  background: linear-gradient(135deg, #fff 0%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header.is-over-hero .nav-toggle span {
  background: #fff;
}

/* ===== Quick Nav（手机端快速进入下一栏目）===== */
.quick-nav {
  display: none;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  padding-left: max(0.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-height: 0;
}

.header-zju-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-zju-logo img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav-center-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-left: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.nav-center-name::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

.nav-center-name:hover {
  text-decoration: none;
  opacity: 0.9;
  color: #fff;
}

.site-header.is-over-hero .header-zju-logo img {
  filter: brightness(0) invert(1);
}
.site-header.is-over-hero .header-zju-logo:hover img {
  filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(180deg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: 0;
}

.lang-switcher {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.lang-select {
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color 0.2s, color 0.2s;
}

.lang-select:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.lang-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.25);
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  transform: translateY(-3px);
}

.logo::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-cyan));
  opacity: 0.6;
  border-radius: 1px;
  transition: opacity 0.25s ease;
}

.logo:hover {
  text-decoration: none;
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo:hover::after {
  opacity: 1;
}

.site-header:not(.is-over-hero) .logo,
.site-header:not(.is-over-hero) .main-nav a {
  color: var(--color-text);
}

.site-header:not(.is-over-hero) .main-nav a:hover {
  color: var(--color-accent);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.main-nav li {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.main-nav a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
}

.main-nav a:hover {
  text-decoration: none;
}

/* Submenu */
.has-submenu {
  position: relative;
}

.has-submenu .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  padding: 0.5rem 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 1px rgba(88, 166, 255, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.has-submenu:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu li {
  margin: 0;
}

.submenu a {
  padding: 0.5rem 1rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

.site-header:not(.is-over-hero) .nav-toggle span {
  background: var(--color-text);
}

/* ===== Hero（全屏大图 + 叠加文字）===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-height); /* 为固定导航留出高度 */
}

/* 全屏背景图：在 :root 中设置 --hero-image: url('你的图片.jpg'); */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: var(--hero-image, linear-gradient(145deg, #0a0e14 0%, #0d1520 40%, #0f1a2e 70%, #0a1628 100%));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 蓝黑色遮罩 + 轻微科技感 */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.5) 0%, rgba(10, 14, 20, 0.75) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: #fff;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-cyan);
  margin: 0 0 1.25rem;
  opacity: 0.95;
}

.hero-desc {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}

.hero .btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #3d8bf0 100%);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.35);
}

.hero-pi {
  font-size: 0.95rem;
  margin: 0 0 1rem;
  opacity: 0.95;
}

.hero-pi a {
  color: var(--color-cyan);
}

.hero .btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-cyan) 100%);
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.4);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
  text-decoration: none;
  box-shadow: 0 0 16px rgba(88, 166, 255, 0.25);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(88, 166, 255, 0.35);
}

/* ===== Sections ===== */
.section {
  padding: var(--spacing-section) 1.5rem;
}

.section:nth-child(even) {
  background: var(--color-bg-alt);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section h2 {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
  display: inline-block;
  box-shadow: 0 2px 0 0 rgba(88, 166, 255, 0.2);
}

.section-intro {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ===== About ===== */
.about-content p {
  margin: 0 0 1rem;
  max-width: 72ch;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== PI 块（实验室负责人）===== */
.pi-block {
  margin-top: 1.5rem;
}

.pi-card {
  padding: 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.pi-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.pi-card .pi-role {
  font-weight: 400;
  color: var(--color-accent);
  font-size: 1rem;
}

.pi-bio {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.pi-contact {
  margin: 0;
  font-size: 0.9rem;
}

.pi-contact a {
  color: var(--color-accent);
}

/* ===== 团队成员 ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.person-card {
  padding: 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.person-card:hover {
  border-color: var(--color-border-glow);
  box-shadow: 0 0 16px rgba(88, 166, 255, 0.08);
}

.person-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
  background-image: linear-gradient(135deg, var(--color-border) 0%, var(--color-bg-alt) 100%);
}
.person-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.alumni-grid,
.people-subgrid {
  margin-top: 0.75rem;
}

.people-subgrid:empty {
  display: none;
}

#scholars-title:empty,
#alumni-title:empty,
#collaborators-title:empty {
  display: none;
}

#scholars-list:empty,
#alumni-list:empty,
#collaborators-list:empty {
  display: none;
}

.person-name {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.person-role {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.person-email {
  font-size: 0.8rem;
  color: var(--color-accent);
  word-break: break-all;
}

.person-scholar-wrap {
  display: block;
  margin-top: 0.35rem;
}

.person-scholar {
  font-size: 0.8rem;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.person-scholar:hover {
  color: var(--color-accent-hover);
}

.person-scholar-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ===== 新闻与活动 ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item time {
  display: block;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.news-item h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.news-item h3 a {
  color: var(--color-text);
}

.news-item h3 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.news-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===== 加入我们 / 招聘 ===== */
.join-content {
  max-width: 72ch;
}

.join-intro {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.join-positions {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.join-positions li {
  margin-bottom: 1rem;
}

.join-positions strong {
  display: block;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.join-positions p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.join-contact {
  margin: 0;
  padding: 1rem;
  background: var(--color-bg-card);
  border-radius: 6px;
  border-left: 3px solid var(--color-accent);
  font-size: 0.95rem;
}

/* ===== News ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.news-card {
  padding: 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.section:nth-child(even) .news-card {
  background: var(--color-bg-card);
}

.news-card:hover {
  border-color: var(--color-border-glow);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(88, 166, 255, 0.1);
}

.news-card time {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.news-card h3 a {
  color: var(--color-text);
}

.news-card h3 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.news-card p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.link-more {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Events ===== */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.event-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.section:nth-child(even) .event-item {
  background: var(--color-bg-card);
}

.event-item:hover {
  border-color: var(--color-border-glow);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.08);
}

.event-date {
  flex-shrink: 0;
  width: 70px;
  text-align: center;
  padding: 0.5rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, #2563eb 100%);
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 0 16px rgba(88, 166, 255, 0.3);
}

.event-date .day {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.event-date .month {
  font-size: 0.85rem;
}

.event-body h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.event-body h3 a {
  color: var(--color-text);
}

.event-body h3 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.event-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.event-body p {
  margin: 0;
  font-size: 0.95rem;
}

/* ===== CV lists (work, education, internship, fundings, etc.) ===== */
.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-list .cv-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.cv-list .cv-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cv-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cv-item-head strong {
  font-size: 1.05rem;
}

.cv-item .cv-date {
  font-size: 0.9rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.cv-item-body {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.cv-item-body .cv-role {
  display: block;
  margin-bottom: 0.2rem;
}

.cv-item-body .cv-role a {
  color: var(--color-accent);
}

.cv-item-body .cv-place {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
}

.cv-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  opacity: 0.95;
}

.cv-list.simple .cv-item {
  padding-left: 1rem;
  position: relative;
}

.cv-list.simple .cv-item::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.cv-list.simple .cv-item a {
  color: var(--color-accent);
}

/* ===== Papers ===== */
.subsec {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--color-text);
}

.papers-list {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  max-width: 85ch;
}

.papers-list .paper-item {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.papers-list .paper-item a {
  color: var(--color-accent);
}

/* ===== Research Highlights - Tag Cloud ===== */
.highlights-content {
  max-width: 100%;
  padding: 3rem 1rem;
  position: relative;
  margin: 0 auto;
  background: transparent;
  overflow: visible;
}
.network-graph {
  position: relative;
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.network-center {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}

.network-nodes {
  position: relative;
  width: 100%;
  height: 100%;
}

.network-node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-200px) rotate(calc(-1 * var(--angle)));
}

.network-node.level-1 {
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-200px) rotate(calc(-1 * var(--angle)));
}

.network-node.level-2 {
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-120px) rotate(calc(-1 * var(--angle)));
}

.network-node-content {
  padding: 0.6rem 1rem;
  background: var(--color-bg-card);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.network-node-content:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.5);
}

.network-subnodes {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 1rem;
}

/* ===== Style 3: Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.2);
  border-color: var(--color-accent);
}

.card-main {
  grid-column: span 1;
}

.card-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.card-body {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.card-sub {
  padding: 0.75rem;
  font-size: 0.85rem;
}

/* ===== Style 4: Radial Layout ===== */
.radial-layout {
  position: relative;
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radial-center {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 0 30px rgba(88, 166, 255, 0.6);
}

.radial-rings {
  position: relative;
  width: 100%;
  height: 100%;
}

.radial-node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y)));
}

.radial-node-content {
  padding: 0.6rem 1rem;
  background: var(--color-bg-card);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.radial-node-content:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.5);
}

.radial-node.level-2 .radial-node-content {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-width: 1.5px;
}

/* ===== Style 5: Timeline ===== */
.timeline-layout {
  position: relative;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-cyan));
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 45%;
}

.timeline-left {
  left: 0;
  text-align: right;
}

.timeline-right {
  left: 55%;
  text-align: left;
}

.timeline-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 4px solid var(--color-bg);
  top: 0;
  z-index: 2;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.timeline-left .timeline-marker {
  right: -10px;
}

.timeline-right .timeline-marker {
  left: -10px;
}

.timeline-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.2);
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.timeline-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.timeline-subitems {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-subitem {
  padding: 0.4rem 0.8rem;
  background: var(--color-bg-alt);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--color-text);
}

/* ===== Style 6: 3D Flip Cards ===== */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  perspective: 1000px;
}

.flip-card {
  height: 200px;
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-front {
  background: var(--color-accent);
  color: #fff;
}

.flip-back {
  background: var(--color-bg-card);
  border: 2px solid var(--color-accent);
  transform: rotateY(180deg);
  flex-direction: column;
  align-items: flex-start;
}

.flip-front h3 {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.flip-back p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.flip-back ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flip-back li {
  padding: 0.3rem 0;
  color: var(--color-text);
  font-size: 0.9rem;
}

/* ===== Style 7: Accordion ===== */
.accordion-layout {
  max-width: 800px;
  margin: 0 auto;
}

.accordion-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-item.active {
  border-color: var(--color-accent);
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.accordion-header:hover {
  background: var(--color-bg-alt);
}

.accordion-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.accordion-icon {
  font-size: 1.5rem;
  color: var(--color-accent);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.5rem;
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  padding: 1rem 1.5rem 1.5rem;
}

.accordion-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.accordion-subitems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.accordion-subitem {
  padding: 0.75rem;
  background: var(--color-bg-alt);
  border-radius: 6px;
}

.accordion-subitem h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

/* ===== Style 8: Tag Cloud ===== */
.tagcloud-layout {
  text-align: center;
  padding: 2rem;
  min-height: 400px;
  position: relative;
}

.tagcloud-tags {
  position: relative;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  background: var(--color-bg-card);
  border: 2px solid;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--color-text);
  position: relative;
}

.tag:hover {
  transform: scale(1.1);
  background: rgba(88, 166, 255, 0.15);
  z-index: 100;
  box-shadow: 0 0 16px currentColor, 0 0 24px currentColor;
  border-width: 3px;
}

.tag-large {
  font-size: 1.1rem;
  padding: 0.7rem 1.3rem;
  font-weight: 600;
  border-width: 3px;
}

.tag-medium {
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-width: 2px;
}

.tag-main {
  background: rgba(88, 166, 255, 0.08);
}

/* Tag Tooltip - follows mouse */
.tag-tooltip {
  position: fixed;
  background: var(--color-bg-card);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  padding: 0;
  min-width: 300px;
  max-width: 500px;
  max-height: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(88, 166, 255, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: auto;
  display: none;
}

.tag-tooltip.show {
  opacity: 0.95;
  visibility: visible;
  transform: translateY(0) scale(1);
  display: block;
}

.tooltip-header {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-cyan));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-header:not(:first-child) {
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
}

.tooltip-content {
  padding: 0.75rem 1rem;
  max-height: 320px;
  overflow-y: auto;
}

.tooltip-paper {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  border-bottom: 1px solid var(--color-border);
}

.tooltip-paper:last-child {
  border-bottom: none;
}

.tooltip-paper:hover {
  color: var(--color-accent);
}

/* Scrollbar styling for tooltip */
.tooltip-content::-webkit-scrollbar {
  width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
  border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

/* ===== 发明专利完整列表 ===== */
.patent-category {
  margin-bottom: 2rem;
}

.patent-category .subsec {
  margin-top: 0;
}

.patents-list {
  margin: 0 0 0.5rem;
  padding-left: 1.5rem;
  max-width: 85ch;
}

.patent-item {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.patent-item strong {
  color: var(--color-text);
}

/* ===== Research ===== */
.research-list {
  margin: 0;
  padding-left: 1.5rem;
  max-width: 72ch;
}

.research-list li {
  margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
.site-footer {
  padding: 2.5rem 1.5rem;
  background: #06090d;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--color-accent);
}

.site-footer a:hover {
  color: var(--color-cyan);
  text-decoration: none;
}

.footer-nav {
  margin-bottom: 1.5rem;
}

.footer-nav a {
  margin-right: 1.25rem;
}

.footer-info {
  margin-bottom: 1rem;
}

.footer-info p {
  margin: 0.25rem 0;
}

.copyright {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  opacity: 0.8;
}

/* ===== Responsive / 手机端优化 ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --spacing-section: 2.5rem;
  }

  .quick-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: var(--header-height);
    z-index: 35;
    padding: 0.5rem;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quick-nav::-webkit-scrollbar {
    display: none;
  }

  .quick-nav a {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .quick-nav a:hover,
  .quick-nav a:focus {
    color: var(--color-accent);
    background: rgba(88, 166, 255, 0.1);
  }

  .header-inner {
    padding: 0 1rem;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .header-left {
    gap: 0.5rem;
    min-width: 0;
  }

  .logo {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

  .header-zju-logo img {
    height: 28px;
  }

  .nav-center-name {
    height: 28px;
    font-size: 1.05rem;
    padding-left: 0.4rem;
  }

  .nav-center-name::before {
    left: 0;
    width: 5px;
    height: 5px;
  }

  .header-right {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .lang-switcher {
    max-width: 100%;
  }

  .lang-select {
    padding: 0.5rem 1.5rem 0.5rem 0.65rem;
    font-size: 0.85rem;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    max-height: 0;
    min-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.2s;
    z-index: 60;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    visibility: hidden;
    pointer-events: none;
  }

  .main-nav.is-open {
    max-height: 80vh;
    min-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .has-submenu .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
    max-height: 0;
    overflow: hidden;
  }

  .has-submenu.is-open .submenu {
    max-height: 200px;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
  }

  /* Hero 区域 */
  .hero {
    min-height: 80vh;
    padding-top: var(--header-height);
  }

  .hero-inner {
    padding: 1.5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .hero h1 {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
  }

  .hero-desc {
    font-size: 0.9rem;
    margin: 0 auto 1rem;
  }

  .hero-pi {
    font-size: 0.85rem;
  }

  .hero .btn-primary {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Section 与容器 */
  .section {
    padding: var(--spacing-section) 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .container {
    padding: 0;
  }

  .section h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
  }

  .subsec {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
  }

  /* 成员网格 */
  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .person-card {
    padding: 0.85rem;
  }

  .person-avatar {
    width: 56px;
    height: 56px;
  }

  .person-name {
    font-size: 0.95rem;
  }

  .person-role {
    font-size: 0.8rem;
  }

  .person-email {
    font-size: 0.75rem;
    word-break: break-all;
  }

  /* 招聘 / Join */
  .join-content {
    max-width: 100%;
  }

  .join-contact {
    padding: 0.85rem;
    font-size: 0.9rem;
  }

  /* 论文列表 */
  .papers-list {
    padding-left: 1.25rem;
  }

  .paper-item {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  /* Footer */
  .site-footer .container {
    padding: 0 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .footer-info p {
    font-size: 0.9rem;
  }

  .copyright {
    font-size: 0.8rem;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .event-item {
    flex-direction: column;
    gap: 1rem;
  }

  .event-date {
    width: auto;
    display: inline-flex;
    gap: 0.5rem;
    align-items: baseline;
  }

  .event-date .day {
    font-size: 1.2rem;
  }

  /* 研究方向 Tag 云 */
  .highlights-content {
    padding: 1.5rem 0.5rem;
  }

  .tag {
    padding: 0.6rem 0.9rem;
    margin: 0.35rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .tag-large {
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }

  .tag-medium {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
  .nav-center-name {
    font-size: 0.95rem;
  }

  .lang-select {
    font-size: 0.8rem;
    padding: 0.4rem 1.35rem 0.4rem 0.5rem;
  }

  .people-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .hero h1 {
    font-size: 1.35rem;
  }
}

/* ===== Gallery / Lab Photos ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.2);
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .gallery-item {
    aspect-ratio: 1 / 1;
  }

  .lightbox {
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .lightbox img {
    max-width: 100%;
    max-height: 85vh;
  }

  .lightbox-close {
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    font-size: 2rem;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Tag cloud / 研究方向 tooltip */
  .tag-tooltip {
    min-width: 250px;
    max-width: 90%;
    max-height: 60vh;
  }

  .tooltip-content {
    max-height: 50vh;
    font-size: 0.8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 通用按钮触摸区域 */
  .btn {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .skip-link:focus {
    padding: 0.6rem 1rem;
    min-height: 44px;
  }
}
