/* landmarks 文化遗产图层框架样式（lm-* 前缀，独立模块，不影响其他图层样式）。 */

/* 覆盖整个视口（inset:0）：绝对定位子元素可定位到顶栏下方；pointer-events:none 不拦截地图点击。
   z-index 35：高于图例（~9），低于空间助手聊天层（40–48），不再遮挡 gm-chat-fab / gm-chat-panel。
   loading(50)/export(60) 仍高于聊天层。面板/抽屉保持底部，不得阻塞聊天命中测试（由 35 保证堆叠）。 */
.lm-root { position: fixed; z-index: 35; inset: 0; pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.lm-root[hidden] { display: none; }
.lm-drawer[hidden] { display: none; }   /* display:flex 压过 UA 的 [hidden] 隐藏，需显式关闭 */

/* 顶部工具条：列表 / 路线 / 时间筛选（同一连续轴上的起止区间）。
   top 由 JS 实测 .topbar getBoundingClientRect().bottom 写入 --gm-topbar-bottom（含标题/chips/view-desc/region-bar
   与 topbar 自身 safe-area padding），再加 8px 间隙；禁止写死 56/112px。
   不要再叠加 env(safe-area-inset-top)：矩形已含 topbar padding 里的安全区，避免双计。
   面板/抽屉仍在底部；z-index 35 低于聊天层 40–48，不挡空间助手。 */
/* 默认一条细控件：芯片 + 年代摘要 + 计数。双端滑块和说明在 .lm-axis 里，收起时不占高度。 */
.lm-bar { pointer-events: auto; position: absolute; top: var(--gm-topbar-bottom, 120px); left: 12px; right: 12px;
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  background: rgba(255,255,255,.92); border: 1px solid rgba(208,215,222,.95);
  border-radius: 10px; padding: 3px 8px; box-shadow: 0 1px 6px rgba(22,28,38,.08); }
.lm-bar-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.lm-btn { border: 1px solid #d0d7de; background: #fff; border-radius: 999px; padding: 2px 9px;
  font-size: 12px; line-height: 1.45; cursor: pointer; color: #1d232b; }
.lm-btn:hover { background: #f3f4f6; }
.lm-axis-toggle { display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  color: #7c4a03; border-color: #e2d5bd; font-weight: 650; }
.lm-axis-toggle[aria-expanded="true"] { background: #fdf2e3; }
.lm-axis-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
.lm-axis-chev { font-size: 10px; color: #b45309; }
.lm-axis { display: flex; flex-direction: column; gap: 1px; flex: none; min-width: 0; width: 100%;
  padding: 2px 2px 3px; }
.lm-axis[hidden] { display: none; }
.lm-axis-note { font-size: 10.5px; line-height: 1.35; color: #8a919c; }
/* 计数已在年代条里。顶栏那行「文化遗产层·20,810…」与它重复，打开本层时收起，少占一条地图。 */
body.lm-active .view-desc { display: none; }
.lm-axis-scale { display: flex; justify-content: space-between; font-size: 10px; color: #6b7280;
  font-variant-numeric: tabular-nums; }
.lm-axis-track-wrap { position: relative; height: 44px; touch-action: none; cursor: pointer; }
.lm-axis-rail { position: absolute; left: 0; right: 0; top: 19px; height: 6px; background: #eceff3; border-radius: 3px; pointer-events: none; }
.lm-axis-sel { position: absolute; top: 19px; height: 6px; background: #b45309; border-radius: 3px; pointer-events: none; }
/* 原生 range 仅作无障碍备份；命中与拖动一律走轨道上的 pointer 逻辑（移动端 thumb 的 pointer-events 不可靠）。 */
.lm-sl { position: absolute; left: 0; width: 100%; top: 0; height: 44px; margin: 0; background: none;
  pointer-events: none; appearance: none; -webkit-appearance: none; }
.lm-sl::-webkit-slider-runnable-track { height: 44px; background: transparent; border: none; }
.lm-sl::-webkit-slider-thumb { pointer-events: none; appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: 13px; border-radius: 50%; background: #b45309;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #b45309; cursor: pointer; }
.lm-sl::-moz-range-track { height: 44px; background: transparent; border: none; }
.lm-sl::-moz-range-thumb { pointer-events: none; width: 18px; height: 18px; border: none; border-radius: 50%;
  background: #b45309; border: 2px solid #fff; box-shadow: 0 0 0 1px #b45309; cursor: pointer; }
.lm-axis-vals { font-size: 10.5px; color: #6b7280; font-variant-numeric: tabular-nums; line-height: 1.3; }
.lm-count { font-size: 11px; color: #6b7280; white-space: nowrap; margin-left: auto; max-width: none; }
@media (max-width: 720px) {
  .lm-count { max-width: 100%; white-space: normal; margin-left: 0; }
  .lm-axis-sum { max-width: 68vw; }
}

/* 列表 / 路线面板 */
.lm-panel { pointer-events: auto; position: absolute; bottom: 8px; left: 12px; width: min(340px, calc(100vw - 24px));
  max-height: 52vh; overflow: auto; background: #fff; border: 1px solid #d0d7de; border-radius: 14px;
  box-shadow: 0 2px 14px rgba(22,28,38,.14); padding: 10px; }
.lm-p-h { font-size: 13px; font-weight: 700; margin: 2px 2px 8px; color: #1d232b; }

/* 小卡：缩略图 / 名字 / 年份；未 ready 明示“叙事制作中” */
.lm-card { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 1px solid #e5e7eb;
  border-radius: 10px; background: #fff; padding: 6px; margin-bottom: 6px; cursor: pointer; }
.lm-card:hover { background: #f9fafb; }
.lm-card img, .lm-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none;
  background: #e5e7eb; display: block; }
.lm-c-t { min-width: 0; }
.lm-c-t b { display: block; font-size: 13px; color: #1d232b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-c-t i { font-style: normal; font-size: 11px; color: #6b7280; font-variant-numeric: tabular-nums; }
.lm-draft-tag, .lm-hdraft { display: inline-block; margin-left: 4px; font-size: 10px; font-style: normal;
  background: #fdf2e3; color: #a35a00; border-radius: 8px; padding: 1px 6px; }
.lm-card:not(.ready) { opacity: .82; }
.lm-shake { animation: lm-shake .4s; }
@keyframes lm-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* 西班牙路线章节 */
.lm-ch { border-top: 1px dashed #e5e7eb; padding: 8px 2px; font-size: 12px; }
.lm-ch b { font-size: 12.5px; color: #1d232b; }
.lm-ch i { display: block; font-style: normal; color: #6b7280; margin: 2px 0; }
.lm-ch-p { color: #4b5563; margin: 2px 0 6px; }
.lm-ch-s { display: flex; flex-wrap: wrap; gap: 6px; }
.lm-next { margin-top: 6px; border: none; background: none; color: #1f5fa8; font-size: 12px; cursor: pointer; padding: 0; }

/* 详情：桌面右抽屉 / 手机底部层（拆分滚动层：外层裁切白底圆角，内层 .lm-drawer-body 滚动，× 不随内容滚走） */
.lm-drawer { pointer-events: auto; position: absolute; bottom: 8px; right: 12px; width: min(380px, calc(100vw - 24px));
  max-height: 64vh; overflow: hidden; display: flex; flex-direction: column; background: #fff;
  border: 1px solid #d0d7de; border-radius: 14px;
  box-shadow: 0 4px 20px rgba(22,28,38,.18); padding: 14px; }
.lm-drawer-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
@media (max-width: 640px) {
  .lm-drawer { left: 8px; right: 8px; width: auto; bottom: 8px; border-radius: 16px 16px 12px 12px; }
  .lm-panel { left: 8px; width: calc(100vw - 16px); }
  /* 抽屉/小卡打开时抬到助手按钮之上，避免按钮盖住故事正文；按钮改到抽屉下方（见 chat.css） */
  body.lm-drawer-open .lm-drawer,
  body.lm-mini-open .lm-mini { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}
.lm-drawer h3 { margin: 0 26px 4px 0; font-size: 17px; color: #1d232b; }
.lm-drawer .lm-en { font-size: 12px; color: #8a919c; font-weight: 400; }
.lm-x { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 20px;
  color: #6b7280; cursor: pointer; line-height: 1; }
.lm-meta { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.lm-imgbox img { width: 100%; border-radius: 10px; display: block; }
.lm-credit { font-size: 11px; color: #8a919c; margin: 4px 0 8px; }
.lm-credit a { color: #1f77b4; }
.lm-hook { font-size: 14px; font-weight: 600; color: #1d232b; margin: 8px 0; }
.lm-story { font-size: 13px; line-height: 1.75; color: #374151; margin: 8px 0; text-indent: 0; }
.lm-look b, .lm-contrast b, .lm-chapter b, .lm-rel b { display: block; font-size: 12px; color: #92400e; margin: 10px 0 4px; }
.lm-look ul { margin: 0; padding-left: 18px; }
.lm-look li { font-size: 13px; line-height: 1.7; color: #374151; }
.lm-contrast p { font-size: 13px; line-height: 1.7; color: #374151; margin: 0; }
.lm-chapter { font-size: 12.5px; color: #4b5563; background: #faf7f2; border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.lm-rel .lm-chip { margin: 4px 6px 0 0; }
.lm-chip { border: 1px solid #d0d7de; background: #fff; border-radius: 12px; padding: 3px 10px;
  font-size: 12px; cursor: pointer; color: #1d232b; }
.lm-chip:hover { background: #f3f4f6; }
.lm-sources { margin-top: 12px; font-size: 11px; color: #8a919c; line-height: 1.8; word-break: break-all; }
.lm-sources a { color: #1f77b4; margin-right: 4px; }
.lm-video-btn { border: 1px solid #d0d7de; background: #111827; color: #fff; border-radius: 10px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; margin: 6px 0; }
.lm-draft-note { font-size: 14px; color: #a35a00; background: #fdf2e3; border-radius: 10px; padding: 12px; }
.lm-hover { background: rgba(29,35,43,.92); color: #fff; font-size: 12px; border-radius: 8px; padding: 4px 9px; }
.lm-hover .lm-hy { color: #fbbf24; font-variant-numeric: tabular-nums; }
.lm-root.lm-en button, .lm-root.lm-en .lm-p-h { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* 覆盖度与未收录标记（审校子集 20261108d+） */
.lm-count { font-weight: 600; }
.lm-excluded-note { font-size: 11.5px; color: #8a919c; background: #f9fafb; border-radius: 8px;
  padding: 7px 9px; margin-top: 6px; line-height: 1.6; }
.lm-chip-off { display: inline-flex; align-items: center; gap: 5px; border: 1px dashed #d0d7de; color: #6b7280;
  border-radius: 12px; padding: 3px 10px; font-size: 12px; margin: 4px 6px 0 0;
  cursor: default; user-select: none; }
.lm-chip-off em { font-style: normal; font-size: 10px; color: #a35a00; background: #fdf2e3;
  border-radius: 8px; padding: 0 6px; }
.lm-ch-a { color: #4b5563; margin: 2px 0; }

/* 小卡（openCard）：缩略图 + 名称 + 年份 + hook + 展开按钮；展开才进抽屉 */
.lm-mini { pointer-events: auto; position: absolute; bottom: 8px; right: 12px; width: min(300px, calc(100vw - 24px));
  background: #fff; border: 1px solid #d0d7de; border-radius: 14px;
  box-shadow: 0 4px 20px rgba(22,28,38,.16); padding: 12px; }
.lm-mini-h { display: flex; gap: 9px; align-items: center; }
.lm-mini-h img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: #e5e7eb; display: block; }
.lm-mini-h .lm-noimg { width: 56px; height: 56px; }
.lm-mini-t { min-width: 0; }
.lm-mini-t b { display: block; font-size: 14.5px; color: #1d232b; }
.lm-mini-t i { font-style: normal; font-size: 11.5px; color: #6b7280; font-variant-numeric: tabular-nums; }
.lm-mini-hook { font-size: 12.5px; line-height: 1.65; color: #374151; margin: 8px 0 10px; }
.lm-mini-xp { width: 100%; text-align: center; background: #f8f5ef; border-color: #e2d5bd; color: #7c4a03; }
.lm-mini-xp:hover { background: #f1e9da; }
@media (max-width: 640px) {
  .lm-mini { left: 8px; right: 8px; width: auto; bottom: 8px; }
}

/* 抽屉内时间 mini 轴：这座建筑的年代 + 今年 */
.lm-ax5000 { margin: 2px 0 10px; }
.lm-ax-track { position: relative; height: 6px; background: #eceff3; border-radius: 3px; }
.lm-ax-dot { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: #b45309; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transform: translateX(-6px); }
.lm-ax-now { position: absolute; top: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: #1e88e5; border: 2px solid #fff; transform: translateX(-5px); }
.lm-ax-lab { display: flex; justify-content: space-between; font-size: 10.5px; color: #8a919c;
  font-variant-numeric: tabular-nums; margin-top: 4px; }
.lm-ax-key { font-size: 11px; color: #6b7280; margin-top: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lm-k-dot, .lm-k-now { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.lm-k-dot { background: #b45309; }
.lm-k-now { background: #1e88e5; }

/* 视频：点击后才建 iframe/video；来源不在白名单时禁用并说明 */
.lm-video-off { display: inline-block; font-size: 11.5px; color: #8a919c; background: #f3f4f6;
  border-radius: 10px; padding: 7px 12px; margin: 6px 0; }
.lm-video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; display: block; margin: 6px 0; background: #111827; }

/* 首条路线（routeGo(n)）：游历顺序站列表，非章节序；未收录站保留标缺 */
.lm-p-h2 { margin-top: 12px; color: #7c4a03; }
.lm-route-note { font-size: 11.5px; color: #6b7280; margin: 4px 0 6px; }
.lm-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lm-stop { margin: 0; }
.lm-stop-go { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left;
  background: #fff; border: 1px solid #e5e1d8; border-radius: 10px; padding: 7px 9px; cursor: pointer; }
.lm-stop-go:hover { background: #faf6ee; border-color: #d9cdb4; }
.lm-stop.cur .lm-stop-go { background: #fdf2e3; border-color: #d9a441; }
.lm-stop-n { flex: none; font-size: 11px; font-weight: 700; color: #b45309; background: #fdf2e3;
  border-radius: 8px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.lm-stop-t { min-width: 0; }
.lm-stop-t b { display: block; font-size: 13px; color: #1d232b; }
.lm-stop-t i { font-style: normal; font-size: 10.5px; color: #8a919c; }
.lm-stop-off { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: #9aa1ac;
  padding: 5px 9px; border: 1px dashed #e5e1d8; border-radius: 10px; }
.lm-stop-off em { font-style: normal; font-size: 10px; color: #a35a00; background: #fdf2e3;
  border-radius: 8px; padding: 0 6px; margin-left: auto; }
.lm-route-next { width: 100%; text-align: center; margin-top: 6px; }
.lm-route-end { font-size: 11.5px; color: #6b7280; text-align: center; margin-top: 6px; }
