/* TravelMap 版面、地图、标记、筛选、搜寻、Toast（规格书 §4、§5） */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
.tm-body {
  background: var(--tm-paper);
  color: var(--tm-ink);
  font-family: var(--tm-font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--tm-primary); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- 版面：桌面（≥ 1024px） ---------- */
.tm-app {
  display: grid;
  grid-template-columns: var(--tm-sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow: clip;
}
.tm-sidebar {
  position: relative;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--tm-paper);
  border-inline-end: var(--tm-line);
}
.tm-sidebar:focus { outline: none; }
.tm-sidebar__inner { display: flex; flex-direction: column; gap: 18px; padding: 22px 20px 28px; }
.tm-stage { position: relative; overflow: hidden; overflow: clip; min-width: 0; isolation: isolate; --tm-sheet-visible: 0px; }
.tm-map { position: absolute; inset: 0; z-index: 0; background: #FFF6E0; }

/* 标题区 */
.tm-head { position: relative; display: flex; flex-direction: column; gap: 6px; padding-inline-end: 48px; }
.tm-brand {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 4px 12px 4px 6px; border: 2px solid var(--tm-ink); border-radius: 999px;
  background: var(--tm-card); font-weight: 600; font-size: 13px; letter-spacing: .01em;
}
.tm-brand__pin {
  width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--tm-primary); border: 2px solid var(--tm-ink);
}
.tm-title { margin: 4px 0 0; font-size: 28px; line-height: 1.15; font-weight: 700; }
.tm-filter-title { margin: 4px 0 -6px; font-size: 18px; font-weight: 700; }
.tm-head .tm-sidebar__close { position: absolute; top: 0; inset-inline-end: 0; display: none; }
.tm-field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--tm-ink-soft); }

/* ---------- 按钮 ---------- */
.tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 16px;
  border: var(--tm-line); border-radius: var(--tm-radius);
  background: var(--tm-card); color: var(--tm-ink);
  box-shadow: var(--tm-shadow);
  font-weight: 600; font-size: 15px; line-height: 1.1; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--tm-bounce), box-shadow .15s ease, background-color .2s ease;
}
.tm-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--tm-ink); }
.tm-btn:active, .tm-chip:active { transform: translate(3px, 3px); box-shadow: var(--tm-shadow-pressed); }
.tm-btn--icon { width: 44px; padding: 0; border-radius: 50%; font-size: 18px; }
.tm-btn--primary { background: var(--tm-primary); color: var(--tm-primary-ink); }
.tm-btn[aria-pressed="true"] { background: var(--tm-primary); color: var(--tm-primary-ink); }

/* 下拉选单 */
.tm-select { position: relative; }
.tm-select select {
  width: 100%; min-height: 46px; padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-card);
  box-shadow: var(--tm-shadow); font-weight: 600; font-size: 15px; cursor: pointer;
}
.tm-select::after {
  content: "▾"; position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-52%);
  pointer-events: none; font-size: 16px;
}
.tm-overlay-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }

/* 语言 */
.tm-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-lang { min-height: 44px; padding: 0 12px; font-size: 14px; box-shadow: 3px 3px 0 var(--tm-ink); }

/* ---------- 分类 chip ---------- */
.tm-chips { display: flex; gap: 10px; }
.tm-chips--stack { flex-direction: column; }
.tm-chip {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 5px 12px 5px 6px;
  border: var(--tm-line); border-radius: var(--tm-radius);
  background: var(--tm-card); color: var(--tm-ink); box-shadow: var(--tm-shadow);
  font-weight: 600; font-size: 15px; line-height: 1.15; text-align: start;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--tm-bounce), box-shadow .15s ease, background-color .2s ease;
}
.tm-chip:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--tm-ink); }
.tm-chip__emoji {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--tm-ink); background: var(--c-soft, #F3ECDD); font-size: 17px; line-height: 1;
}
.tm-chip__label { min-width: 0; }
.tm-chip__count {
  flex: none; margin-inline-start: auto; min-width: 28px; padding: 2px 8px;
  border: 2px solid var(--tm-ink); border-radius: 999px; background: var(--tm-paper); color: var(--tm-ink);
  font-size: 13px; text-align: center;
}
.tm-chip[aria-pressed="true"] { background: var(--c, var(--tm-primary)); color: var(--c-ink, var(--tm-primary-ink)); }
.tm-chip[aria-pressed="true"] .tm-chip__emoji { background: var(--tm-card); }

