/* ============ 首页：地图 + 年份 + 刻度尺 + 悬浮窗 ============ */
.home-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}

/* ---------- 顶部栏 ---------- */
.home-topbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: var(--z-top);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

/* 标题 + 展开后的统计卡，在同一容器内（标题下方） */
.home-brand-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* 统计卡展开时，标题保持原始宽度，不再被拉伸 */
  pointer-events: none;
}

.home-brand-wrap > * { pointer-events: auto; }

.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 6px 6px 14px rgba(255, 182, 193, 0.28), -6px -6px 14px rgba(135, 206, 235, 0.24),
    inset 1px 1px 2px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.home-brand:hover {
  transform: translateY(-1px);
  box-shadow: 7px 9px 18px rgba(255, 182, 193, 0.34), -7px -7px 16px rgba(135, 206, 235, 0.28),
    inset 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.home-brand:active { transform: translateY(0) scale(0.99); }

.home-brand .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-soft), var(--blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 182, 193, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  flex: none;
}

.home-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.home-brand .brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-brand .brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.user-pill {
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.user-pill .q-dot {
  background: #48c78e;
  box-shadow: 0 0 0 3px rgba(72, 199, 142, 0.16);
}

.user-pill {
  flex: none;
}

/* ---------- 地图 ---------- */
.map-wrap {
  position: absolute;
  inset: 0;
  z-index: var(--z-map);
  cursor: grab;
  touch-action: none;
}

#mapCanvas {
  width: 100%;
  height: 100%;
}

/* 构建/数据版本自检角标：确认浏览器加载的是最新脚本、数据最后更新时间 */
.build-chip {
  position: absolute;
  left: 18px;
  top: 74px;
  z-index: var(--z-overlay);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(90, 100, 120, 0.6);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

#mapCanvas canvas {
  outline: none;
}

/* 名称标注层（HTML overlay，避免依赖字体瓦片） */
.map-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.map-labels .mlabel {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #4a5568;
  background: rgba(255, 255, 255, 0.72);
}

.map-labels .mlabel.prov {
  font-size: 9px;
}

.map-labels .mlabel.city {
  font-size: 8px;
}

.map-labels .mlabel.county {
  font-size: 7px;
  font-weight: 600;
  color: #5b6b86;
  background: rgba(255, 255, 255, 0.62);
}

/* 轨迹点击浮窗（MapLibre Popup） */
.maplibregl-popup-content {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 14px;
  padding: 10px 14px;
  font-family: var(--font);
  box-shadow: 0 10px 30px rgba(255, 182, 193, 0.3), 0 10px 30px rgba(135, 206, 235, 0.25);
}

.maplibregl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: rgba(255, 255, 255, 0.97) !important;
  border-left-color: rgba(255, 255, 255, 0.97) !important;
  border-right-color: rgba(255, 255, 255, 0.97) !important;
}

.qp-title {
  font-weight: 800;
  font-size: 13px;
  color: #36415a;
  margin-bottom: 4px;
}

.qp-time {
  font-size: 12px;
  color: #6b7280;
}

.qp-person {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
}

