html, body { overflow-x: clip; }
/* ========== 全局变量 ========== */
:root {
  --bg-page: #f0f2f5;
  --bg-panel: #ffffff;
  --bg-graph: #fafbfc;
  --border: #e2e6ea;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --accent: #4361ee;
  --accent-light: #eef2ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

/* ========== Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}
/* 图谱页面锁定滚动（全屏画布布局专用） */
body.graph-page { overflow: hidden; }

/* ========== 顶部栏 ========== */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  gap: 24px;
}
.header-left { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; }
.header-home {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.2s;
}
.header-home:hover { background: rgba(255, 255, 255, 0.06); }
.header-home:hover h1 { text-decoration: underline; }
.header-left h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.header-left .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.header-center { flex: 1; display: flex; justify-content: center; max-width: 500px; }
.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.search-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 40px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}
.search-box input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-status {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e3e9f2;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(22, 33, 62, .14);
  font-size: 13px;
  text-align: center;
  color: var(--text-primary);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all .18s ease;
  pointer-events: none; /* 状态条不拦截点击 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* 超长输入截断，防状态条撑破布局 */
}
.search-status.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.search-status.no-result {
  color: #c0392b;
}
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: 16px; }
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 30px;
  background: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.header-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.header-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.header-link.active {
  background: var(--accent);
  color: #fff;
}
.stats { display: flex; gap: 16px; }
.stat-item {
  font-size: 13px;
  color: var(--text-secondary);
}
.stat-item b {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  margin-left: 4px;
}

/* ========== 主区域 ========== */
#main {
  display: flex;
  height: calc(100% - 64px);
}

