/* =========================================================
   个人学术主页样式表 (style.css)
   ========================================================= */

/* ---------- 变量与主题 ---------- */
:root {
  --bg: #f5f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #16233d;
  --text-soft: #5c6b87;
  --border: #e1e7f0;
  --primary: #1d4ed8;
  --primary-soft: #e3ebff;
  --accent: #0d9488;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --maxw: 1080px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --surface: #121d33;
  --surface-2: #182640;
  --text: #e7eef9;
  --text-soft: #9fb1cc;
  --border: #26344f;
  --primary: #5b8cff;
  --primary-soft: #1c2b4d;
  --accent: #2dd4bf;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ---------- 基础 ---------- */
* { 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;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 1rem; font-weight: 700;
}

.site-nav { display: flex; align-items: center; }
.nav-list { display: flex; gap: 4px; }
.nav-link {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text-soft); font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { color: var(--primary); background: var(--primary-soft); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
.menu-btn { display: none; }
/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 80px 0 96px;
  background:
    radial-gradient(900px 400px at 15% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(700px 380px at 90% 0%, rgba(13, 148, 136, 0.10), transparent 60%),
    var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: center; }

.hero-avatar img {
  width: 210px; height: 210px; object-fit: cover; border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: var(--shadow);
}

.hero-greet { color: var(--text-soft); font-size: 1.05rem; }
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.15; margin: 6px 0 10px;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title { font-size: 1.25rem; font-weight: 600; }
.hero-affil { color: var(--text-soft); margin-top: 2px; }
.hero-tags { margin: 18px 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags span {
  padding: 4px 14px; border-radius: 999px; font-size: 0.85rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(29, 78, 216, 0.28); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(29, 78, 216, 0.34); }
[data-theme="dark"] .btn-primary { color: #0b1220; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.hero-stats {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 12px; text-align: center; box-shadow: var(--shadow);
}
.stat-num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.88rem; color: var(--text-soft); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  color: var(--text-soft); opacity: 0.75; animation: bob 2s infinite;
}
.scroll-hint svg { width: 26px; height: 26px; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- 通用区块 ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin-bottom: 36px; position: relative; padding-bottom: 12px;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.section-en { font-family: var(--font); font-size: 0.9rem; color: var(--text-soft); font-weight: 400; margin-left: 8px; }

/* ---------- 简介 ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.about-text p { margin-bottom: 14px; color: var(--text-soft); }
.about-text p:first-child { color: var(--text); }
.about-links { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

.about-card, .contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.about-card h3, .contact-card h3 { margin-bottom: 16px; font-size: 1.1rem; }

.info-list li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; }
.info-list li:last-child { border-bottom: none; }
.info-list li span { flex: 0 0 62px; color: var(--text-soft); font-weight: 600; }
/* ---------- 卡片 ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12); border-color: var(--primary); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--text-soft); font-size: 0.93rem; }
.card-sub { color: var(--accent) !important; font-weight: 600; margin-bottom: 8px; }
.card-link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 0.92rem; }

/* ---------- 论文 ---------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.pub-filter {
  padding: 7px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; font-size: 0.9rem;
}
.pub-filter:hover { border-color: var(--primary); color: var(--primary); }
.pub-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .pub-filter.active { color: #0b1220; }

.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub-item {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; transition: border-color 0.2s ease, transform 0.2s ease;
}
.pub-item:hover { border-color: var(--primary); transform: translateX(4px); }
.pub-year {
  flex: 0 0 58px; text-align: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 800;
  border-radius: 10px; padding: 6px 0; font-size: 0.95rem;
}
.pub-title { font-size: 1.05rem; margin-bottom: 4px; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--primary); }
.pub-authors { font-size: 0.9rem; color: var(--text-soft); }
.pub-venue { font-size: 0.9rem; margin-top: 4px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; margin-right: 8px; vertical-align: 1px;
}
.badge-conf { background: #e6f7f5; color: #0d9488; }
.badge-journal { background: var(--primary-soft); color: var(--primary); }
.pub-note { margin-top: 20px; color: var(--text-soft); font-size: 0.9rem; }

/* ---------- 学生 ---------- */
.recruit {
  display: flex; gap: 20px; align-items: flex-start;
  background: linear-gradient(120deg, var(--primary-soft), transparent);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 24px;
}
.recruit-icon { font-size: 2rem; line-height: 1; }
.recruit h3 { margin-bottom: 6px; }
.recruit p { color: var(--text-soft); }
.students-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.student-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.student-card h4 { margin-bottom: 12px; font-size: 1.05rem; }
.student-card li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; color: var(--text-soft); }
.student-card li:last-child { border-bottom: none; }

/* ---------- 动态 ---------- */
.news-list { display: flex; flex-direction: column; }
.news-item {
  display: flex; gap: 24px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px dashed var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  flex: 0 0 90px; font-weight: 700; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.news-item p { color: var(--text-soft); }
/* ---------- 联系 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: 0.9rem;
  transition: all 0.2s ease;
}
.social-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; transform: translateY(-2px); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-alt);
  padding: 28px 0; text-align: center; color: var(--text-soft); font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.cards-grid .reveal:nth-child(2), .pub-list .reveal:nth-child(2) { transition-delay: 0.08s; }
.cards-grid .reveal:nth-child(3), .pub-list .reveal:nth-child(3) { transition-delay: 0.16s; }
.cards-grid .reveal:nth-child(4), .pub-list .reveal:nth-child(4) { transition-delay: 0.24s; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px; transform: translateY(-140%); transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }
  .site-nav.open { transform: translateY(0); }
  .nav-list { flex-direction: column; gap: 2px; }
  .nav-link { padding: 12px; }

  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .hero-avatar { display: flex; justify-content: center; }
  .hero-tags, .hero-actions { justify-content: center; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .scroll-hint { display: none; }

  .about-grid, .students-grid, .contact-grid { grid-template-columns: 1fr; }
  .news-item { flex-direction: column; gap: 4px; }
}

@media (max-width: 520px) {
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 64px; }
  .pub-item { flex-direction: column; gap: 10px; }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .scroll-hint, .pub-filters, .hero-actions { display: none; }
  body { background: #fff; color: #000; }
  .hero { background: none; padding: 20px 0; }
  .section { padding: 24px 0; page-break-inside: avoid; }
  .card, .pub-item, .student-card { box-shadow: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 语言切换按钮 ---------- */
.lang-btn {
  height: 38px; min-width: 44px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-soft);
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.lang-btn:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--primary); }

/* 信息列表：标签与值分别定位（支持中英文切换） */
.info-list li > span:first-child { flex: 0 0 62px; color: var(--text-soft); font-weight: 600; }
.info-list li > span:not(:first-child) { flex: none; color: var(--text); }

/* ---------- SCI 标签与专著/投稿区块 ---------- */
.badge-sci { background: #e9e4ff; color: #7c3aed; }
.pub-extra {
  margin-top: 24px; padding: 20px 24px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.pub-extra h4 { font-size: 1.02rem; margin: 12px 0 6px; }
.pub-extra h4:first-child { margin-top: 0; }
.pub-extra p { color: var(--text-soft); font-size: 0.95rem; }

/* ---------- 经历时间线（教育背景 / 工作 / 学术访问） ---------- */
.exp-block { margin-top: 36px; }
.exp-block h3 { font-size: 1.1rem; margin: 22px 0 12px; }
.exp-block h3:first-child { margin-top: 0; }
.timeline { display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 18px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: none; }
.tl-date { flex: 0 0 170px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.timeline li span:last-child { color: var(--text-soft); }
@media (max-width: 600px) { .timeline li { flex-direction: column; gap: 2px; } .tl-date { flex: none; } }

/* 头像裁剪偏移（证件照偏上保留面部） */
.hero-avatar img { object-position: center 25%; }


/* ---------- 研究方向卡片：左文右图 ---------- */
.research-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.card-research { display: flex; gap: 18px; align-items: center; }
.card-research .card-main { flex: 1 1 auto; min-width: 0; }
.card-research .card-fig { flex: 0 0 170px; }
.card-fig svg { width: 100%; height: auto; display: block; }
@media (max-width: 560px) {
  .card-research { flex-direction: column; align-items: flex-start; }
  .card-research .card-fig { flex-basis: auto; width: 100%; max-width: 220px; align-self: center; }
}

/* ---------- 论文作者高亮（本人黑色加粗） ---------- */
.pub-authors strong { font-weight: 700; color: #111827; }
[data-theme="dark"] .pub-authors strong { color: #ffffff; }

/* 论文注释紧贴标题下方 */
.section-title + .pub-note { margin-top: -22px; margin-bottom: 22px; }