/* ---------- 搜寻 ---------- */
.tm-search { position: relative; z-index: 5; }
.tm-search__box {
  display: flex; align-items: center; gap: 4px; min-height: 48px; padding-inline-start: 12px;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-card); box-shadow: var(--tm-shadow);
}
.tm-search__box:focus-within { outline: 3px solid var(--tm-primary); outline-offset: 3px; }
.tm-search__icon { font-size: 16px; }
.tm-search__input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: none;
  font-size: 16px; font-weight: 500;
}
.tm-search__input::placeholder { color: var(--tm-ink-soft); opacity: 1; }
.tm-search__input::-webkit-search-cancel-button { display: none; }
.tm-search__clear {
  flex: none; width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; cursor: pointer; font-size: 15px;
}
.tm-search__list, .tm-search__empty {
  position: absolute; inset-inline: 0; top: calc(100% + 10px); margin: 0; padding: 6px;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-card); box-shadow: var(--tm-shadow);
}
.tm-search__list { list-style: none; max-height: min(360px, 60vh); overflow-y: auto; }
.tm-search__empty { padding: 14px 16px; font-weight: 500; color: var(--tm-ink-soft); }
.tm-search__opt {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px;
  border-radius: calc(var(--tm-radius) * .6); cursor: pointer;
}
.tm-search__opt:hover, .tm-search__opt[aria-selected="true"] { background: color-mix(in srgb, var(--tm-primary) 18%, white); }
.tm-search__emoji { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--tm-ink); border-radius: 50%; background: var(--tm-paper); }
.tm-search__text { display: flex; flex-direction: column; min-width: 0; }
.tm-search__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-search__meta { font-size: 13px; color: var(--tm-ink-soft); }

/* ---------- 标记（§4.3） ---------- */
.tm-marker { width: 58px; height: 64px; }
.tm-marker[hidden] { display: none !important; }
.tm-pin {
  position: relative; display: block; width: 58px; height: 64px; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform-origin: 29px 57px;
  transition: transform .2s var(--tm-bounce), opacity .2s ease;
}
.tm-pin:focus-visible { outline: none; }
.tm-pin:focus-visible { transform: scale(1.15); }
.tm-pin:focus-visible .tm-pin__outline { stroke: var(--tm-primary); fill: var(--tm-primary); stroke-width: 16; }
.tm-pin__svg { display: block; overflow: visible; }
.tm-pin__shadow, .tm-pin__outline { fill: var(--tm-ink); stroke: var(--tm-ink); stroke-width: 10; stroke-linejoin: round; }
.tm-pin__border { fill: #FFFFFF; stroke: #FFFFFF; stroke-width: 6; stroke-linejoin: round; }
.tm-pin__fill { fill: var(--c); }
.tm-pin__emoji { position: absolute; left: 29px; top: 27px; transform: translate(-50%, -52%); font-size: 22px; line-height: 1; pointer-events: none; }
.tm-pin__secret {
  position: absolute; left: 39px; top: -3px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--tm-secret); border: 2px solid #FFFFFF; box-shadow: 0 0 0 2px var(--tm-ink);
  font-size: 11px; line-height: 1; pointer-events: none;
}
.tm-pin:hover { transform: scale(1.1); animation: tm-wiggle .5s ease; }
.tm-marker.is-selected .tm-pin { transform: scale(1.25); animation: tm-hop .45s var(--tm-bounce); }
.tm-has-selection .tm-marker:not(.is-selected) .tm-pin { opacity: .55; }
.tm-marker.is-in .tm-pin { animation: tm-drop .38s var(--tm-bounce) backwards; animation-delay: var(--d, 0ms); }
.tm-marker.is-out .tm-pin { transform: scale(.25); opacity: 0; }

@keyframes tm-wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -8deg; } 60% { rotate: 6deg; } 85% { rotate: -2deg; } }
@keyframes tm-hop { 0% { translate: 0 0; } 40% { translate: 0 -12px; } 70% { translate: 0 2px; } 100% { translate: 0 0; } }
@keyframes tm-drop { 0% { translate: 0 -34px; opacity: 0; } 45% { opacity: 1; } 100% { translate: 0 0; opacity: 1; } }
@keyframes tm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- MapLibre 控制项（卡通化） ---------- */
.tm-stage .maplibregl-ctrl-group {
  border: var(--tm-line); border-radius: calc(var(--tm-radius) * .7); overflow: hidden;
  background: var(--tm-card); box-shadow: var(--tm-shadow);
}
.tm-stage .maplibregl-ctrl-group button { width: 40px; height: 40px; }
.tm-stage .maplibregl-ctrl-group button + button { border-top: 2px solid var(--tm-ink); }
.tm-stage .maplibregl-ctrl-top-right { margin: 6px; }
.tm-stage .maplibregl-ctrl-attrib { font-family: system-ui, sans-serif; font-size: 11px; background: rgba(255, 255, 255, .85); }
.tm-stage .maplibregl-ctrl-top-right,
.tm-stage .maplibregl-ctrl-bottom-right { transition: transform .35s var(--tm-ease); }
.tm-stage .maplibregl-cooperative-gesture-screen { font-family: var(--tm-font); font-size: 20px; font-weight: 600; }