/* ========== 左侧面板 ========== */
#sidebar-left {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
}
.panel-section {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.panel-section:last-child { border-bottom: none; margin-bottom: 0; }
.panel-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.filter-list { display: flex; flex-direction: column; gap: 6px; }
.select-all-item {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.select-all-item .filter-label {
  font-weight: 600;
  letter-spacing: 0.5px;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 13px;
  user-select: none;
}
.filter-item:hover { background: var(--bg-page); }
.filter-item.disabled { opacity: 0.35; }
.filter-item .color-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.filter-item .line-sample {
  width: 24px;
  height: 0;
  flex-shrink: 0;
  border-top-width: 2px;
  border-top-style: solid;
}
.filter-item .filter-label { flex: 1; }
.filter-item .filter-count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.filter-item .selected-count {
  color: var(--accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.filter-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.tip-list {
  list-style: none;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.tip-list li {
  padding-left: 14px;
  position: relative;
}
.tip-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ========== 画布区域 ========== */
#graph-container {
  flex: 1;
  position: relative;
  background: var(--bg-graph);
  overflow: hidden;
}
#graph-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#graph-svg:active { cursor: grabbing; }

/* ========== 加载提示 ========== */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* ========== 右侧详情面板 ========== */
#sidebar-right {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}
.detail-panel { padding: 0; }
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.detail-empty-icon {
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.5;
}
.detail-empty p { font-size: 14px; margin-bottom: 4px; }
.detail-empty-sub { font-size: 12px !important; opacity: 0.7; }

/* 详情面板内容 */
.detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.detail-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.detail-institution {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-body { padding: 20px; }
.detail-full-btn-wrap { padding: 14px 20px 20px; border-top: 1px solid var(--border, #e5e9f2); }
.detail-full-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: var(--accent, #1d3557);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.detail-full-btn:hover {
  background: var(--accent-dark, #14264a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.25);
}
.detail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-row:last-child { margin-bottom: 0; }
.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 70px;
  flex-shrink: 0;
  padding-top: 2px;
}
.detail-value {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  font-size: 12px;
}
.connection-list { display: flex; flex-direction: column; gap: 8px; }
.connection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  cursor: pointer;
  transition: background 0.15s ease;
}
.connection-item:hover { background: var(--accent-light); }
.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connection-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.connection-type {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.04);
}

/* ========== SVG 节点样式 ========== */
.node {
  cursor: pointer;
}
.node circle {
  stroke: #fff;
  stroke-width: 2.5px;
  transition: stroke-width 0.2s ease, filter 0.2s ease;
}
.node:hover circle {
  stroke-width: 4px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}
.node.selected circle {
  stroke: var(--accent);
  stroke-width: 4px;
  filter: drop-shadow(0 2px 8px rgba(67,97,238,0.4));
}
.node.dimmed { opacity: 0.2; }
.node.highlighted circle {
  stroke-width: 3.5px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.node text {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  fill: var(--text-primary);
  pointer-events: none;
  user-select: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.85);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.node text.hidden { display: none; }
.link {
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}
.link.dimmed { opacity: 0.06; }
.link.highlighted { opacity: 1 !important; stroke-width: 3px !important; }
.link-label {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: var(--text-secondary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.link-label.visible { opacity: 0.8; }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d4d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b6bc; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  #sidebar-left { width: 260px; }
  #sidebar-right { width: 280px; }
}
@media (max-width: 900px) {
  /* 窄窗口（如 ~820px）下 260+280 两个面板会把画布挤到只剩约 280px，图谱被压成一条；
     折叠左侧面板、右侧改为悬浮，把整宽让给图谱，让布局真正适配窗口 */
  #sidebar-left { display: none; }
  #sidebar-right { width: 100%; max-width: 320px; position: absolute; right: 0; top: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
}
@media (max-width: 768px) {
  #header { height: auto; flex-wrap: wrap; padding: 12px; gap: 12px; }
  .header-left { width: 100%; }
  .header-center { width: 100%; max-width: none; }
  .header-right { width: 100%; justify-content: center; }
}

/* ========== 导航下拉（构建方法 / 数据来源） ========== */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 214px;
  z-index: 200;
  background: #fff;
  border: 1px solid #e3e9f2;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(22, 33, 62, .18);
  padding: 6px;

/* 展开动画（display:none 后保持开合观感） */
@keyframes dd-fade {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

  display: none;
}
/* 顶部小三角 */
.nav-dropdown-menu::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  margin-left: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e3e9f2;
  border-top: 1px solid #e3e9f2;
  transform: rotate(45deg);
  border-radius: 2px;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
  animation: dd-fade .16s ease;
}

@media (max-width: 640px) {
  .nav-dropdown.open .nav-dropdown-menu {
    left: auto;
    right: 8px;
    transform: translateY(0);
  }
}
.dd-caret {
  font-size: 10px;
  margin-left: 3px;
  opacity: .75;
  transition: transform .2s ease;
}
.nav-dropdown:hover .dd-caret,
.nav-dropdown.open .dd-caret {
  transform: rotate(180deg);
}
.nav-dropdown-menu .dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: transparent;
  border: 0;
  color: #16213e;
  text-decoration: none;
  transition: background .15s;
}
.nav-dropdown-menu .dd-item:hover,
.nav-dropdown-menu .dd-item.active {
  background: #eef2ff;
}
.nav-dropdown-menu .dd-ico {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f4fb;
  color: #4361ee;
  transition: background .15s;
}
.nav-dropdown-menu .dd-item:hover .dd-ico,
.nav-dropdown-menu .dd-item.active .dd-ico {
  background: #dde6ff;
}
.nav-dropdown-menu .dd-body {
  flex: 1;
  min-width: 0;
}
.nav-dropdown-menu .dd-group-title {
  padding: 9px 12px 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9aa3b2;
}
.nav-dropdown-menu .dd-title {
  display: block;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: #16213e;
  line-height: 1.3;
}
.nav-dropdown-menu .dd-item:hover .dd-title,
.nav-dropdown-menu .dd-item.active .dd-title {
  color: #4361ee;
}
.nav-dropdown-menu .dd-desc {
  display: block;
  white-space: nowrap;
  font-size: 11.5px;
  color: #7a8494;
  margin-top: 2px;
  line-height: 1.4;
}

/* ========== 泰斗专区下拉（专属美化） ========== */
.nav-dropdown.lingyu-dropdown .nav-dropdown-menu {
  width: 272px;
  padding: 8px;
  border: 1px solid #e6e1fb;
  border-radius: 16px;
  background: #fdfdfe;
  box-shadow: 0 24px 56px rgba(67, 97, 238, .16), 0 4px 14px rgba(22, 33, 62, .08);
}
/* 顶部小三角呼应渐变主色 */
.nav-dropdown.lingyu-dropdown .nav-dropdown-menu::after {
  background: #5f51e0;
  border-left-color: #5f51e0;
  border-top-color: #5f51e0;
}
/* 标题头：紫色渐变卡片 */
.nav-dropdown.lingyu-dropdown .dd-hero {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(120deg, #4361ee 0%, #7a5cff 100%);
  color: #fff;
  margin-bottom: 4px;
}
.nav-dropdown.lingyu-dropdown .dd-hero-ico {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-dropdown.lingyu-dropdown .dd-hero-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
}
.nav-dropdown.lingyu-dropdown .dd-hero-sub {
  display: block;
  font-size: 11px;
  opacity: .88;
  margin-top: 2px;
  letter-spacing: .5px;
}
/* 分组标题：小圆点 + 疏排大写 */
.nav-dropdown.lingyu-dropdown .dd-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #8a86b8;
}
.nav-dropdown.lingyu-dropdown .dd-group-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(122, 92, 255, .12);
}
/* 菜单项：更圆润、略大图标 */
.nav-dropdown.lingyu-dropdown .dd-item {
  padding: 9px 12px;
  border-radius: 11px;
  margin-top: 2px;
}
.nav-dropdown.lingyu-dropdown .dd-item .dd-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
/* 成长轨迹组：紫色系 */
.nav-dropdown.lingyu-dropdown .dd-item.traj .dd-ico {
  background: #f0f0ff;
  color: #6a4cf0;
}
.nav-dropdown.lingyu-dropdown .dd-item.traj:hover {
  background: #f3f0ff;
}
.nav-dropdown.lingyu-dropdown .dd-item.traj:hover .dd-ico {
  background: #e3dbff;
}
/* 合作网络组：蓝色系 */
.nav-dropdown.lingyu-dropdown .dd-item.net .dd-ico {
  background: #eef4ff;
  color: #2f6fe0;
}
.nav-dropdown.lingyu-dropdown .dd-item.net:hover {
  background: #eef4ff;
}
.nav-dropdown.lingyu-dropdown .dd-item.net:hover .dd-ico {
  background: #dbe9ff;
}
/* 底部入口 */
.nav-dropdown.lingyu-dropdown .dd-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 11px;
  background: #f4f2ff;
  color: #5f51e0;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.nav-dropdown.lingyu-dropdown .dd-footer:hover {
  background: #e9e5ff;
}

/* ========== 全站统一导航胶囊（内容页 .nav-links，样式统一自 style.css） ========== */
.nav-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.nav-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.nav-links a svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .nav-links { gap: 10px; margin-top: 18px; }
  .nav-links a { padding: 8px 14px; font-size: 12px; }
}

/* 当前页高亮 */
.nav-links a.active {
  background: #ffffff;
  color: #1d3557;
  border-color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.nav-links a.active svg { color: #4361ee; }

/* 详情页精简条内导航无 h1，不走统一 24px 上边距 */
.page-header-slim .nav-links { margin-top: 0; }

/* ========== 泰斗专题次级导航（成长轨迹 / 著作 / 随笔页 header 内第二行） ========== */
.titan-subnav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.titan-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}
.titan-subnav a:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}
.titan-subnav a.active {
  background: #ffffff;
  color: #1d3557;
  border-color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* ========== 全站统一页脚 ========== */
.page-footer {
  margin-top: 48px;
  padding: 30px 24px 36px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.page-footer .footer-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.page-footer .footer-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.page-footer .footer-nav a:hover { text-decoration: underline; }
.page-footer .footer-contact { margin-top: -2px; }
.page-footer .footer-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.page-footer .footer-contact a:hover { text-decoration: underline; }
/* 数据来源行：上方一条与文字等宽的短分隔线，区分"态度声明/事实声明"两类信息 */
.page-footer .footer-source {
  display: inline-block;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 14px;
}
/* 版权行：比正文更淡，作为整页收尾 */
.page-footer .footer-brand {
  color: var(--text-muted);
}
/* 侵权/错误告知行：最弱化，作为页脚最末一行 */
.page-footer .footer-legal {
  font-size: 11.5px;
  color: #c2c8d4;
}


/* ========== 通用滚动章节导航（scroll-nav.js，对齐 scholars 机构导航） ========== */
.scroll-nav {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(-18px);
  width: 200px;
  max-height: min(62vh, 620px);
  background: var(--bg-panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
}
.scroll-nav.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
.scroll-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 8px;
}
.scroll-nav-backtop {
  background: none;
  border: none;
  cursor: pointer;
  color: #9aa3b2;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.2s ease;
}
.scroll-nav-backtop:hover { color: var(--accent); }
.scroll-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.scroll-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #4a4f5c;
  transition: background 0.18s ease, color 0.18s ease;
}
.scroll-nav-item:hover { background: #f5f7fa; color: var(--text-primary); }
.scroll-nav-item.active {
  background: var(--accent-light);
  color: var(--text-primary);
  font-weight: 600;
}
.scroll-nav-item .scroll-nav-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #c7cdd8;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.scroll-nav-item.active .scroll-nav-dot {
  background: var(--accent);
  transform: scale(1.25);
}
.scroll-nav-item .scroll-nav-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scroll-nav::-webkit-scrollbar { width: 6px; }
.scroll-nav::-webkit-scrollbar-thumb { background: #d6dbe3; border-radius: 3px; }
.scroll-nav::-webkit-scrollbar-thumb:hover { background: #bcc4d0; }
.scroll-nav::-webkit-scrollbar-track { background: transparent; }

/* 窄屏隐藏，避免遮挡正文（与 scholars 机构导航同断点） */
@media (max-width: 1280px) {
  .scroll-nav { display: none; }
}

/* ========== 通用返回条（全站内容页，对齐 scholar-detail 详情页样式） ========== */
.back-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e9f2;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.back-bar .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1d3557;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.back-bar .back-btn:hover { background: #eef2f8; }
.back-bar .crumb { color: #8a94a6; font-size: 13px; }
.back-bar .crumb-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.back-bar .crumb-sep { color: #c5ccd8; font-size: 12px; }
.back-bar a.crumb { color: #3b82f6; text-decoration: none; font-weight: 500; }
.back-bar a.crumb:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .back-bar { padding: 10px 16px; gap: 8px; }
}
/* 有返回条/吸顶条的页面：body 改为随内容伸展（修复 height:100% 下 sticky 失效） */
body:has(.back-bar), body:has(.detail-topbar) {
  height: auto;
  min-height: 100vh;
}
