/* ============================================================
   张净秋个人学术网站 — 主样式表
   风格：简约学术，参考日式学术网站，现代化改良
   ============================================================ */

/* === 基础重置 & 变量 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary:    #2c5282;   /* 深蓝 — 主色调 */
  --color-accent:     #744210;   /* 棕金 — 点缀色（传统学术气质） */
  --color-bg:         #faf9f7;   /* 米白底色 */
  --color-bg-card:    #ffffff;
  --color-border:     #d6cfc4;
  --color-text:       #2d2d2d;
  --color-text-light: #666;
  --color-text-muted: #6f6f6f;
  --color-nav-bg:     #1a365d;   /* 导航深蓝 */
  --color-nav-hover:  #2a4a7f;
  --color-header-bg:  #eef2f7;

  --font-sans: 'Noto Sans SC', 'Source Han Sans CN', '思源黑体', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Noto Serif SC', 'Source Han Serif CN', '思源宋体', 'SimSun', serif;

  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --transition: 0.2s ease;

  --sidebar-w: 220px;
  --max-content: 900px;
}

html {
  scroll-behavior: smooth;
  /* 始终预留滚动条空间，防止页面内容左右偏移 */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent); text-decoration: underline; }

/* === 可访问性：键盘焦点可见（WCAG 2.4.7） === */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.main-nav a:focus-visible,
.site-header button:focus-visible,
.music-player button:focus-visible,
.nav-toggle:focus-visible {
  outline-color: #ffd76a;
}
/* 鼠标点击不显示焦点环，仅键盘导航时显示 */
:focus:not(:focus-visible) { outline: none; }

/* === 顶部 Header === */
.site-header {
  background: var(--color-nav-bg);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
  overflow: visible;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}

/* 站点品牌（左上角 site-title：中文姓名 + 英文名） */
.site-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding: 4px 0;
  transition: opacity 0.2s ease;
}
.site-title:hover { opacity: 0.85; }
.site-title:focus-visible {
  outline: 2px solid #ffd76a;
  outline-offset: 4px;
  border-radius: 2px;
}
.site-title span {
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 10px;
}

/* === 导航栏 === */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2px;
}

.main-nav a {
  display: block;
  padding: 8px 12px;
  color: rgba(255,255,255,0.88);
  font-size: 13.5px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--color-nav-hover);
  color: #fff;
  text-decoration: none;
}

/* 汉堡菜单（移动端） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* === 页面横幅 (非首页) === */
.page-banner {
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 28px 24px;
  flex-shrink: 0;
}
.page-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.page-banner h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-primary);
  font-weight: 600;
}
.page-banner-intro {
  margin: 8px 0 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.8;
}
.page-banner-intro:empty { display: none; }
/* === 纯文字简介（去掉背景与左侧蓝条，与下方内容背景一致） === */
.page-banner-intro--plain {
  background: transparent;
  border-left: none;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  color: var(--color-text-light);
}
/* 窄屏下横幅简介内边距收紧 */
@media (max-width: 600px) {
  .page-banner-intro { font-size: 13px; padding: 8px 10px; }
}

/* === 首页动态横幅 === */
.home-news {
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 24px 0 28px;
}
.home-news-inner {
  margin: 0;
  padding-left: 24px;
  padding-right: 24px;
}
.home-news h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 14px 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.7;
}
.news-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 500;
  min-width: 88px;
}
.news-content { flex: 1; }
@media (max-width: 600px) {
  .news-item { flex-direction: column; gap: 4px; }
  .news-date { min-width: 0; }
}
.breadcrumb {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-primary); }

/* === 主布局容器 === */
.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  flex: 1 0 auto;
  width: 100%;
  scroll-margin-top: 72px;
}

.content-section {
  max-width: var(--max-content);
}

/* === 分区标题 === */
.section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
  margin: 36px 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-child { margin-top: 0; }
.section-title .icon { font-size: 16px; opacity: 0.8; }

.sub-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-accent);
  margin: 24px 0 10px;
}

/* === 卡片 === */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