.map-legend {
  position: absolute;
  right: 18px;
  top: 20px;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.legend-toggle {
  pointer-events: auto;
  flex: none;
  width: auto;
  height: 30px;
  padding: 0 9px 0 12px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: var(--indigo);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.2), -3px -3px 8px rgba(135, 206, 235, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.2s ease;
}

.legend-toggle .q-dot {
  background: #48c78e;
  box-shadow: 0 0 0 3px rgba(72, 199, 142, 0.16);
}

.legend-toggle-phone {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.legend-toggle:hover {
  background: #fff;
}

.legend-toggle svg {
  transition: transform 0.25s ease;
}

.map-legend.is-collapsed .legend-toggle svg {
  transform: rotate(180deg);
}

.legend-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.map-legend.is-collapsed .legend-panel {
  display: none;
}

.map-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.2), -3px -3px 8px rgba(135, 206, 235, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.legend-item .legend-name {
  color: var(--ink);
}

.legend-item .legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.legend-item small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- 音乐播放器（图例下方）：外壳含歌名歌手 + 控制键 ---------- */
.music-unit {
  pointer-events: auto;
  position: relative;
  width: 250px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.22), -3px -3px 8px rgba(135, 206, 235, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.music-player {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.music-unit:has(.music-player.is-empty) {
  opacity: 0.78;
}

.mp-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.mp-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-artist {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mp-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: var(--indigo);
  box-shadow: 2px 2px 5px rgba(255, 182, 193, 0.22), -2px -2px 5px rgba(135, 206, 235, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.mp-btn:hover {
  background: #fff;
}

.mp-btn:active {
  transform: scale(0.9);
}

.mp-btn.mp-play {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.mp-btn.mp-play:hover {
  background: linear-gradient(135deg, #7486f0 0%, var(--indigo-deep) 100%);
}

.mp-btn .mp-ico-pause {
  display: none;
}

.mp-btn.is-playing .mp-ico-play {
  display: none;
}

.mp-btn.is-playing .mp-ico-pause {
  display: block;
}

.mp-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: rgba(102, 126, 234, 0.14);
  overflow: hidden;
  pointer-events: none;
}

.mp-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--violet), var(--indigo));
  transition: width 0.2s linear;
}

/* ---------- 音乐列表弹窗（点击歌名歌手打开，仅关闭按钮可关） ---------- */
.mp-meta {
  cursor: pointer;
}

.mp-meta:hover .mp-title {
  color: var(--indigo);
}

.music-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-overlay) + 5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 22, 40, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.music-modal[hidden] {
  display: none;
}

.music-modal-card {
  position: relative;
  width: min(300px, 80vw);
  max-height: min(56vh, 380px);
  display: flex;
  flex-direction: column;
  padding: 14px 14px 10px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 36px rgba(60, 50, 120, 0.26);
}

.music-modal-head {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.music-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(102, 126, 234, 0.1);
  color: var(--indigo);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.music-modal-close:hover {
  background: rgba(102, 126, 234, 0.18);
}

.music-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.music-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background 0.15s ease;
}

.music-row:hover {
  background: rgba(102, 126, 234, 0.07);
}

.music-row .mr-idx {
  flex: none;
  width: 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--faint);
}

.music-row .mr-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.music-row .mr-title {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-row .mr-artist {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-row.is-current {
  background: rgba(102, 126, 234, 0.12);
}

.music-row.is-current .mr-title {
  color: var(--indigo);
}

.music-row .mr-badge {
  flex: none;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--indigo), var(--indigo-deep));
  color: #fff;
}

/* ---------- 底部堆叠：年份 + 刻度尺 + 悬浮窗 ---------- */
.bottom-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
}

.map-year {
  text-align: center;
  padding: 0 16px 10px;
  pointer-events: none;
  user-select: none;
}

/* 歌词轮播：替代原来巨大的年份数字，随音乐上下滚动 */
.lyric-ticker {
  width: min(620px, 84vw);
  height: 96px; /* 三行：3 × 32px，当前行居中 */
  margin: 0 auto 6px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 74%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 74%, transparent 100%);
}

.lyric-track {
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.lyric-item {
  height: 32px;
  line-height: 32px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.35), 0 0 18px rgba(255, 182, 193, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.7;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lyric-item.is-active {
  color: #fff;
  opacity: 1;
  transform: scale(1.04);
  text-shadow: 0 2px 12px rgba(102, 126, 234, 0.45), 0 0 22px rgba(255, 182, 193, 0.6);
}

.lyric-ticker.is-fallback .lyric-item {
  font-size: 15px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.92);
}

.map-year .year-sub {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 15px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 2px 2px 7px rgba(255, 182, 193, 0.22), -2px -2px 7px rgba(135, 206, 235, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ---------- 时间刻度尺 ---------- */
.ruler {
  position: relative;
  height: 62px;
  pointer-events: auto;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 38%,
    rgba(255, 255, 255, 0.92) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -10px 30px rgba(255, 182, 193, 0.12);
}

.ruler-scroll {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  display: flex;
  align-items: center;
  cursor: grab;
}

.ruler-scroll::-webkit-scrollbar {
  display: none;
}

.ruler-scroll:active {
  cursor: grabbing;
}

.ruler-spacer {
  flex: none;
  width: calc(50vw - 32px);
}

.ruler-track {
  display: flex;
  align-items: center;
  flex: none;
  height: 100%;
  position: relative;
}

.month-tick {
  flex: none;
  width: 64px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  color: var(--muted);
  transition: color 0.25s ease;
  user-select: none;
}

.month-tick .tick-year {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--faint);
  transition: color 0.25s ease;
}

.month-tick .tick-month {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.month-tick .tick-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  margin-top: 5px;
}

.month-tick.jan .tick-year {
  color: var(--indigo);
  font-size: 10px;
}

.month-tick.has-data .tick-dot {
  opacity: 1;
  background: var(--pink);
  box-shadow: 0 0 6px rgba(255, 107, 157, 0.5);
}

.month-tick.active {
  color: var(--pink);
}

.month-tick.active .tick-year {
  color: var(--indigo);
}

.month-tick.active .tick-dot {
  background: var(--pink);
  transform: scale(1.4);
}

.ruler-pointer {
  position: absolute;
  top: 6px;
  bottom: 10px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  z-index: 5;
  pointer-events: none;
}

.ruler-pointer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--pink), var(--indigo));
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.45);
}