/* ---------- 提示、Toast、载入、错误 ---------- */
.tm-notice {
  position: absolute; z-index: 25; top: 16px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  padding: 12px 16px; border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-paper);
  box-shadow: var(--tm-shadow); font-weight: 600; text-align: center;
}
.tm-toasts {
  position: absolute; z-index: 70; inset-inline: 0; bottom: calc(28px + var(--tm-sheet-visible));
  display: flex; justify-content: center; pointer-events: none; padding: 0 16px;
}
.tm-toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 10px 18px 10px 12px;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-paper); box-shadow: var(--tm-shadow);
  font-weight: 600; transform: translateY(24px); opacity: 0;
  transition: transform .3s var(--tm-bounce), opacity .2s ease;
}
.tm-toast.is-in { transform: none; opacity: 1; }
.tm-toast.is-out { transform: translateY(12px); opacity: 0; }
.tm-toast__emoji { font-size: 20px; }

.tm-overlay { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px; }
.tm-loading { background: var(--tm-paper); transition: opacity .3s ease; }
.tm-loading.is-out { opacity: 0; pointer-events: none; }
.tm-loading__pin { position: relative; width: 56px; height: 76px; }
.tm-loading__pin span {
  position: absolute; left: 6px; top: 0; width: 44px; height: 44px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: var(--tm-primary); border: 3px solid var(--tm-ink); box-shadow: 3px 3px 0 var(--tm-ink);
  animation: tm-jump .9s var(--tm-bounce) infinite;
}
.tm-loading__pin::after {
  content: ""; position: absolute; left: 12px; bottom: 0; width: 32px; height: 8px; border-radius: 50%;
  background: rgba(45, 42, 50, .2); animation: tm-shadow .9s var(--tm-bounce) infinite;
}
.tm-loading__text { margin: 0; font-weight: 600; font-size: 17px; }
@keyframes tm-jump { 0%, 100% { translate: 0 14px; } 50% { translate: 0 -8px; } }
@keyframes tm-shadow { 0%, 100% { scale: 1; } 50% { scale: .6; } }

.tm-error { background: color-mix(in srgb, var(--tm-paper) 85%, transparent); }
.tm-error__card {
  display: grid; justify-items: center; gap: 14px; max-width: 340px; padding: 28px 24px;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-paper); box-shadow: 6px 6px 0 var(--tm-ink);
  text-align: center;
}
.tm-error__emoji { font-size: 52px; line-height: 1; }
.tm-error__msg { margin: 0; font-size: 18px; font-weight: 600; }

.tm-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(45, 42, 50, .45); }
.tm-modal__card {
  display: grid; gap: 12px; width: min(420px, 100%); padding: 20px;
  border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-paper); box-shadow: 6px 6px 0 var(--tm-ink);
}
.tm-modal__title { margin: 0; font-weight: 600; }
.tm-modal__text { width: 100%; padding: 10px; border: 2px solid var(--tm-ink); border-radius: 12px; font-size: 15px; resize: none; }
.tm-noscript { padding: 24px; font-family: system-ui, sans-serif; }

/* 平板的筛选按钮、手机的顶部列：桌面不显示 */
.tm-fab, .tm-topbar { display: none; }
.tm-scrim { display: none; }

/* ---------- 平板（768–1023px） ---------- */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .tm-app { grid-template-columns: minmax(0, 1fr); }
  .tm-sidebar {
    position: absolute; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(360px, 88vw);
    box-shadow: 6px 0 0 var(--tm-ink); transform: translateX(calc(-100% - 12px)); transition: transform .35s var(--tm-bounce);
    visibility: hidden;
  }
  [dir="rtl"] .tm-sidebar { transform: translateX(calc(100% + 12px)); }
  .tm-sidebar.is-open { transform: none; visibility: visible; }
  .tm-head .tm-sidebar__close { display: inline-flex; }
  .tm-scrim { display: block; position: absolute; inset: 0; z-index: 55; background: rgba(45, 42, 50, .3); }
  .tm-fab { display: inline-flex; position: absolute; z-index: 20; top: 16px; inset-inline-start: 16px; }
  .tm-stage.has-panel .maplibregl-ctrl-top-right,
  .tm-stage.has-panel .maplibregl-ctrl-bottom-right { transform: translateX(calc(-1 * var(--tm-panel-w))); }
}