/* === 个人简介卡片（首页） === */
.profile-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.profile-avatar {
  width: 120px;
  height: 150px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef2f7 0%, #d6e4f0 100%);
  border: 1px solid var(--color-border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
  position: relative;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-info h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.profile-info .en-name {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 16px;
}
.profile-meta-item {
  font-size: 13.5px;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-meta-item strong {
  color: var(--color-text);
  font-weight: 500;
}
.profile-bio {
  font-size: 14px;
  line-height: 1.9;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-top: 10px;
}

/* === 首页模块导航格 === */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.module-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.module-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  text-decoration: none;
}
.module-card .module-icon {
  font-size: 26px;
  line-height: 1;
}
.module-card .module-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  font-family: var(--font-serif);
}
.module-card .module-desc {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* === 时间轴（经历页） === */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-primary);
}
.timeline-period {
  font-size: 12.5px;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: 0.03em;
}
.timeline-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--color-text);
}
.timeline-sub {
  font-size: 13.5px;
  color: var(--color-text-light);
}
.timeline-body {
  font-size: 13.5px;
  color: var(--color-text-light);
  margin-top: 5px;
  line-height: 1.75;
}

/* === 论文/成果列表 === */
.pub-list {
  list-style: none;
}
.pub-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  line-height: 1.75;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.pub-item:last-child { border-bottom: none; }
/* activities 列表用：pub-num 是 .pub-item 的直接子元素，固定宽度 + 顶部对齐，
   否则 "2025.7" 这类带点的窄串在 Edge 下会与 pub-content 视觉重叠 */
.pub-num {
  flex: 0 0 56px;
  width: 56px;
  color: var(--color-text-muted);
  font-size: 12px;
  padding-top: 2px;
  text-align: right;
  white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  line-height: 1.75;
}
.pub-content { flex: 1 1 0; min-width: 0; }
.pub-title { color: var(--color-text); font-weight: 500; }
.pub-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.pub-meta .journal { color: var(--color-text-light); font-style: italic; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #eef2f7;
  color: #4a5568;
  border: 1px solid #d8dde6;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  min-width: 64px;
  text-align: center;
}
.badge--warn {
  background: #fff5e6;
  color: #b76d00;
  border-color: #f5c878;
}
.pub-tag {
  display: inline-block;
  background: var(--color-header-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}
.pub-tag.core {
  background: #ebf4f9;
  border-color: #90cdf4;
  color: #2b6cb0;
}

/* === 课题卡片 === */
.project-card {
  background: var(--color-bg-card);
  border-left: 3px solid var(--color-primary);
  padding: 14px 18px;
  margin-bottom: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
}
.project-card.national { border-left-color: #c53030; }
.project-card.provincial { border-left-color: var(--color-accent); }
.project-name { font-weight: 600; font-size: 14.5px; color: var(--color-text); }
.project-meta { font-size: 12.5px; color: var(--color-text-muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.project-meta span { display: flex; align-items: center; gap: 4px; }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0;
}
.data-table th {
  background: var(--color-header-bg);
  color: var(--color-primary);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f7f5f2; }

/* === 联系信息 === */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.contact-list .ci-label {
  font-weight: 500;
  color: var(--color-text);
  min-width: 70px;
  flex-shrink: 0;
}
.contact-list .ci-value { color: var(--color-text-light); }

/* === 页脚 === */
.site-footer {
  background: var(--color-nav-bg);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px 24px;
  font-size: 12.5px;
  margin-top: auto;
  flex-shrink: 0;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }

/* === 工具类 === */
.mt-0 { margin-top: 0; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 13px; }
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 28px 0;
}

/* === 成果 / 课题：列表—详情 模式 === */
/* 分类切换 tab */
.pub-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pub-tab {
  display: inline-flex; align-items: center;
  padding: 9px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px);
  background: var(--color-bg-card);
  color: var(--color-text-light);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition, 150ms ease);
}
.pub-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pub-tab.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* 题录列表项（整行可点击） */
.pub-list { list-style: none; margin: 0; padding: 4px 0; }
.pub-item { border-bottom: 1px solid var(--color-border); }
.pub-item:last-child { border-bottom: none; }
.pub-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px;
  text-decoration: none; color: inherit;
  transition: background var(--transition, 150ms ease);
  min-height: 44px;
}
.pub-link:hover { background: var(--color-header-bg); }
.pub-link:hover .pub-title { color: var(--color-primary); text-decoration: underline; }
.pub-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.pub-num {
  flex: 0 0 auto; width: 28px; text-align: right;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px; color: var(--color-text-muted);
  white-space: nowrap;
}
.pub-content { flex: 1 1 auto; min-width: 0; }
.pub-title { display: block; font-size: 15px; font-weight: 500; color: var(--color-text); line-height: 1.5; }
.pub-meta { display: block; margin-top: 3px; font-size: 13px; color: var(--color-text-muted); }
.pub-venue { font-style: italic; color: var(--color-text-light); }
.pub-year { margin-left: 10px; font-size: 0.85em; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--color-text-light); }
.pub-authors { font-style: normal; color: var(--color-text); font-weight: 500; margin-right: 8px; }
.pub-arrow { flex: 0 0 auto; font-size: 20px; color: var(--color-text-muted); }
.pub-link:hover .pub-arrow { color: var(--color-primary); }
.empty { padding: 24px 12px; color: var(--color-text-muted); }

