:root {
  --navy: #0c1f3f;
  --navy-dark: #081530;
  --accent: #2f7bff;
  --accent-light: #5c9aff;
  --cyan: #38d6c4;
  --text: #1f2937;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f5f8fd;
  --border: #e6ecf5;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(12, 31, 63, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

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

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
  background: transparent;
}
.nav.scrolled {
  background: rgba(8, 21, 48, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 0.5px;
}
.brand span { background: linear-gradient(90deg, var(--accent-light), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 24px; height: 24px; color: var(--cyan); }
.links a {
  position: relative; color: #c6d3e8; margin-left: 30px; font-size: 15px; font-weight: 500;
  transition: color 0.2s;
}
.links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-light), var(--cyan));
  border-radius: 2px; transition: width 0.25s;
}
.links a:hover { color: #fff; text-decoration: none; }
.links a:hover::after { width: 100%; }
.menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 70% -10%, #16335f 0%, var(--navy) 45%, var(--navy-dark) 100%);
  color: #fff; padding: 170px 0 0; text-align: center;
}
#netCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero-glow {
  position: absolute; left: 50%; top: 30%; width: 560px; height: 560px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(56, 214, 196, 0.16) 0%, transparent 65%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero-kicker {
  display: inline-block; text-transform: uppercase; letter-spacing: 4px; font-size: 13px;
  color: var(--cyan); font-weight: 600; margin-bottom: 18px;
  padding: 7px 18px; border: 1px solid rgba(56, 214, 196, 0.35); border-radius: 999px;
  background: rgba(56, 214, 196, 0.08);
}
.hero h1 { font-size: 64px; font-weight: 800; letter-spacing: 3px; margin-bottom: 22px; }
.hero h1 .accent { background: linear-gradient(90deg, var(--accent-light), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 780px; margin: 0 auto 40px; font-size: 17px; color: #b9c8e2; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 90px; }
.btn {
  display: inline-block; padding: 13px 32px; border-radius: 10px;
  font-weight: 600; font-size: 15px; transition: all 0.25s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-light)); color: #fff;
  box-shadow: 0 8px 24px rgba(47, 123, 255, 0.4);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(47, 123, 255, 0.55); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }

/* hero stats bar */
.hero-stats { position: relative; z-index: 2; background: rgba(255, 255, 255, 0.05); border-top: 1px solid rgba(255, 255, 255, 0.09); backdrop-filter: blur(6px); }
.hero-stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.hstat { padding: 26px 10px; text-align: center; }
.hstat + .hstat { border-left: 1px solid rgba(255, 255, 255, 0.09); }
.hstat-num {
  font-size: 36px; font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hstat-label { font-size: 13px; color: #93a5c6; margin-top: 2px; letter-spacing: 0.4px; }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); }
.section-kicker {
  text-transform: uppercase; letter-spacing: 3px; font-size: 12px;
  color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
.section-title { font-size: 34px; font-weight: 800; color: var(--navy); margin-bottom: 34px; letter-spacing: 0.3px; }
.section-desc { color: var(--muted); margin-bottom: 22px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start; }
.about-text .lead { font-size: 19px; color: var(--navy); font-weight: 600; margin-bottom: 18px; line-height: 1.6; }
.about-text p:not(.lead) { color: #475569; }
.about-points { display: flex; flex-direction: column; gap: 18px; }
.point {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; transition: box-shadow 0.25s, transform 0.25s;
}
.point:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.point-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #e8f0ff, #e0fbf7);
  display: flex; align-items: center; justify-content: center;
}
.point-icon svg { width: 22px; height: 22px; color: var(--accent); }
.point h4 { font-size: 16px; color: var(--navy); margin-bottom: 2px; }
.point p { font-size: 14px; color: var(--muted); }

/* ---------- Research cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--border);
  border-radius: 18px; padding: 32px 28px; overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  opacity: 0; transition: opacity 0.25s;
}
.card:hover { box-shadow: 0 18px 44px rgba(12, 31, 63, 0.13); transform: translateY(-5px); border-color: transparent; }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--navy), #1c4a8f);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(12, 31, 63, 0.25);
}
.card-icon svg { width: 26px; height: 26px; color: #fff; }
.card-tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent); background: #e9f1ff;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.card h3 { font-size: 18px; color: var(--navy); margin-bottom: 10px; line-height: 1.4; }
.card p { font-size: 14px; color: var(--muted); }

/* ---------- Publications ---------- */
.pub-meta { color: var(--muted); font-size: 14px; }
.pub-toolbar { position: relative; max-width: 480px; margin-bottom: 30px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9aa7bd; pointer-events: none; }
#pubSearch {
  width: 100%; padding: 13px 16px 13px 42px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 12px; outline: none;
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
#pubSearch:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.12); }

.pub-year {
  display: flex; align-items: center; gap: 14px;
  font-size: 22px; font-weight: 800; color: var(--navy); margin: 40px 0 16px;
}
.pub-year::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.pub-year .count { font-size: 13px; font-weight: 600; color: var(--accent); background: #e9f1ff; border-radius: 999px; padding: 3px 12px; }

.pub-item {
  position: relative; padding: 18px 20px 16px 24px; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 12px; background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.pub-item::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--cyan));
  opacity: 0; transition: opacity 0.2s;
}
.pub-item:hover { border-color: #c8d9f8; box-shadow: var(--shadow); transform: translateX(3px); }
.pub-item:hover::before { opacity: 1; }
.pub-title { font-weight: 650; font-size: 16px; color: var(--navy); margin-bottom: 4px; line-height: 1.5; }
.pub-authors { font-size: 14px; color: #4b5563; }
.pub-venue { font-size: 14px; color: var(--muted); font-style: italic; }
.pub-foot { margin-top: 11px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-badge {
  font-size: 12px; color: var(--muted); background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px;
}
.pub-link {
  font-size: 13px; font-weight: 600; padding: 5px 15px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); transition: all 0.2s;
}
.pub-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
.pub-link.scholar { border-color: #b6c2d6; color: var(--muted); }
.pub-link.scholar:hover { background: #8fa0bb; border-color: #8fa0bb; color: #fff; }
.pub-loading, .pub-error, .pub-empty { color: var(--muted); padding: 24px 0; }
.pub-error { color: #b91c1c; }

/* ---------- Footer ---------- */
.footer { background: linear-gradient(180deg, var(--navy-dark), #050d1f); color: #cbd5e1; padding: 64px 0 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 44px; }
.footer-brand { font-size: 24px; }
.footer p { font-size: 14px; color: #8ca0c2; margin-top: 10px; line-height: 1.7; }
.footer-links h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 2px; color: #6f84ab; margin-bottom: 12px; }
.footer-links a { display: block; color: #cbd5e1; margin-bottom: 9px; font-size: 15px; }
.footer-links a:hover { color: var(--cyan); text-decoration: none; }
.copyright { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 22px; padding-bottom: 22px; font-size: 13px; color: #66779b; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .cards { grid-template-columns: 1fr; }
  .hero { padding-top: 140px; }
  .hero h1 { font-size: 42px; letter-spacing: 2px; }
  .hero-stats-inner { grid-template-columns: 1fr 1fr; }
  .hstat:nth-child(3) { border-left: none; }
  .hstat { border-top: 1px solid rgba(255, 255, 255, 0.09); }
  .links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(8, 21, 48, 0.97); flex-direction: column; padding: 14px 24px 22px;
  }
  .links.open { display: flex; }
  .links a { margin: 12px 0 0; }
  .menu-btn { display: block; }
  .section { padding: 72px 0; }
}

/* ---------- Earth wind-map background (publications-only page) ---------- */
#earthBg {
  position: fixed; left: 0; width: 100%;
  top: 0; height: 100%;            /* 自托管 earth 嵌入模式已隐藏自带 UI，无需裁剪 */
  border: 0; z-index: -2; pointer-events: none;
  background: var(--navy-dark); /* 地图加载前的兜底色 */
}
#earthBg.interactive {
  pointer-events: auto; /* 论文列表隐藏后，地图可拖拽缩放 */
  z-index: 1;           /* 提到内容层之上，避免负层级导致滚轮事件丢失 */
}

.earth-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(8, 21, 48, 0.55) 0%,
    rgba(8, 21, 48, 0.30) 40%,
    rgba(8, 21, 48, 0.60) 100%);
}
body { background: var(--navy-dark); }

/* 页面上只有 Publications 一个区块，顶部留出固定导航的高度 */
.publications-page { padding-top: 100px; min-height: 100vh; transition: opacity 0.3s; }
.publications-page.hidden { display: none; }

/* 右上角隐藏按钮：低调半透明，悬停时变清晰 */
#pubToggle {
  position: fixed; top: 18px; right: 20px; z-index: 200;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(8, 21, 48, 0.35); color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 18px; line-height: 1; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: all 0.25s;
}
#pubToggle:hover { background: rgba(8, 21, 48, 0.7); color: #fff; border-color: rgba(255, 255, 255, 0.45); }
#pubToggle.active { color: var(--cyan); border-color: rgba(56, 214, 196, 0.5); }

/* 顶端实验室简介与联系方式 */
#siteIntro {
  position: fixed; top: 18px; left: 24px; z-index: 100;
  color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none; /* 不挡地图；mailto 链接单独恢复可点 */
}
#siteIntro h1 { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }
#siteIntro.hidden { display: none; }
#siteIntro p { font-size: 12.5px; color: #c9d5ea; margin-top: 3px; }
#siteIntro .contact a, #siteIntro .contact b { color: var(--cyan); font-weight: 600; }
#siteIntro .credit { font-size: 11px; color: #8fa3c4; margin-top: 5px; }
#siteIntro a { pointer-events: auto; }
@media (max-width: 860px) {
  #siteIntro { left: 16px; top: 14px; right: 70px; }
  #siteIntro h1 { font-size: 14px; }
  #siteIntro p { font-size: 11px; }
}

/* 完全透明的 Publications 列表，直接投在风场地图上（深色主题） */
.panel { padding: 0 12px; }

.panel .section-kicker { color: var(--cyan); }
.panel .section-title { color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.panel .section-desc, .panel .pub-meta { color: #b9c8e2; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.panel .section-desc a { color: var(--accent-light); }

/* 搜索框：深色半透明 */
.panel .search-icon { color: #93a5c6; }
.panel #pubSearch {
  background: rgba(8, 21, 48, 0.55); color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.panel #pubSearch::placeholder { color: #93a5c6; }
.panel #pubSearch:focus { border-color: var(--accent-light); box-shadow: 0 0 0 4px rgba(92, 154, 255, 0.2); }

/* 年份标题 */
.panel .pub-year { color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); margin: 22px 0 10px; font-size: 19px; }
.panel .pub-year::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent); }
.panel .pub-year .count { color: var(--accent-light); background: rgba(92, 154, 255, 0.16); }

/* 论文条目：紧凑排版，近乎透明，仅在文字下垫一层薄薄的暗色保证可读 */
.panel .pub-item {
  padding: 8px 14px; margin-bottom: 6px;
  background: rgba(8, 21, 48, 0.42);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.panel .pub-item:hover { border-color: rgba(255, 255, 255, 0.32); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.panel .pub-line1 { font-size: 14.5px; line-height: 1.5; }
.panel .pub-no { color: var(--cyan); font-weight: 700; margin-right: 2px; }
.panel .pub-title { color: #fff; font-weight: 600; }
.panel .pub-meta-line { font-size: 12.5px; margin-top: 1px; }
.panel .pub-authors { color: #a8b6cf; }
.panel .pub-venue { color: #8fa3c4; font-style: italic; }
.panel .pub-venue::before { content: "· "; font-style: normal; }
.panel .pub-link { font-size: 12px; padding: 1px 10px; margin-left: 4px; color: var(--accent-light); border-color: var(--accent-light); }
.panel .pub-link:hover { background: var(--accent-light); color: var(--navy-dark); text-decoration: none; }
.panel .pub-loading, .panel .pub-empty { color: #b9c8e2; }
.panel .pub-error { color: #ff9b9b; }
.panel .pub-error a { color: var(--accent-light); }

/* 当前风图叠加层名称（论文列表顶部、年份标题之上） */
.panel .overlay-label {
  font-size: 12.5px; color: #8fa3c4; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* 随机网站简介（overlay 标签上方） */
.panel .random-intro {
  font-size: 13px; color: #b9c8e2; margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* 防止长 DOI / 长标题在窄屏撑破布局 */
.panel .pub-title, .panel .pub-authors, .panel .pub-venue, .panel .pub-link {
  overflow-wrap: anywhere; word-break: break-word;
}

/* 纯风图模式：短句在地图随机位置浮出 */
#factLayer { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#factLayer .fact {
  position: absolute; max-width: 340px;
  font-size: 15px; line-height: 1.5; color: #e8eefb;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  opacity: 0; transform: translateY(8px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
#factLayer .fact.show { opacity: 0.95; transform: none; }

/* ---------- 手机端：iframe 加载前的静态渐变兜底 ---------- */
@media (max-width: 860px) {
  body {
    background: radial-gradient(1000px 500px at 70% -10%, #16335f 0%, var(--navy) 45%, var(--navy-dark) 100%) fixed;
  }
  .panel .pub-item { backdrop-filter: none; -webkit-backdrop-filter: none; } /* 省性能 */
  .panel .pub-link { display: table; margin: 5px 0 2px; } /* 手机端 DOI 单独一行 */
}

@media (max-width: 860px) {
  .panel { padding: 0 4px; }
  .publications-page { padding-top: 120px; }
}