/* 桌面：资讯面板打开时，右边的控制项让开 */
@media (min-width: 1024px) {
  .tm-stage.has-panel .maplibregl-ctrl-top-right,
  .tm-stage.has-panel .maplibregl-ctrl-bottom-right { transform: translateX(calc(-1 * var(--tm-panel-w))); }
  .tm-stage.has-panel .tm-toasts, .tm-stage.has-panel .tm-notice { inset-inline-end: var(--tm-panel-w); }
}

/* ---------- 顶部列版面：手机（< 768px），或嵌入时 ui=compact（app.js 加上 .tm-ui-top） ---------- */
.tm-app.tm-ui-top { grid-template-columns: minmax(0, 1fr); }
.tm-ui-top .tm-sidebar { display: none; }
.tm-ui-top .tm-fab, .tm-ui-top .tm-scrim { display: none !important; }
.tm-ui-top .tm-topbar {
  display: block; position: absolute; z-index: 20; top: 0; inset-inline: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 0; pointer-events: none;
}
.tm-ui-top .tm-topbar > * { pointer-events: auto; }
.tm-ui-top .tm-topbar__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; }
.tm-ui-top .tm-topbar__actions { display: flex; gap: 8px; }
.tm-ui-top .tm-mapname {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 55vw; min-height: 44px;
  padding: 0 14px; border: var(--tm-line); border-radius: var(--tm-radius); background: var(--tm-paper); box-shadow: var(--tm-shadow);
  font-weight: 700; font-size: 16px;
}
.tm-ui-top .tm-mapname__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-ui-top .tm-mapname__caret { font-size: 14px; }
.tm-ui-top .tm-mapname.can-switch:focus-within { outline: 3px solid var(--tm-primary); outline-offset: 3px; }
.tm-ui-top .tm-langpick { position: relative; }
.tm-ui-top .tm-langpick__btn { width: auto; min-width: 44px; padding: 0 10px; border-radius: var(--tm-radius); gap: 2px; font-size: 13px; }
.tm-ui-top .tm-langpick__globe { font-size: 16px; }
.tm-ui-top .tm-langpick:focus-within .tm-langpick__btn { outline: 3px solid var(--tm-primary); outline-offset: 3px; }
.tm-ui-top .tm-favbtn { position: relative; }
.tm-ui-top .tm-favbtn__count {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border: 2px solid var(--tm-ink); border-radius: 999px; background: var(--tm-card); color: var(--tm-ink);
  font-size: 11px; line-height: 16px; text-align: center;
}
.tm-ui-top .tm-topbar__search { padding: 10px 12px 0; max-width: 560px; }
.tm-ui-top .tm-topbar__chips { margin-top: 2px; }
.tm-ui-top .tm-chips--row {
  flex-direction: row; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 10px 12px 12px;
}
.tm-ui-top .tm-chips--row::-webkit-scrollbar { display: none; }
.tm-ui-top .tm-chips--row .tm-chip { flex: none; padding: 4px 10px 4px 5px; gap: 7px; font-size: 14px; box-shadow: 3px 3px 0 var(--tm-ink); }
.tm-ui-top .tm-chips--row .tm-chip__emoji { width: 30px; height: 30px; font-size: 16px; }
.tm-ui-top .tm-chips--row .tm-chip__count { min-width: 24px; padding: 1px 6px; font-size: 12px; }
.tm-ui-top .tm-chips--row .tm-chip--fav { display: none; }
.tm-ui-top .tm-notice { top: calc(env(safe-area-inset-top, 0px) + 126px); }
.tm-ui-top .maplibregl-ctrl-top-right { margin-top: 128px; }

/* ---------- 手机（< 768px）：底部抽屉、控制项 ---------- */
@media (max-width: 767.98px) {
  .tm-stage .maplibregl-ctrl-top-right { display: none; }
  .tm-stage .maplibregl-ctrl-bottom-right,
  .tm-stage .maplibregl-ctrl-bottom-left { transform: translateY(calc(-1 * var(--tm-sheet-visible))); transition: none; }
}