.ruler-pointer::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pink), rgba(102, 126, 234, 0.55));
  box-shadow: 0 0 10px rgba(255, 107, 157, 0.4);
}

/* ---------- 悬浮窗 ---------- */
.sheet {
  pointer-events: auto;
  position: relative;
  height: var(--sheet-h, 44vh);
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  border-top-left-radius: var(--r-2xl);
  border-top-right-radius: var(--r-2xl);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(255, 182, 193, 0.2), 0 -6px 20px rgba(135, 206, 235, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: height 0.38s var(--ease);
  overflow: hidden;
  max-height: 78vh;
}

.sheet.is-dragging {
  transition: none;
}

.sheet-grip {
  flex: none;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sheet-grip:active {
  cursor: grabbing;
}

.sheet-grip span {
  width: 44px;
  height: 5px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(255, 182, 193, 0.75), rgba(135, 206, 235, 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: width 0.25s ease;
}

.sheet-grip:hover span {
  width: 58px;
}

/* ---------- 相聚统计（标题点击后显示在标题下方同一容器内） ---------- */
.brand-stats {
  margin-top: 8px;
  width: 346px;
  max-width: calc(100vw - 40px);
  pointer-events: auto;
  animation: tripExpand 0.2s ease;
}

.stats-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(255, 240, 245, 0.92), rgba(238, 245, 255, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.18), -3px -3px 8px rgba(135, 206, 235, 0.16);
  animation: tripExpand 0.2s ease;
}

.stats-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(102, 126, 234, 0.2);
}

.stats-hero {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: none;
}

.stats-hero b {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-mono);
}

.stats-hero span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stats-grid {
  display: flex;
  gap: 6px;
}

.stats-grid .stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.stats-grid .stat b {
  font-size: 17px;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
}

.stats-grid .stat b small {
  margin-left: 1px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.stats-grid .stat span {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stats-foot {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
  text-align: right;
  letter-spacing: 0.04em;
}

.sheet-tabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 18px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sheet-tabs::-webkit-scrollbar {
  display: none;
}

.sheet-tab {
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  padding: 9px 18px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--fast);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.22), -3px -3px 8px rgba(135, 206, 235, 0.2);
}

.sheet-tab:hover {
  transform: translateY(-2px);
  color: var(--pink);
}

.sheet-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink-soft) 0%, var(--blue) 100%);
  box-shadow: 0 8px 20px rgba(255, 182, 193, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sheet-tab .tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: rgba(102, 126, 234, 0.12);
  color: var(--indigo);
}

.sheet-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 18px 24px;
  overscroll-behavior: contain;
}

.sheet.collapsed .sheet-tabs,
.sheet.collapsed .sheet-body {
  opacity: 0;
  pointer-events: none;
}

.sheet-tabs,
.sheet-body {
  transition: opacity 0.22s ease;
}

/* ---------- 周历内容 ---------- */
.week-block {
  margin-bottom: 16px;
}

.week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.week-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.week-head span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-mono);
}

