:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #222222;
  --accent: #0056d6;
  --accent-soft: #e3efff;
  --border: #dddddd;
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-mode {
  --bg: #05070f;
  --bg-alt: #0e1222;
  --text: #f5f5f7;
  --accent: #4f8dff;
  --accent-soft: #202a46;
  --border: #2a3250;
}

body.dark-mode .header-content {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65);
}

body.dark-mode .site-header h1 {
  color: #f9fafb;
}

body.dark-mode .tagline {
  color: #e5e7eb;
}

body.dark-mode .header-greeting {
  color: #9ca3af;
}

body.dark-mode .chip {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(129, 140, 248, 0.8);
  color: #bfdbfe;
}

body.dark-mode .header-link-btn {
  background: rgba(15, 23, 42, 0.9);
  border-color: #4b5563;
  color: #e5e7eb;
}

body.dark-mode .header-link-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

body.dark-mode .header-scroll-hint {
  color: #9ca3af;
}


/* Reset & base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: relative;
  color: #ffffff;
  padding: 1.5rem 0 4rem;  /* 原来是 padding-bottom: 0.75rem，把底部撑高一点给 nav 用 */
  background-color: #050816;
  /* overflow: visible;  确保这行是 visible 或删掉 overflow */
}


.header-bg {
  position: absolute;
  inset: 0;
  background-image:
    /* 底部做一个由海水 → 浅色的渐变，让 nav 区域不会是突兀的一刀切 */
    linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0) 0%,
      rgba(15, 23, 42, 0.10) 55%,
      rgba(248, 250, 252, 1) 100%
    ),
    url("../img/water.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center top;
  transform: scale(1.05);
  will-change: transform;
  z-index: 0;
}


.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 2.4rem 2rem 1.8rem;

  /* 更亮一点的毛玻璃 */
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  /* 更圆一点，看起来像大胶囊 */
  border-radius: 30px;

  /* 阴影稍微再大一点，偏下方 */
  box-shadow:
    0 28px 60px rgba(15, 23, 42, 0.42),
    0 0 0 1px rgba(15, 23, 42, 0.02); /* 很轻的描边，增加立体感 */

  /* 稍微离海面远一点 */
  margin-top: 1.8rem;
}


.header-main {
  flex: 1;
  min-width: 0;
}

.header-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.header-intro {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.header-greeting {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
}

.site-header h1 {
  margin: 0;
  font-size: 2.25rem;
  color: #111827;
  font-weight: 700;
}

.tagline {
  margin: 0.35rem 0 0.6rem;
  font-weight: 500;
  color: #374151;
}

.header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

/* 小研究方向标签 chips */
.chip {
  font-size: 0.78rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

/* 下面一排按钮：Email, Scholar, ORCID, GitHub */
.header-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.header-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.85rem;
  background-color: #ffffff;
  color: #111827;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.12s ease,
              box-shadow 0.15s ease, border-color 0.15s ease;
}

.header-link-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.header-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  border-color: #9ca3af;
}

.header-link-btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* 头像 hover 有轻微缩放 */
.profile-photo img {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-photo img:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.55);
}

/* Scroll 提示 */
.header-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.75rem;
  color: #4b5563;
  text-decoration: none;
  opacity: 0.85;
}

.header-scroll-hint .arrow {
  font-size: 0.9rem;
  animation: scroll-bounce 1.5s infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}


.site-header h1 {
  margin: 0;
  font-size: 2rem;
}

.tagline {
  margin: 0.35rem 0;
  font-weight: 500;
  opacity: 0.9;
}

.contact-line {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.contact-line a {
  color: #f2f5ff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contact-line a:hover {
  border-bottom-color: #f2f5ff;
}

.profile-photo img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
}


/* Theme toggle */

.theme-toggle {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.theme-toggle:active {
  transform: scale(0.96);
}

/* Navigation */
/* ---------- Top navigation bar ---------- */

/* 外层：负责渐变背景 + sticky 效果 */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.45rem 0 0.35rem;
  /* background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0)
  );
  backdrop-filter: blur(12px); */
  margin-top: -3rem;
  -webkit-backdrop-filter: blur(12px); 
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* 内层：一开始是悬浮胶囊，展开后变成整条导航 */
.nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.25rem 1.3rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;

  transition:
    border-radius 0.25s ease,
    max-width 0.25s ease,
    box-shadow 0.25s ease,
    padding 0.25s ease;
}

/* 链接样式 */
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition:
    color 0.15s ease,
    transform 0.12s ease;
}

/* 底部小条作为 hover / active indicator */
.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.18rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background-color: var(--accent);
  transform: translateX(-50%);
  transition: width 0.18s ease;
}

.nav a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.nav a:hover::after {
  width: 80%;
}

.nav a.active {
  color: var(--accent);
}

.nav a.active::after {
  width: 80%;
}

/* ---------- 滚动后“展开”为正常顶部栏 ---------- */

/* JS 会在向下滚动时给 .nav 加这个类 */
.nav.nav-scrolled {
  background: rgba(255, 255, 255, 0.0);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.6);
}