/* 分页器 */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px);
  background: var(--color-bg-card);
  color: var(--color-text-light);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all var(--transition, 150ms ease);
}
.page-btn:hover:not(.disabled):not(.active) { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; cursor: default; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { color: var(--color-text-muted); padding: 0 4px; }
.page-info { margin-left: 10px; font-size: 13px; color: var(--color-text-muted); }

/* 返回链接 */
.back-link { display: inline-block; margin-bottom: 18px; font-size: 14px; color: var(--color-primary); text-decoration: none; }
.back-link:hover { color: var(--color-accent); text-decoration: underline; }

/* 详情卡片 */
.detail-card { padding: 28px 28px 32px; }
.detail-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px; font-weight: 700; color: var(--color-text);
  line-height: 1.45; margin-bottom: 18px;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-bottom: 18px; border-bottom: 1px solid var(--color-border); }
.dm { font-size: 14px; }
.dm-k { color: var(--color-text-muted); margin-right: 6px; }
.dm-v { color: var(--color-text); font-weight: 600; }
.detail-actions { margin: 20px 0; }
.btn-pdf {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: var(--color-nav-bg); color: #fff;
  border-radius: var(--radius, 6px); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: opacity var(--transition, 150ms ease);
}
.btn-pdf:hover { opacity: 0.85; }
.detail-photo { margin: 20px 0; }
.detail-photo img { max-width: 100%; border-radius: var(--radius, 6px); border: 1px solid var(--color-border); }
.detail-desc { margin-top: 22px; }
.detail-subtitle {
  font-size: 16px; color: var(--color-primary); font-weight: 600;
  margin-bottom: 10px; border-left: 3px solid var(--color-primary); padding-left: 10px;
}
.detail-desc p { font-size: 15px; line-height: 1.9; color: var(--color-text); white-space: pre-wrap; word-break: break-all; }

/* 上一条 / 下一条 */
.pn-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.pn {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px); background: var(--color-bg-card); text-decoration: none;
  transition: all var(--transition, 150ms ease);
}
.pn:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.pn-prev { text-align: left; }
.pn-next { text-align: right; align-items: flex-end; }
.pn-label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; letter-spacing: 0.5px; }
.pn-title { font-size: 14.5px; color: var(--color-text); font-weight: 500; line-height: 1.5; }
.pn:hover .pn-title { color: var(--color-primary); }
.pn-empty { visibility: hidden; }

/* 课题列表导语 */
.projects-intro { font-size: 14.5px; color: var(--color-text-light); line-height: 2; margin-bottom: 28px; }

/* 窄屏：上下条改单列 */
@media (max-width: 600px) {
  .pn-wrap { grid-template-columns: 1fr; }
  .detail-card { padding: 20px 16px 24px; }
  .detail-title { font-size: 20px; }
}