/* ---------- 嵌入模式（在顾客网站里，§5、§10.5） ---------- */
.tm-body--embed, .tm-body--embed .tm-app { background: transparent; }
[data-mode="embed"] .tm-title, [data-mode="embed"] .tm-brand { display: none; }
[data-mode="embed"] .tm-head { min-height: 0; padding-inline-end: 0; }
.tm-logo { display: block; max-width: 160px; max-height: 48px; object-fit: contain; }
@media (min-width: 1024px) {
  [data-mode="embed"] { --tm-sidebar-w: 280px; }
  [data-mode="embed"] .tm-sidebar__inner { gap: 14px; padding: 16px 14px 20px; }
  [data-mode="embed"] .tm-chip { min-height: 44px; font-size: 14px; }
}

/* Powered by（§15.7）：左下角一行小字，不盖住右下角的版权标示和按钮 */
.tm-powered {
  position: absolute; z-index: 15; inset-inline-start: 10px; bottom: 6px; max-width: calc(100% - 20px);
  padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .8);
  color: var(--tm-ink-soft); font: 500 11px/1.6 var(--tm-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform: translateY(calc(-1 * var(--tm-sheet-visible)));
}
.tm-powered a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* 面板打开时，右下角的版权标示会往左移到面板旁边，Powered by 就往上移一行，两个不会叠在一起 */
@media (min-width: 768px) {
  .tm-stage.has-panel .tm-powered { bottom: 28px; max-width: calc(100% - var(--tm-panel-w) - 20px); }
}
@media (max-width: 559.98px) {
  /* 太窄时放在版权标示的上面一行 */
  .tm-powered { bottom: 28px; }
}

/* 手机全屏按钮（嵌入时才有） */
.tm-fullscreen { position: absolute; z-index: 21; inset-inline-end: 12px; top: calc(env(safe-area-inset-top, 0px) + 128px); }
.tm-fullscreen[aria-pressed="true"] { background: var(--tm-primary); color: var(--tm-primary-ink); }

/* 自家地标（§15.2）：比一般标记大，用顾客主色，加 ✨ 光圈，下面一直显示名称 */
.tm-home { z-index: 900 !important; }
.tm-home .tm-pin { transform: scale(1.18); }
.tm-home .tm-pin:hover { transform: scale(1.28); }
.tm-home__halo {
  position: absolute; left: 29px; top: 27px; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 229, 138, .9) 30%, rgba(255, 229, 138, 0) 70%);
  pointer-events: none; animation: tm-glow 2.4s ease-in-out infinite;
}
.tm-home__spark { position: absolute; font-size: 14px; pointer-events: none; }
.tm-home__spark--a { left: -6px; top: -4px; }
.tm-home__spark--b { left: 52px; top: 30px; }
.tm-home__label {
  position: absolute; left: 50%; top: 70px; transform: translateX(-50%); max-width: 180px;
  padding: 2px 10px; border: 2px solid var(--tm-ink); border-radius: 999px; background: var(--tm-paper);
  font: 700 12px/1.4 var(--tm-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  box-shadow: 2px 2px 0 var(--tm-ink);
}
@keyframes tm-glow { 0%, 100% { opacity: .65; scale: .92; } 50% { opacity: 1; scale: 1.06; } }

/* ---------- 减少动态效果：关掉弹跳、摇晃、掉落，只保留淡入淡出 ---------- */
@media (prefers-reduced-motion: reduce) {
  .tm-pin, .tm-pin:hover, .tm-marker.is-selected .tm-pin { animation: none !important; transition: opacity .2s linear; }
  .tm-pin:hover { transform: none; }
  .tm-marker.is-selected .tm-pin { transform: scale(1.25); }
  .tm-marker.is-in .tm-pin { animation: tm-fade .2s linear backwards !important; animation-delay: 0ms !important; }
  .tm-marker.is-out .tm-pin { transform: none; }
  .tm-btn, .tm-chip, .tm-toast, .tm-sidebar { transition: opacity .2s linear, background-color .2s linear !important; }
  .tm-btn:hover, .tm-chip:hover, .tm-btn:active, .tm-chip:active { transform: none; }
  .tm-toast { transform: none !important; }
  .tm-loading__pin span, .tm-loading__pin::after { animation: none; }
  .tm-home__halo { animation: none; }
}

/* 后台预览模式的提示（只有已登入的管理员看得到） */
.tm-app[data-preview="1"]::after {
  content: "后台预览（包括草稿）"; position: fixed; z-index: 3000; left: 50%; bottom: 8px; transform: translateX(-50%);
  padding: 4px 12px; border: 2px solid var(--tm-ink); border-radius: 999px; background: #FFE58A;
  font: 600 12px/1.4 system-ui, sans-serif; pointer-events: none;
}
/* 选了地点时其他标记会变淡，但自家地标保持清楚 */
.tm-has-selection .tm-marker.tm-home .tm-pin { opacity: 1; }