.nav.nav-scrolled .nav-inner {
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  padding-inline: 0.75rem;
}

/* Main content */

main {
  padding: 2rem 0 3rem;
}

.section {
  margin: 1.5rem 0;
  padding: 1.3rem 1.5rem;
  border-radius: 18px;
  background-color: var(--bg-alt);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.section:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  border-color: rgba(129, 140, 248, 0.7);
}

body.dark-mode .section {
  background-color: #0b1120;
  border-color: rgba(148, 163, 184, 0.4);
}

/* ---------- Nav in dark mode ---------- */
body.dark-mode .nav {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.0),
    rgba(15, 23, 42, 0)
  );
}

body.dark-mode .nav-inner {
  background-color: rgba(15, 23, 42, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

body.dark-mode .nav.nav-scrolled {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 1px 0 rgba(30, 64, 175, 0.7);
}

body.dark-mode .nav.nav-scrolled .nav-inner {
  box-shadow: none;
}

body.dark-mode .nav a {
  color: #e5e7eb;
}

body.dark-mode .nav a:hover,
body.dark-mode .nav a.active {
  color: #bfdbfe;
}

body.dark-mode .nav a::after {
  background-color: #60a5fa;
}

/* Dark 模式下，给海面图加一层深色蒙版 */
body.dark-mode .header-bg {
  background-image:
    /* 底部做一个由海水 → 浅色的渐变，让 nav 区域不会是突兀的一刀切 */
    linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0) 0%,
      rgba(15, 23, 42, 0.10) 55%,
      rgba(5, 7, 16, 1) 100% 
    ),
    url("../img/water.jpg");
}



/* ---- Improve link readability in dark mode ---- */
body.dark-mode a {
  color: #60a5fa; /* bright light blue for dark theme */
}

body.dark-mode a:hover {
  color: #93c5fd; /* even brighter when hovering */
  text-decoration: underline;
}

/* --- Publications filter buttons in dark mode --- */
body.dark-mode .pub-filter-button {
  background-color: rgba(255, 255, 255, 0.04);
  color: #cbd5e1; /* light grey-blue */
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.dark-mode .pub-filter-button:hover {
  background-color: rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
}

/* Active (selected) state: bright blue capsule */
body.dark-mode .pub-filter-button.active {
  background-color: #3b82f6; /* bright blue */
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}



h2 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--accent);
  padding-left: 0.6rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
}

/* Lists */

ul {
  padding-left: 1.2rem;
}

/* News */

.news-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.news-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background-color: var(--accent-soft);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.news-date {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background-color: #ffffff55;
}

/* Publications */

.pub-filters {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-filter-button {
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--bg-alt);
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pub-filter-button:hover {
  background-color: var(--accent-soft);
}

.pub-filter-button.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pub-list {
  padding-left: 1.2rem;
}

.pub-list li {
  margin-bottom: 0.65rem;
}

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

.pub-list a:hover {
  text-decoration: underline;
}

.pub-venue {
  font-weight: 600;
}

/* 容器设为 Flex 以便对齐 */
.pub-header {
    display: flex;
    align-items: center; /* 垂直居中 */
    gap: 8px; /* 标签和会议名之间的间距 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 基础标签样式 */
.pub-tag {
    display: inline-block;
    padding: 2px 8px;      /* 内边距：上下小，左右大 */
    font-size: 0.75rem;    /* 比正文稍小 */
    font-weight: 600;      /* 半粗体 */
    border-radius: 999px;  /* 胶囊圆角 */
    line-height: 1;
    white-space: nowrap;   /* 防止文字换行 */
}

/* 🏆 奖项专用配色 (金色/琥珀色系) */
.tag-award {
    background-color: #fffbeb; /* 极淡的黄色背景 */
    color: #b45309;            /* 深琥珀色文字 */
    border: 1px solid #fcd34d; /* 淡金色边框 */
}

/* 悬停效果 (可选) */
.tag-award:hover {
    background-color: #fef3c7;
}

/* Timeline */

.timeline {
  list-style: none;
  padding-left: 0;
  border-left: 2px solid rgba(148, 163, 184, 0.6);
  margin-left: 0.5rem;
}

.timeline li {
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.4rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--accent));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.timeline-date {
  font-size: 0.85rem;
  color: #777777;
}

/* Notes, code */

.note {
  font-size: 0.9rem;
  color: #555555;
}

body.dark-mode .note {
  color: #c0c4d4;
}

code {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background-color: var(--bg-alt);
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
}

/* Back to top button */

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: none;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #003ea3;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-alt);
  padding: 1rem 0;
  font-size: 0.9rem;
  text-align: center;
}

/* Responsive */

@media (max-width: 700px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.2rem 1.4rem;
  }

  .header-side {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    align-self: flex-start;
  }

  .header-scroll-hint {
    display: none; /* 小屏幕隐藏 scroll 提示 */
  }

  .nav-inner {
    justify-content: flex-start;
  }
}


@media (max-width: 600px) {
  .profile-photo {
    display: none;
  }
}