/* === 可访问性：跳转链接（键盘/读屏用户跳过导航） === */
.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -60px;
  background: var(--color-nav-bg);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  z-index: 1000;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* === 可访问性：尊重「减少动效」系统偏好（WCAG 2.3.3） === */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }
  .site-title { font-size: 16px; padding-bottom: 0; border-bottom: none; margin-bottom: 0; flex: 1; min-width: 0; }
  .site-title span { font-size: 11px; display: block; margin-left: 0; margin-top: 2px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-nav-bg);
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 200;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { border-radius: 0; padding: 12px 24px; }

  .nav-toggle { display: flex; }

  .profile-card { flex-direction: column; gap: 20px; padding: 20px; }
  .profile-avatar { width: 90px; height: 112px; }

  .module-grid { grid-template-columns: repeat(2, 1fr); }

  .page-main { padding: 20px 16px 40px; }
}

@media (max-width: 480px) {
  .module-grid { grid-template-columns: 1fr; }
  .site-title span { display: none; }
}


/* === PDF下载链接 === */
.pub-download {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 10px;
  background: var(--color-nav-bg);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.pub-download:hover { opacity: 0.8; }

/* === 时间线照片 === */
.timeline-photo {
  margin-top: 10px;
}
.timeline-photo img {
  max-width: 240px;
  max-height: 160px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}
.timeline-photo img:hover {
  transform: scale(1.03);
}

/* === 项目照片 === */
.project-photo {
  margin-top: 10px;
}
.project-photo img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}
.project-photo img:hover {
  transform: scale(1.02);
}

/* === 视频链接 === */
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.video-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.video-title {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}
.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a2d5c 0%, #4a6fa5 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* === 缩略图 + 播放按钮 === */
.video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  display: block;
  text-align: left;
  color: inherit;
}
.video-poster:focus-visible {
  outline: 3px solid #ffd76a;
  outline-offset: -3px;
}
.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}
.video-poster:hover .video-thumb {
  transform: scale(1.04);
  filter: brightness(0.85);
}
.video-poster.thumb-failed .video-thumb { display: none; }

/* 占位（无缩略图时） */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
}
.video-placeholder-label {
  font-size: 13px;
  letter-spacing: 0.5px;
  opacity: 0.92;
  font-weight: 500;
}
.video-placeholder svg { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3)); }

/* 中心播放按钮 */
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}
.video-poster:hover .video-play,
.video-poster:focus-visible .video-play {
  transform: translate(-50%, -50%) scale(1.08);
}

/* 平台角标 */
.video-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 4px;
  line-height: 1.4;
  pointer-events: none;
}
.video-card[data-platform="youtube"] .video-badge { background: rgba(220, 30, 30, 0.85); }
.video-card[data-platform="bilibili"] .video-badge { background: rgba(233, 99, 132, 0.85); }
.video-card[data-platform="vimeo"] .video-badge { background: rgba(26, 188, 222, 0.85); }
.video-card[data-platform="direct"] .video-badge { background: rgba(40, 120, 220, 0.85); }

/* 外链 fallback（无嵌入） */
.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  padding: 16px;
  text-align: center;
  transition: background 0.2s ease;
}
.video-fallback-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.video-fallback-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.video-fallback:hover .video-fallback-icon {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.video-fallback-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.video-thumb-favicon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  padding: 2px;
  inset: auto 8px 8px auto;
}
.video-fallback:hover { background: linear-gradient(135deg, #1a2d5c 0%, #4a6fa5 100%); }

@media (max-width: 600px) {
  .video-list { grid-template-columns: 1fr; }
  .video-play svg { width: 30px; height: 30px; }
  .video-placeholder svg { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .video-card:hover { transform: none; }
  .video-poster:hover .video-thumb { transform: none; }
  .video-poster:hover .video-play,
  .video-poster:focus-visible .video-play { transform: translate(-50%, -50%); }
  .video-fallback:hover .video-fallback-icon { transform: none; }
}

/* === 活动照片 === */
.activity-photo {
  margin-top: 8px;
}
.activity-photo img {
  max-width: 200px;
  max-height: 140px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}
.activity-photo img:hover {
  transform: scale(1.03);
}

/* === 学术活动：多图画廊 + 水印（水印文字取后台设置） === */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
  max-width: 640px;
}
.photo-item {
  position: relative;
  border-radius: var(--radius, 6px);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #f3f1ec;
  aspect-ratio: 4 / 3;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.photo-item:hover img { transform: scale(1.04); }
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}
.ext-link:hover { text-decoration: underline; }

/* === 教学照片（列表模式） === */
.teaching-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* === 页面背景 === */
body.has-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body.has-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.55);
  z-index: -1;
}

