/* =====================================================
   董辉实验室 Dong Lab — Knight Lab 风格样式表
   设计参考: knightlab.ucsf.edu (深海军蓝 + 白底 + 黑白摄影)
   ===================================================== */
:root {
  --navy: #052049;        /* 顶栏/页脚/主色 */
  --navy-2: #123a6d;      /* 卡片、次级深蓝 */
  --link: #0a6bb8;        /* 链接蓝 */
  --link-hover: #084f88;
  --text: #222;
  --text-muted: #5f6a76;
  --border: #e2e6ea;
  --bg-gray: #f4f5f6;
  --max-width: 1080px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 3px solid #f5a623;
  outline-offset: 2px;
}
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部机构条 ---------- */
/* ---------- 站名 + 主导航 ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; }
.lang-switch {
  position: absolute; top: 8px; right: 24px;
  font-size: 0.85rem;
}
.lang-switch a { color: var(--text-muted); text-decoration: none; }
.lang-switch a:hover { color: var(--navy); text-decoration: underline; }
.site-header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 22px 24px 0;
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 2px 12px;
}
.site-title {
  color: var(--navy);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-logo { height: 52px; width: auto; display: block; }
.site-title small { display: block; font-size: 0.95rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0.04em; }
.main-nav { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  display: block;
  padding: 14px 16px 12px;
  color: #1d2b3a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--navy); border-bottom-color: #b9c6d6; text-decoration: none; }
.main-nav a.active { color: var(--navy); border-bottom-color: var(--navy); }

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 0.85rem; color: var(--navy); cursor: pointer;
  margin: 10px 0;
}

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 0.82rem; color: var(--text-muted); padding: 14px 0 4px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--link); }

/* ---------- 首页 Hero 轮播 ---------- */
.hero { position: relative; overflow: hidden; background: #fff; }
.hero-slides { position: relative; aspect-ratio: 21 / 9; min-height: 320px; }
.hero-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #777; font-size: 0.95rem; text-align: center; padding: 24px;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-slide.current { opacity: 1; }
.hero-slide.s1 { background: linear-gradient(135deg, #e8e8e8 0%, #9f9f9f 55%, #6f6f6f 100%); }
.hero-slide.s2 { background: linear-gradient(135deg, #f2f2f2 0%, #b9b9b9 50%, #7d7d7d 100%); }
.hero-slide.s3 { background: linear-gradient(135deg, #dcdcdc 0%, #8f8f8f 60%, #565656 100%); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); border: 2px solid #fff; color: #fff;
  font-size: 1.15rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.hero-arrow:hover { background: rgba(255, 255, 255, 0.45); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }
.hero-counter { position: absolute; right: 24px; bottom: 16px; color: #555; font-size: 0.85rem; }

/* ---------- 首页主题句 + 缩略图 ---------- */
.tagline {
  max-width: 920px; margin: 28px auto 36px; text-align: center;
  color: var(--navy); font-size: 3.2rem; font-weight: 500; line-height: 1.6;
  padding: 0 24px;
}
.thumb-row {
  max-width: var(--max-width); margin: 0 auto 72px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.thumb-row a { text-decoration: none; }
.thumb {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 4 / 3; border-radius: 2px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #6d6d6d; font-size: 0.82rem; text-align: center; padding: 14px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.thumb:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(5,32,73,0.15); }
.thumb-img { padding: 0; background: #fff; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-svg { background: #fff; }
.thumb-svg img { object-fit: contain; padding: 6px; box-sizing: border-box; }

.thumb-label {
  text-align: center; color: var(--text); font-size: 0.9rem; margin-top: 10px;
}

/* ---------- 内页标题与正文 ---------- */
.page-title {
  font-family: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  color: #111; font-size: 2.5rem; font-weight: 600;
  margin: 18px 0 26px;
}
.page-body { padding-bottom: 72px; }
.page-body p { margin-bottom: 16px; max-width: 860px; }
.section-h {
  color: var(--navy); font-size: 1.3rem; font-weight: 700;
  margin: 44px 0 14px;
}
.lead { font-size: 1.02rem; color: #333; }

/* 文献列表（Key papers / Publications） */
.papers { list-style: none; margin: 10px 0 8px; max-width: 900px; }
.papers li {
  padding: 9px 0 9px 22px; position: relative;
  font-size: 0.94rem; line-height: 1.65;
  border-bottom: 1px solid #f0f2f4;
}
.papers li::before {
  content: ""; position: absolute; left: 4px; top: 19px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--navy);
}
.papers .authors { font-weight: 700; }
.papers .journal { font-style: italic; }
.papers .plinks a { font-size: 0.86rem; margin-right: 10px; }

/* 提示框（占位内容说明） */
.notice {
  background: #fdf6e3; border-left: 4px solid #f5a623;
  padding: 14px 18px; border-radius: 4px;
  font-size: 0.92rem; color: #6b5d3f; margin: 22px 0 30px; max-width: 900px;
}

/* ---------- 新闻页 ---------- */
.news-row {
  display: grid; grid-template-columns: 250px 1fr; gap: 26px;
  padding: 26px 0; border-bottom: 1px solid var(--border);
  max-width: 900px;
}
.news-thumb {
  aspect-ratio: 4 / 3; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: #6d6d6d; font-size: 0.82rem; text-align: center; padding: 12px;
  filter: grayscale(1);
}
.news-row h3 { color: var(--navy); font-size: 1.08rem; margin-bottom: 6px; }
.news-row .date { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.news-row p { color: #444; font-size: 0.95rem; }
/* 无配图的新闻条：文字占满整行，避免右侧留空 */
.news-row > div:only-child { grid-column: 1 / -1; }

/* ---------- 成员页 ---------- */
.person-card {
  display: grid; grid-template-columns: 230px 1fr; gap: 34px;
  padding: 30px 0; border-bottom: 1px solid var(--border); max-width: 900px;
}
.person-photo {
  width: 230px; aspect-ratio: 3 / 4; border-radius: 2px;
  overflow: hidden;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-card h3 { color: var(--navy); font-size: 1.25rem; }
.person-card .role { color: var(--text-muted); font-size: 0.92rem; margin: 2px 0 14px; }
.person-card .bio { font-size: 0.95rem; color: #444; }

/* 成员卡片网格 */
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 26px 20px; max-width: 900px; margin: 20px 0;
}
.member-card { text-align: center; }
.member-card img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  transition: transform 0.3s;
  border-radius: 2px; background: #fff;
}
.member-card.js-member { cursor: pointer; }
.member-card.js-member:hover img { transform: translateY(-4px); }
.member-card.js-member:hover h4 { text-decoration: underline; text-underline-offset: 3px; }
.member-card .placeholder {
  width: 100%; aspect-ratio: 3 / 4; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: #8a8a8a; font-size: 0.78rem; text-align: center; padding: 10px;
  background: linear-gradient(135deg, #dcdcdc, #a8a8a8);
}
.member-card h4 { color: var(--navy); font-size: 0.98rem; margin: 10px 0 2px; font-weight: 600; }
.member-card .role { color: var(--text-muted); font-size: 0.82rem; }

/* 真实照片填充与履历时间线 */
.person-photo { padding: 0; overflow: hidden; }
.person-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.pi-card .person-photo:hover img { transform: scale(1.03); }
.modal-role { color: var(--text-muted); font-size: 0.95rem; margin: -6px 0 10px; }
.cv { list-style: none; margin: 12px 0 0; font-size: 0.9rem; color: var(--text-muted); }
.cv li { padding: 3px 0 3px 18px; position: relative; }
.cv li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 7px; height: 2px; background: var(--navy);
}

/* ---------- 联系页 ---------- */
.contact-card {
  background: #fff; color: #222;
  border: 1px solid var(--border); border-radius: 2px;
  padding: 34px 38px; max-width: 900px; margin-bottom: 34px;
}
.contact-card h3 { font-size: 1.15rem; margin-bottom: 18px; color: var(--navy); }
.contact-card p { margin-bottom: 4px; color: #333; }
.contact-card .gap { height: 16px; }
.contact-card a { color: var(--accent, #1a5fb4); }
.location-banner {
  background: var(--bg-gray); padding: 18px 24px; max-width: 900px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; color: #1d2b3a; text-decoration: none;
}
.location-banner:hover { background: #eceef0; text-decoration: none; }
.location-banner .arrow { color: var(--navy); font-size: 1.2rem; }

/* ---------- 页脚 ---------- */
.site-footer { background: #6f291a; color: rgba(255,255,255,0.8); margin-top: 40px; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 30px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: rgba(255,255,255,0.85); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .main-nav {
    display: none; margin-top: 12px;
    flex-direction: column; gap: 0;
    border-top: 1px solid var(--border);
  }
  .main-nav.open { display: flex; }
  .main-nav a { border-bottom: 1px solid var(--border); padding: 12px 8px; }
  .main-nav a.active { border-bottom: 1px solid var(--border); background: #f2f6fb; }
  .nav-toggle { display: inline-block; }
  .thumb-row { grid-template-columns: repeat(2, 1fr); }
  .news-row, .person-card { grid-template-columns: 1fr; }
  .person-photo, .news-thumb { width: 100%; max-width: 300px; }
  .hero-slides { aspect-ratio: 16 / 10; }
}

/* ===== PI 详细简历弹窗（仅中文版 People 页使用） ===== */
.pi-card .person-photo, .pi-card h3 { cursor: pointer; }
.pi-card h3:hover { text-decoration: underline; text-underline-offset: 4px; }
.pi-more { margin-top: 10px; }
.pi-more span { color: var(--accent, #1a5fb4); font-size: 0.9rem; cursor: pointer; }
.pi-more span:hover { text-decoration: underline; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5, 32, 73, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  position: relative; background: #fff; color: #222;
  max-width: 720px; width: 100%; border-radius: 8px;
  padding: 28px 32px 32px; box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.modal-box h2 { color: var(--navy, #052049); font-size: 1.35rem; margin: 0 40px 14px 0; }
.modal-box h3 { color: var(--navy, #052049); font-size: 1.05rem; margin: 18px 0 8px; }
.modal-box .modal-body p { font-size: 0.95rem; line-height: 1.75; margin: 0 0 8px; }
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 1.8rem; line-height: 1;
  color: #888; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: #052049; }
.plain-list { margin: 0 0 8px 1.2em; padding: 0; }
.plain-list li { font-size: 0.95rem; line-height: 1.8; }

/* ===== People 页纵向成员列表（Knight Lab 式） ===== */
.people-list { max-width: 900px; margin: 6px 0 10px; }
.p-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 26px;
  padding: 22px 0; align-items: start;
}
.p-photo {
  width: 150px; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 2px; background: #fff; display: block;
}
.p-row h4 { color: var(--navy); font-size: 1.05rem; margin: 2px 0 3px; font-weight: 600; }
.p-row .p-role { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 8px; }
.p-row .p-desc { color: #444; font-size: 0.93rem; line-height: 1.65; margin: 0; max-width: 620px; }
@media (max-width: 560px) {
  .p-row { grid-template-columns: 110px 1fr; gap: 16px; }
  .p-photo { width: 110px; }
}

/* ===== Google Scholar 完整文献链接 ===== */
.scholar-link {
  color: var(--accent, #1a5fb4); font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
}
.scholar-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ===== 首页主题句 Zzz 手绘风装饰 ===== */
.zzz-art { position: relative; display: inline-block; width: 130px; height: 0; vertical-align: baseline; }
.zzz-art svg { position: absolute; left: 0; bottom: 16px; width: 130px; height: 105px; }
.zzz-art .z { animation: zzz-float 3.2s ease-in-out infinite; }
.zzz-art .z2 { animation-delay: 1.05s; }
.zzz-art .z3 { animation-delay: 2.1s; }
@keyframes zzz-float {
  0% { opacity: 0; transform: translate(-5px, 7px); }
  18% { opacity: 1; }
  70% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(12px, -12px); }
}
@media (prefers-reduced-motion: reduce) {
  .zzz-art .z { animation: none; }
}

/* 研究方向占位格（暂不放图） */
.thumb-empty { background: #f5f7fa; }