.trip-wrap {
  margin-bottom: 8px;
}

.trip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, #ffffff, #f5f8fb);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.16), -3px -3px 8px rgba(135, 206, 235, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.trip-wrap.is-open .trip-item {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.16);
}

.trip-item.is-clickable { cursor: pointer; }

.trip-item.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 4px 6px 12px rgba(255, 182, 193, 0.24), -4px -4px 10px rgba(135, 206, 235, 0.18);
}

.trip-item .trip-color {
  width: 4px;
  align-self: stretch;
  border-radius: 3px;
  flex: none;
}

.trip-main {
  flex: 1;
  min-width: 0;
}

.trip-route {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-route .arrow {
  color: var(--faint);
  font-weight: 400;
}

.trip-meta {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.trip-person {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(102, 126, 234, 0.08);
}

/* ---------- 交通方式 / 班次号（位于地点与时间之后，自适应换行，不影响其他元素） ---------- */
.trip-tr {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px 1px 3px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tr-color) 40%, #fff), color-mix(in srgb, var(--tr-color) 18%, #fff));
  border: 1px solid color-mix(in srgb, var(--tr-color) 45%, #fff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.trip-tr-ico {
  flex: none;
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.trip-tr-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-mono);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trip-voyage {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 0 7px;
  height: 20px;
  line-height: 20px;
  border-radius: 10px;
  background: rgba(255, 192, 203, 0.32);
  color: var(--ink);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-dt { flex: none; white-space: nowrap; }

/* ---------- 展开 / 收起（整条可点） ---------- */
.trip-item { position: relative; }
.trip-caret {
  flex: none;
  font-size: 12px;
  color: var(--faint);
  line-height: 1;
  transition: transform 0.2s ease;
}
.trip-wrap.is-open .trip-caret { transform: rotate(180deg); color: var(--pink); }
.trip-expand {
  padding: 12px 14px 14px;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: linear-gradient(135deg, rgba(255, 245, 248, 0.9), rgba(240, 245, 255, 0.9));
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-top: none;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.65;
  animation: tripExpand 0.18s ease;
}
@keyframes tripExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.trip-note { font-size: 13px; }
.trip-note.empty { color: var(--muted); font-style: italic; font-size: 12px; }
.trip-note img { max-width: 100%; border-radius: 8px; margin: 4px 2px 4px 0; }
.trip-note a { color: var(--pink); }
.trip-photos {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.trip-photos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(102, 126, 234, 0.08);
  transition: transform 0.2s ease;
}
.trip-photos img:hover { transform: scale(1.03); }

/* ---------- 影像素材（备注下方独立区域） ---------- */
.trip-media {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(102, 126, 234, 0.22);
}
.trip-media-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.trip-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.trip-media-item {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(102, 126, 234, 0.12);
}
.trip-media-item img,
.trip-media-item video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(102, 126, 234, 0.08);
}
.trip-media-item figcaption {
  padding: 5px 7px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-media-item img[data-full] { cursor: zoom-in; }

/* 隐私素材：只显示锁卡片，不加载任何媒体 */
.trip-media-item.is-private { cursor: pointer; }
.trip-media-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  min-height: 92px;
  border: none;
  background: linear-gradient(135deg, rgba(255, 228, 240, 0.95), rgba(226, 234, 255, 0.95));
  color: var(--indigo);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.trip-media-lock .lock-ico { font-size: 20px; line-height: 1; }
.trip-media-lock .lock-txt {
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 12px rgba(155, 107, 240, 0.18);
}
.trip-media-lock:hover .lock-txt { background: #fff; }

/* ---------- 隐私密码弹层 ---------- */
.pwd-gate {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 26, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pwd-gate.is-open { display: flex; }
.pwd-gate-card {
  width: min(92vw, 340px);
  padding: 22px 20px 18px;
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(24, 26, 42, 0.28);
  text-align: center;
}
.pwd-gate-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.pwd-gate-sub { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pwd-gate-input {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 0.16em;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.pwd-gate-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(107, 125, 216, 0.16); }
.pwd-gate-err { min-height: 16px; margin-top: 8px; font-size: 12px; font-weight: 700; color: #e25474; }
.pwd-gate-foot { display: flex; gap: 10px; margin-top: 10px; }
.pwd-gate-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  border: none;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.pwd-gate-btn.ghost { background: rgba(148, 163, 184, 0.16); color: var(--ink-soft); }
.pwd-gate-btn.primary {
  background: linear-gradient(135deg, var(--pink-soft), var(--blue));
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 182, 193, 0.35);
}
.pwd-gate-btn.primary:disabled { opacity: 0.6; cursor: default; }

/* ---------- 影像大图查看 ---------- */
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 56px;
  background: rgba(24, 26, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: viewerIn 0.18s ease-out;
}
.media-viewer.is-open { display: flex; }
@keyframes viewerIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.media-viewer-box {
  max-width: min(96vw, 1200px);
  max-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-viewer-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  border-radius: 12px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.media-viewer.is-ready .media-viewer-img { opacity: 1; }
.media-viewer-video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  border-radius: 12px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease-out;
  background: #000;
}
.media-viewer.is-ready .media-viewer-video { opacity: 1; }
.media-viewer-loading,
.media-viewer-err {
  padding: 18px 24px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.media-viewer-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  padding: 0 60px;
  pointer-events: none;
}
.media-viewer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

/* ---------- 年度回顾 ---------- */
.review-block .week-head { padding: 10px 4px 6px; }
.review-block .week-head h4 { font-size: 15px; letter-spacing: 0.3px; }
.review-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- 开发中占位 ---------- */
.dev-placeholder {
  text-align: center;
  padding: 30px 12px 36px;
}

.dev-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.4), rgba(135, 206, 235, 0.4));
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 182, 193, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.dev-placeholder h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.dev-placeholder p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.dev-ideas {
  margin: 12px auto 0;
  padding: 0;
  max-width: 420px;
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-ideas li {
  position: relative;
  padding: 8px 12px 8px 26px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-soft);
}

.dev-ideas li::before {
  content: '✦';
  position: absolute;
  left: 10px;
  top: 8px;
  color: var(--pink);
  font-size: 11px;
}

.dev-placeholder .dev-ideas-tip {
  margin-top: 12px;
  font-size: 11px;
  color: var(--faint);
}

/* ---------- 点亮记录 ---------- */

/* ============ 三端重排 ============ */
@media (max-width: 479px) {
  .home-topbar {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .home-brand {
    padding: 8px 14px 8px 8px;
    gap: 8px;
  }
  .home-brand .brand-logo {
    width: 30px;
    height: 30px;
  }
  .brand-title {
    font-size: 13px !important;
  }
  .brand-sub {
    font-size: 9px !important;
  }
  .user-pill {
    max-width: 92px;
    padding: 7px 10px;
    font-size: 10px;
  }
  .map-legend {
    top: 14px;
    right: 12px;
    gap: 6px;
  }
  .legend-item {
    padding: 5px 10px !important;
    font-size: 10px !important;
  }
  .legend-item .legend-line {
    width: 16px;
  }
  .map-year {
    padding-bottom: 4px;
  }
  .map-year .year-sub {
    font-size: 12px;
    padding: 3px 11px;
  }
  .lyric-ticker {
    height: 66px; /* 三行：3 × 22px */
    margin-bottom: 4px;
  }
  .lyric-item {
    height: 22px;
    line-height: 22px;
    font-size: 12px;
  }
  .trip-meta {
    gap: 4px;
    font-size: 10px;
  }
  .trip-dt {
    font-size: 10px;
  }
  .trip-tr {
    gap: 1px;
    padding: 0 4px 0 1px;
  }
  .trip-tr-ico {
    font-size: 9px;
  }
  .trip-tr-name {
    font-size: 8px;
  }
  .trip-voyage {
    font-size: 8px;
    height: 13px;
    line-height: 13px;
    padding: 0 3px;
    border-radius: 7px;
    max-width: 56px;
  }
  .trip-person {
    font-size: 10px;
    padding: 2px 7px;
  }
  .ruler {
    height: 52px;
  }
  .month-tick {
    width: 54px;
    height: 38px;
  }
  .tick-month {
    font-size: 15px !important;
  }
  .ruler-spacer {
    width: calc(50vw - 27px);
  }
  .sheet {
    height: var(--sheet-h, 42vh);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .sheet-tabs {
    padding: 0 12px 10px;
    gap: 8px;
  }
  .sheet-tab {
    padding: 8px 13px;
    font-size: 12px;
  }
  .sheet-body {
    padding: 2px 12px 18px;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .map-year {
    padding-bottom: 6px;
  }
  .ruler {
    height: 56px;
  }
  .month-tick {
    width: 58px;
  }
  .sheet {
    height: var(--sheet-h, 43vh);
  }
}

/* 手机端：歌名歌手独立成条（与图例同款），控制键单独一个小胶囊 */
@media (max-width: 767px) {
  .music-unit {
    width: auto;
    padding: 0;
    gap: 6px;
    flex-direction: column;
    align-items: flex-end;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .music-unit .mp-meta {
    flex: none;
    max-width: 62vw;
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 3px 3px 8px rgba(255, 182, 193, 0.2), -3px -3px 8px rgba(135, 206, 235, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .music-unit .mp-title {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 10px;
  }
  .music-unit .mp-artist {
    flex: none;
    font-size: 9px;
  }
  .music-player {
    position: relative;
    padding: 0;
    border-radius: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .mp-controls {
    gap: 4px;
  }
  .mp-btn {
    width: 20px;
    height: 20px;
  }
  .mp-btn.mp-play {
    width: 26px;
    height: 26px;
  }
  .mp-btn svg {
    width: 11px;
    height: 11px;
  }
  .mp-btn.mp-play svg {
    width: 13px;
    height: 13px;
  }
  .mp-progress {
    display: none;
  }
  .legend-panel {
    gap: 6px;
  }
}

@media (min-width: 768px) {
  .home-topbar {
    top: 24px;
    left: 28px;
    right: 28px;
  }
  .brand-title {
    font-size: 16px !important;
  }
  .map-legend {
    top: 30px;
    right: 28px;
    gap: 10px;
  }
  .legend-panel {
    gap: 10px;
  }
  .legend-item {
    font-size: 13px;
    padding: 8px 16px;
  }
  .map-year {
    padding-bottom: 8px;
  }
  .ruler {
    height: 64px;
  }
  .ruler-spacer {
    width: calc(50vw - 36px);
  }
  .month-tick {
    width: 68px;
  }
  .sheet {
    height: var(--sheet-h, 46vh);
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  }
  .sheet-body {
    padding: 6px 26px 28px;
  }
  .sheet-tabs {
    padding: 4px 26px 14px;
    gap: 12px;
  }
  .sheet-tab {
    padding: 10px 22px;
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  .home-topbar {
    top: 30px;
    left: 40px;
    right: 40px;
  }
  .map-year {
    padding-bottom: 10px;
  }
  .ruler {
    height: 66px;
  }
  .month-tick {
    width: 76px;
  }
  .month-tick .tick-month {
    font-size: 19px;
  }
  .sheet {
    max-width: 920px;
    height: var(--sheet-h, 44vh);
  }
  .sheet-body {
    padding: 8px 40px 30px;
  }
  .sheet-tabs {
    padding: 6px 40px 16px;
    gap: 14px;
  }
  .trip-item {
    padding: 12px 18px;
  }
}

@media (min-width: 1200px) {
  .map-year {
    padding-bottom: 10px;
  }
  .ruler {
    height: 68px;
  }
  .month-tick {
    width: 82px;
  }
  .sheet {
    max-width: 980px;
    height: var(--sheet-h, 42vh);
  }
  .home-brand {
    padding: 11px 22px 11px 11px;
  }
  .home-brand .brand-logo {
    width: 40px;
    height: 40px;
  }
}

/* 横屏手机（高度很低） */
@media (max-height: 520px) {
  .sheet {
    max-height: 60vh;
  }
  .map-year {
    font-size: 34px;
    padding-bottom: 4px;
  }
  .ruler {
    height: 64px;
  }
  .month-tick {
    height: 46px;
  }
  .map-legend {
    top: 12px;
    gap: 5px;
  }
  .legend-panel {
    gap: 5px;
  }
  .legend-item {
    padding: 5px 10px;
    font-size: 10px;
  }
}