/* === 背景音乐播放器 === */
.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 24px;
  padding: 6px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  font-size: 13px;
  color: var(--color-text);
}
.music-player button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  transition: background 0.2s;
}
.music-player button:hover {
  background: #f0f0f0;
}
.music-player .now-playing {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   全局长内容溢出防护基线  (Overflow Guard Baseline)
   ───────────────────────────────────────────────────────────────
   目标：任何用户录入的超长无空格字符串（连续字符、长 URL、
        长英文单词、无标点长串）都不得撑破容器或横向溢出页面。

   技术要点（关键区别，别写错）：
   · overflow-wrap: break-word  → 仅在整行放不下时断词。
                                  【不参与】min-content 尺寸计算，
                                  所以在 flex / grid / table 里
                                  仍会被撑破，只能当安全默认值。
   · overflow-wrap: anywhere    → 断点【参与】min-content 计算，
                                  是 flex / grid / table 场景下
                                  唯一真正有效的解法。
   分层：L1 全局默认 → L2 弹性容器 → L3 高危文本 →
        L4 表格 → L5 长链接 → L6 媒体 → L7 页面兜底
   ═══════════════════════════════════════════════════════════════ */

/* ── L1 全局文本断行默认值 ──
   安全档：对正常中文、带空格英文的排版零影响，
   只有遇到「一整行都放不下的超长单串」时才介入断行。 */
body, p, h1, h2, h3, h4, h5, h6,
li, dd, dt, td, th, caption,
span, div, a, label, summary,
blockquote, figcaption, strong, em {
  overflow-wrap: break-word;
}

/* ── L2 弹性 / 网格子项最小宽度修复 ──
   flex 与 grid 子项默认 min-width:auto（= 内容最小宽度），
   意味着「内容多宽，子项就至少多宽」，这是长串撑破布局的
   头号根因。归零后子项才允许被压缩到容器内。 */
.header-inner > *,
.profile-card > *,
.profile-info,
.profile-meta,
.profile-meta-item,
.contact-list li,
.contact-list .ci-value,
.module-card,
.module-card > *,
.timeline-item,
.pub-link > *,
.pub-content,
.detail-meta > *,
.dm,
.pn,
.pn > *,
.video-card,
.video-list > * {
  min-width: 0;
}

/* ── L3 高危自由文本区 ──
   这些容器直接渲染后台录入的内容，长度完全不可控，
   一律用 anywhere 彻底断死，杜绝任何撑破可能。 */
.site-title,
.page-banner h1,
.breadcrumb,
.section-title,
.sub-title,
.profile-info h2,
.profile-info .en-name,
.profile-meta-item,
.profile-bio,
.module-card .module-label,
.module-card .module-desc,
.timeline-period,
.timeline-title,
.timeline-sub,
.timeline-body,
.pub-title,
.pub-meta,
.pub-venue,
.pub-tag,
.project-name,
.project-meta,
.project-meta span,
.contact-list .ci-value,
.detail-title,
.detail-subtitle,
.detail-desc p,
.dm, .dm-k, .dm-v,
.pn-title,
.projects-intro,
.video-title,
.empty,
.card p,
.content-section p,
.site-footer p {
  overflow-wrap: anywhere;
  word-break: break-word; /* 老版 Safari / 旧内核兜底 */
}

/* ── L3.5 pre-wrap 容器专杀 ──
   white-space: pre-wrap 会在「没有空白字符的连续长串」上
   拒绝断行（L3 的 overflow-wrap: anywhere 不足以压制），
   必须叠 word-break: break-all 才能让无空格连续长串
   乖乖换行。覆盖所有内联 pre-wrap 的容器（兜底，
   当前已知的 .detail-desc p 已在 632 行自带）。 */
.detail-desc p,
*[style*="white-space: pre-wrap"] {
  word-break: break-all;
}

/* ── L4 表格保护 ──
   表格列宽默认按内容撑开，是最容易横向溢出的结构。
   给单元格 anywhere 后，浏览器的 auto 布局算法会认为
   内容可断行，从而把列宽压回容器宽度内。 */
.data-table {
  width: 100%;
  max-width: 100%;
}
.data-table th,
.data-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── L5 长链接 / 邮箱地址 ──
   URL 与邮箱天生无空格，是最典型的溢出源。 */
a[href^="http"],
a[href^="mailto:"],
.site-footer a,
.ci-value a,
.video-fallback a,
.detail-desc a {
  overflow-wrap: anywhere;
}

/* ── L6 媒体与嵌入元素不超框 ── */
img, video, iframe, embed, object, table {
  max-width: 100%;
}
img, video {
  height: auto;
}

/* ── L7 容器宽度兜底 ──
   给主要布局容器锁死宽度上限，防止子元素把父容器顶宽。
   ⚠️ 刻意【不用】 html/body { overflow-x: hidden }：
      该写法会把 body 变成滚动容器，导致本站吸顶导航
      .site-header{position:sticky} 失效，属得不偿失。
      改为纯尺寸约束，零副作用。 */
.page-main,
.content-section,
.card,
.profile-card,
.detail-card,
.timeline,
.timeline-item,
.pub-list,
.pub-item,
.module-grid,
.pn-wrap,
.header-inner,
.page-banner-inner {
  max-width: 100%;
  box-sizing: border-box;
}

/* ── L8 收缩自适应（shrink-to-fit）元素防护 ──
   L1~L7 的盲区。以下三类元素的宽度按 max-content 计算，
   `overflow-wrap: break-word` 对它们【完全无效】，必须显式加
   `max-width` 上限，并用 `anywhere` 让断点参与 min-content 计算：
     ① display:inline-block   ② display:inline-flex   ③ position:absolute
   2026-08-05 全站注入压测实测撑破的元素，全部归属这三类。 */

/* ① inline-block / inline-flex 文本承载元素 */
.back-link,
.pub-tab,
.btn-pdf,
.page-btn,
.page-info,
.detail-subtitle,
.module-label,
.module-desc,
.pub-tag,
.section-title,
.timeline-period {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ①-b 装饰性定宽 flex 项（flex:0 0 auto ⇒ 永不收缩）。
       内容虽为硬编码字形，仍加硬上限，彻底关闭「不收缩项被内容撑宽」这一风险类别。 */
.pub-arrow,
.module-icon,
.section-title .icon {
  max-width: 2em;
  overflow: hidden;
  white-space: nowrap;
}

/* ② 绝对定位徽标 / 覆盖层：无宽度上限时会无限外扩 */
.video-badge {
  max-width: calc(100% - 16px);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.video-fallback-inner,
.video-fallback-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ③ 内联样式写的 flex 容器（模板里零散存在）——统一给直接子项归零最小宽度。
      属性选择器同时覆盖 `display:flex` 与 `display: flex` 两种写法。 */
[style*="display:flex"] > *,
[style*="display: flex"] > *,
[style*="display:grid"] > *,
[style*="display: grid"] > * {
  min-width: 0;
}

/* ── 教育教学：课程清单行（原为内联 flex，长课程名会撑破卡片）── */
.teach-list {
  font-size: 14.5px;
  line-height: 2.2;
  color: var(--color-text);
  padding-left: 20px;
  max-width: 100%;
}
.teach-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 100%;
}
.teach-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.teach-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}
