/* 所有人物共用的到站气泡、紧凑播放面板与大号人物图标。 */
.panel-scholar {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.08);
}
.scholar-panel-desc {
  margin: -2px 0 10px;
  color: var(--ink-light);
  font-size: 12px;
  line-height: 1.55;
}
.panel-scholar[data-player-phase="arrived"],
.panel-scholar[data-player-phase="origin"] {
  border-color: #7dd3fc;
}
.panel-scholar[data-player-phase="arrived"] .scholar-status,
.panel-scholar[data-player-phase="origin"] .scholar-status {
  color: #075985;
  background: #e0f2fe;
}
/* 行为卡片已移至地图气泡，左栏不再占用对应空间。 */
.panel-scholar .scholar-events { display: none !important; }

/* Leaflet 到站气泡：默认位于人物右侧，边缘空间不足时由脚本改到左侧。 */
.leaflet-tooltip.scholar-arrival-bubble {
  width: var(--scholar-bubble-width, min(360px, 34vw));
  max-width: var(--scholar-bubble-width, min(360px, 34vw));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(15, 118, 110, 0.12);
  pointer-events: auto;
  white-space: normal;
  opacity: 1;
  transition: opacity 0.32s ease;
}
.leaflet-tooltip-right.scholar-arrival-bubble::before { border-right-color: rgba(255, 255, 255, 0.97); }
.leaflet-tooltip-left.scholar-arrival-bubble::before { border-left-color: rgba(255, 255, 255, 0.97); }
.leaflet-tooltip.scholar-arrival-bubble.is-hovered {
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.3), 0 0 0 2px rgba(20, 184, 166, 0.32);
}
.leaflet-tooltip.scholar-arrival-bubble.is-leaving {
  opacity: 0 !important;
  pointer-events: auto;
}
.leaflet-tooltip.scholar-arrival-bubble.is-leaving .scholar-bubble-content {
  transform: translateY(-7px) scale(0.96);
  filter: blur(2px);
}
@keyframes scholarBubbleIn {
  from { opacity: 0; transform: translateX(-18px) scale(0.94); filter: blur(3px); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}
.scholar-bubble-content {
  overflow: hidden;
  border-radius: 16px;
  animation: scholarBubbleIn 0.36s cubic-bezier(.2,.8,.2,1) both;
  transition: transform 0.32s ease, filter 0.32s ease;
}
.leaflet-tooltip-left .scholar-bubble-content { animation-name: scholarBubbleInLeft; }
@keyframes scholarBubbleInLeft {
  from { opacity: 0; transform: translateX(18px) scale(0.94); filter: blur(3px); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}
.scholar-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  color: #134e4a;
  background: linear-gradient(135deg, #ccfbf1, #ecfeff);
  border-bottom: 1px solid #99f6e4;
}
.scholar-bubble-header strong { font-size: 14px; line-height: 1.35; }
.scholar-bubble-header span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
}
.scholar-bubble-list {
  display: grid;
  gap: 0;
  max-height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #99f6e4 transparent;
}
.scholar-bubble-card { padding: 11px 14px 12px; }
.scholar-bubble-card + .scholar-bubble-card { border-top: 1px solid #e2e8f0; }
.scholar-bubble-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
}
.scholar-bubble-year { color: #c2410c; font-size: 11px; font-weight: 800; }
.scholar-bubble-place { color: var(--ink); font-size: 12px; font-weight: 700; }
.scholar-bubble-text {
  color: var(--ink-mid);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}
.scholar-bubble-contacts {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}
.scholar-bubble-contacts strong { margin-right: 7px; font-size: 11px; }
.scholar-bubble-empty { padding: 18px 14px; text-align: center; color: var(--ink-light); font-size: 12px; }
.scholar-bubble-hint {
  padding: 7px 14px 8px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 10px;
  text-align: right;
}
.scholar-bubble-media { margin: 10px 0 0; }
.scholar-bubble-media img {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.scholar-bubble-media figcaption { margin-top: 5px; color: var(--ink-light); font-size: 11px; }
.scholar-bubble-link {
  display: inline-flex;
  margin-top: 9px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.scholar-bubble-link:hover { text-decoration: underline; }

/* 全身人物统一放大；图标容器允许图片自然外溢，不遮断头脚。 */
.scholar-icon-wrap { overflow: visible !important; }
.leaflet-container img.scholar-walking-figure,
.scholar-avatar .scholar-walking-figure {
  width: 72px !important;
  height: 96px !important;
}
.scholar-avatar-ring,
.leaflet-container img.scholar-portrait,
.scholar-avatar .scholar-portrait {
  width: 78px !important;
  height: 78px !important;
}

@media (max-width: 900px) {
  .scholar-bubble-list { max-height: 220px; }
}
