/* ================================================================
 *  行程动画攻略 · 样式（v2.9.1 锁页+story-pane滚）
 *  在 v2.9.0 主题原生纸张基础上，只加滚动控制：
 *  - body 锁死，页面不滚
 *  - #page flex column，header/footer 自然高度，wrapper flex:1 撑中间
 *  - 地图高度跟随 wrapper，不滚
 *  - 右栏 flex column，story-pane overflow-y:auto 唯一滚动区
 * ================================================================ */

/* 0. body 只锁高度和滚动，不做 flex —— 让 #page 保持 block 元素自然撑满宽度 */
body.page-template-travel-map-guide {
  overflow: hidden !important;
  height: 100vh !important;
}
body.admin-bar.page-template-travel-map-guide { height: calc(100vh - 32px) !important; }

/* #page 自己做 flex column，管 header/#main/footer 的高度分配 */
body.page-template-travel-map-guide #page {
  height: 100% !important;
  display: flex !important; flex-direction: column !important;
}

/* #main / .wrapper / .site-main：flex item + min-height:0 传递高度 */
body.page-template-travel-map-guide #main,
body.page-template-travel-map-guide .wrapper,
body.page-template-travel-map-guide .site-main {
  flex: 1 1 auto !important; min-height: 0 !important;
  display: flex !important; flex-direction: column !important;
}

body.page-template-travel-map-guide footer[role="contentinfo"] { flex: 0 0 auto !important; }

/* 1. wrapper：flex:1 撑中间，宽度跟主题 #page 走 */
.tmg-page-wrapper {
  display: flex !important; flex-direction: row !important;
  gap: 24px !important; align-items: stretch !important;
  padding: 16px 0 !important;
  flex: 1 1 auto !important; min-height: 0 !important; overflow: hidden !important;
}

/* 2. #tmg-app：撑满 wrapper 高度 */
#tmg-app {
  display: flex; flex-direction: row; gap: 24px; align-items: stretch;
  width: 100%; height: 100%; min-height: 0;
  color: inherit; font-family: inherit;
  --brand:#e64980; --brand-d:#b3305a; --mute:#8a8f96;
  box-sizing: border-box;
}
#tmg-app * { box-sizing: border-box; }

/* 加载/错误态 */
#tmg-app .tmg-loading, #tmg-app .tmg-error { display: flex; align-items: center; justify-content: center; padding: 60px 20px; font-size: 15px; color: #888; }
#tmg-app .tmg-error { color: #c0392b; }

/* v3.14.5：私密/不存在/游客空草稿等状态卡（404 兜底页与游客预览共用） */
#tmg-app .tmg-status-card {
  max-width: 460px; margin: 8vh auto; padding: 36px 26px;
  background: #fff; border: 1px solid #eee; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-sizing: border-box;
}
#tmg-app .tmg-status-icon { font-size: 44px; line-height: 1; margin-bottom: 14px; }
#tmg-app .tmg-status-msg { font-size: 17px; font-weight: 700; color: #1a1a1a; margin-bottom: 10px; }
#tmg-app .tmg-status-advice { font-size: 13.5px; color: #666; line-height: 1.7; margin: 0 0 18px; }
#tmg-app .tmg-status-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#tmg-app .tmg-status-link {
  display: inline-block; padding: 9px 20px; border-radius: 20px;
  border: 1px solid var(--brand); color: var(--brand); background: #fff;
  font-size: 13.5px; font-weight: 600; text-decoration: none; transition: .15s;
}
#tmg-app .tmg-status-link:hover { background: var(--brand); color: #fff; }
@media (max-width: 780px) {
  #tmg-app .tmg-status-card { margin: 6vh 16px; padding: 30px 20px; min-height: 56vh; justify-content: center; }
}

/* 3. 左栏：地图，高度跟随 wrapper，不滚 */
#tmg-app .tmg-left { flex: 0 0 60%; min-height: 0; }

#tmg-app .tmg-left .tmg-map-box {
  height: 100%;
  position: relative;
  border: 1px solid #ddd; border-radius: 4px; overflow: hidden;
  background: #e8e3d8; box-shadow: 0 2px 6px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
}
#tmg-app #map { position: relative; flex: 1 1 auto; min-height: 0; z-index: 1; }

/* 4. 右栏：flex column，story-pane 是唯一滚动区 */
#tmg-app .tmg-right-col {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex !important; flex-direction: column !important; overflow: hidden !important;
}

#tmg-app .tmg-right-col .tmg-meta-head { flex: 0 0 auto; padding: 0 0 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 12px; }
#tmg-app .tmg-right-col .tmg-meta-title { font-size: 26px; font-weight: 700; color: #1a1a1a; margin: 0 0 6px; line-height: 1.3; }
#tmg-app .tmg-right-col .tmg-meta-line { font-size: 13px; color: #5a5a5a; display: flex; gap: 14px; flex-wrap: wrap; }
#tmg-app .tmg-right-col .tmg-meta-line b { color: #1a1a1a; font-weight: 600; margin-right: 3px; }

/* 5. story-pane：唯一滚动区 */
#tmg-app .story-pane {
  flex: 1 1 auto !important; min-height: 0 !important;
  overflow-y: auto !important; padding-right: 4px; scroll-behavior: smooth;
}

/* 6. 旧右栏（热门行程）隐藏 */
#tmg-app .tmg-right { display: none !important; }

/* ============================================================
 * 地图 markers —— 全部摘自 mockup-guide-v1.html（原设计）
 * ============================================================ */

/* 蚂蚁线动画 */
.route-flow { animation: route-flow 2.6s linear infinite; }
@keyframes route-flow { to { stroke-dashoffset: -16; } }

/* 序号圆点 marker */
.num-marker { background: transparent !important; border: none !important; }
.num-dot {
  width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
  transition: transform .3s, opacity .3s;
}
.num-dot.pending { opacity: .4; }
/* v3.15.0：未打卡补录点——地震波脉冲动画，醒目提醒用户补充打卡 */
.num-dot.unchecked {
  opacity: 1 !important;
  border: 2px solid #ff9800;
  box-shadow: 0 0 0 0 rgba(255,152,0,.7), 0 1px 4px rgba(0,0,0,.28);
  animation: uncheckedPulse 1.8s ease-out infinite;
}
@keyframes uncheckedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,152,0,.7), 0 1px 4px rgba(0,0,0,.28); }
  70%  { box-shadow: 0 0 0 14px rgba(255,152,0,0), 0 1px 4px rgba(0,0,0,.28); }
  100% { box-shadow: 0 0 0 0 rgba(255,152,0,0), 0 1px 4px rgba(0,0,0,.28); }
}
.num-dot.current {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(29,78,216,.22), 0 1px 4px rgba(0,0,0,.3);
  z-index: 1000;
}

/* 车辆/当前位置 marker */
.pos-marker { background: transparent !important; border: none !important; transition: transform 1.05s cubic-bezier(.45,.05,.25,1); }
.pos-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: #1d4ed8;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  animation: posPulse 2.2s infinite;
}
@keyframes posPulse {
  0%   { box-shadow: 0 0 0 0 rgba(29,78,216,.55), 0 2px 8px rgba(0,0,0,.35); }
  70%  { box-shadow: 0 0 0 16px rgba(29,78,216,0),  0 2px 8px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 0 rgba(29,78,216,0),     0 2px 8px rgba(0,0,0,.35); }
}

/* 点击卡片后的脉冲闪烁 marker */
.flash-marker-wrap { position: relative; width: 80px; height: 80px; pointer-events: none; background: transparent !important; border: none !important; }
.flash-marker {
  position: absolute; left: 50%; top: 50%;
  width: 50px; height: 50px; margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(29,78,216,.4);
  border: 4px solid #1d4ed8;
  box-sizing: border-box;
  animation: flashPulse 1.5s cubic-bezier(.4,0,.2,1) 3;
}
@keyframes flashPulse {
  0%   { transform: scale(.6);  opacity: 1; box-shadow: 0 0 0 0 rgba(29,78,216,.6); }
  70%  { transform: scale(1.9); opacity: .4; box-shadow: 0 0 0 26px rgba(29,78,216,0); }
  100% { transform: scale(1.9); opacity: 0; box-shadow: 0 0 0 0 rgba(29,78,216,0); }
}

/* 地图控件 */
#tmg-app .map-top {
  position: relative !important;
  top: auto !important; left: auto !important; right: auto !important; z-index: auto !important;
  pointer-events: auto !important;
  flex: 0 0 auto;
  display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #eee;
}
#tmg-app .brand-tag { display: none; }  /* 隐藏 "地图驱动版·XXX" 抬头 */
#tmg-app .day-tabs { display: flex; gap: 1px; background: rgba(255,255,255,.94); padding: 2px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.10); }
#tmg-app .day-tab { min-width: 30px; height: 28px; padding: 0 8px; border-radius: 3px; border: 0; background: transparent; font-size: 11.5px; font-weight: 700; color: #555; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; }
#tmg-app .day-tab.active { background: var(--brand); color: #fff; }
#tmg-app .tmg-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
#tmg-app .tmg-back-btn, #tmg-app .tmg-guide-share, #tmg-app .tmg-play-btn, #tmg-app .tmg-mode-btn { border: 0; padding: 6px 11px; border-radius: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
#tmg-app .tmg-back-btn, #tmg-app .tmg-guide-share { background: rgba(255,255,255,.96); color: #333; }
#tmg-app .tmg-back-btn:hover, #tmg-app .tmg-guide-share:hover { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
#tmg-app .tmg-guide-share.tmg-poster-btn { background: var(--brand); color: #fff; }
#tmg-app .tmg-guide-share.tmg-poster-btn:hover { background: var(--brand-d); }
#tmg-app .tmg-copy-share.is-copied { background: #fce4ec; color: #c92a47; }
#tmg-app .tmg-copy-share.is-copy-fail { background: #fdecea; color: #b91c1c; }
#tmg-app .tmg-play-btn { background: var(--brand); color: #fff; display: inline-flex; align-items: center; gap: 4px; }
#tmg-app .tmg-play-btn:hover { background: var(--brand-d); }
#tmg-app .tmg-play-btn.playing { background: #1a1a1a; }
#tmg-app .tmg-play-btn .ico { font-size: 10px; line-height: 1; }
#tmg-app .tmg-mode-switch { display: inline-flex; background: rgba(255,255,255,.94); border-radius: 4px; padding: 1px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
#tmg-app .tmg-mode-btn { background: transparent; box-shadow: none; color: #666; padding: 4px 9px; }
#tmg-app .tmg-mode-btn.on { background: var(--brand); color: #fff; }
#tmg-app .road-badge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
#tmg-app .alt-strip { position: relative; flex: 0 0 auto; height: 40px; background: rgba(255,255,255,.96); border-top: 1px solid #ddd; display: flex; align-items: center; padding: 0 10px; }
#tmg-app .alt-strip canvas { flex: 1; height: 30px; }
#tmg-app .alt-strip .label { font-size: 9px; color: var(--mute); margin-right: 6px; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 1px; }
#tmg-app .alt-strip .alt-now { font-size: 10px; color: var(--brand-d); font-weight: 600; margin-left: 6px; min-width: 42px; }
#tmg-app .trip-bar { position: relative; flex: 0 0 auto; height: 4px; background: rgba(0,0,0,.08); border-radius: 2px; overflow: hidden; }
#tmg-app .trip-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .8s cubic-bezier(.45,.05,.25,1); }

/* 天头 + 节点卡 */
#tmg-app .day-section { margin-bottom: 24px; position: relative; }

/* v1.9.0：行程总结区块 */
#tmg-app .tmg-summary-block {
    margin: 8px 0 20px; padding: 16px 18px;
    background: linear-gradient(135deg, #fef9ec 0%, #fff8f0 100%);
    border: 1px solid #fde6a8; border-radius: 10px;
}
#tmg-app .tmg-summary-head {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px; font-size: 15px; font-weight: 700; color: #9a6b00;
}
#tmg-app .tmg-summary-ico { font-size: 16px; }
#tmg-app .tmg-summary-body {
    font-size: 14px; line-height: 1.8; color: #4a3a1a;
    white-space: pre-wrap; word-break: break-word;
}
#tmg-app .day-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 6px; border-bottom: 1px solid #f0f0f0; margin-bottom: 10px; }
#tmg-app .day-num { font-size: 30px; font-weight: 800; line-height: 1; color: inherit; opacity: .85; letter-spacing: -1px; }
#tmg-app .day-meta { font-size: 12px; color: var(--mute); }
#tmg-app .day-meta b { color: #3a3a3a; font-weight: 600; }
#tmg-app .day-route { font-size: 14px; color: #1a1a1a; font-weight: 600; margin-top: 2px; }
#tmg-app .node { padding: 12px 14px; border: 1px solid #e8e8e8; border-radius: 4px; background: #fff; margin-bottom: 8px; transition: .15s; position: relative; }
#tmg-app .node:hover { box-shadow: 0 2px 8px rgba(0,0,0,.05); border-color: #d0d0d0; }
#tmg-app .node.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(230,73,128,.15), 0 4px 12px rgba(0,0,0,.08); }
#tmg-app .node-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#tmg-app .node-ico { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; color: #fff; font-weight: 700; }
#tmg-app .node-title { font-weight: 600; font-size: 14px; color: #1a1a1a; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tmg-app .node-time { font-size: 11px; color: var(--mute); font-weight: 500; }
#tmg-app .node-alt { font-size: 11px; color: #666; font-weight: 500; }
#tmg-app .node-body { font-size: 13.5px; color: #3d4750; line-height: 1.8; padding-left: 36px; }
#tmg-app .node-body p { margin: 0 0 8px; }
#tmg-app .tmg-empty-hint { color: #9aa0a6; font-size: 12px; }

/* v1.8.20：多次到访时间线 */
#tmg-app .tmg-checkin-timeline { margin: 8px 0; }
#tmg-app .tmg-checkin-tl-item {
    border-left: 3px solid #e64980; padding: 6px 12px; margin-bottom: 8px;
    background: #fafafa; border-radius: 0 6px 6px 0;
}
#tmg-app .tmg-checkin-tl-date { font-size: 12px; font-weight: 700; color: #e64980; margin-bottom: 4px; }
#tmg-app .tmg-checkin-tl-desc { font-size: 13px; line-height: 1.6; color: #333; }
#tmg-app .tmg-checkin-photos { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
#tmg-app .tmg-checkin-photo { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
#tmg-app .node.unfilled { opacity: .85; }
/* v3.15.0：未打卡补录点——醒目警示，促使用户补充打卡信息或删除 */
#tmg-app .node.is-unchecked { background: #fff8e1; border: 1px solid #ffc107; border-radius: 8px; }
#tmg-app .tmg-unchecked-badge {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
    background: #ff9800; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.6;
    vertical-align: middle; white-space: nowrap;
}
#tmg-app .tmg-unchecked-badge-sm {
    display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px;
    background: #ff9800; color: #fff; font-size: 10px; font-weight: 700; line-height: 1.5;
    vertical-align: middle;
}
#tmg-app .tmg-unchecked-tip {
    margin-top: 8px; padding: 8px 12px; border-radius: 6px; background: #fff3cd;
    border: 1px dashed #ffc107; color: #8a6d00; font-size: 13px; line-height: 1.6;
}
#tmg-app .tmg-chips { display: flex; gap: 5px; flex-wrap: wrap; padding-left: 36px; margin: 4px 0 6px; }
#tmg-app .tmg-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 12px; background: #f5f5f5; color: #555; font-size: 11px; font-weight: 500; line-height: 1.6; }
#tmg-app .tmg-chip-link { background: #f0f0f0; color: var(--brand-d); text-decoration: none; }
#tmg-app .tmg-intel { margin: 8px 0 4px; padding: 8px 12px; border-radius: 4px; background: #fff8e1; border-left: 3px solid #ff9800; }
#tmg-app .tmg-intel-title { font-size: 12px; font-weight: 600; color: #b35a00; margin-bottom: 2px; }
#tmg-app .tmg-intel-body { font-size: 12px; color: #5a4a2a; line-height: 1.6; }
#tmg-app .node-photos {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; padding-left: 0; margin: 8px 0;
}
#tmg-app .node-photo-link { display: block; }
#tmg-app .node-photo {
  width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 4px;
  cursor: zoom-in; display: block;
}

/* 编辑按钮 */
#tmg-app .tmg-inline-edit {
  background: none; border: 1px dashed var(--brand-d); color: var(--brand-d);
  padding: 1px 8px; border-radius: 3px; font-size: 12px; cursor: pointer;
  margin-left: auto; align-self: center;
}
#tmg-app .tmg-inline-edit:hover { background: var(--brand-d); color: #fff; }

/* 编辑态 */
#tmg-app .node.editing { border-color: var(--brand-d); box-shadow: 0 0 0 2px rgba(0,150,136,.15); }
#tmg-app .node.editing .node-title[contenteditable="true"] {
  outline: 1px solid var(--brand-d); outline-offset: 2px;
  padding: 2px 4px; background: #fff; border-radius: 3px; cursor: text;
}
#tmg-app .tmg-edit-body {
  width: 100%; box-sizing: border-box; padding: 8px;
  border: 1px solid #ccc; border-radius: 4px;
  font-family: inherit; font-size: 13px; line-height: 1.6;
  resize: vertical; background: #fff;
}
#tmg-app .tmg-edit-actions { margin-top: 8px; display: flex; gap: 8px; }
#tmg-app .tmg-edit-save, #tmg-app .tmg-edit-cancel {
  padding: 4px 14px; border-radius: 3px; font-size: 13px; cursor: pointer;
}
#tmg-app .tmg-edit-save {
  background: var(--brand-d); color: #fff; border: 1px solid var(--brand-d);
}
#tmg-app .tmg-edit-save:hover { background: var(--brand-darker); }
#tmg-app .tmg-edit-cancel {
  background: #fff; color: #666; border: 1px solid #ddd;
}
#tmg-app .tmg-edit-cancel:hover { background: #f5f5f5; }

/* 编辑态图片区 */
#tmg-app .tmg-edit-photo-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
#tmg-app .tmg-edit-photo { position: relative; }
#tmg-app .tmg-edit-photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; display: block; }
#tmg-app .tmg-edit-photo-del {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e74c3c; color: #fff; border: none; font-size: 11px;
  cursor: pointer; line-height: 1; padding: 0;
}
#tmg-app .tmg-edit-photo-empty {
  aspect-ratio: 1/1;
  border: 1px dashed #ccc; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #aaa;
}
#tmg-app .tmg-edit-photo-upload {
  display: inline-flex; align-items: center; justify-content: center;
  aspect-ratio: 1/1;
  border: 1px dashed var(--brand-d);
  border-radius: 4px; color: var(--brand-d); font-size: 11px;
  cursor: pointer; background: #fff;
}
#tmg-app .tmg-edit-photo-upload:hover { background: rgba(0,150,136,.06); }

/* ============================================================
 * v3.7.2 手机端：原生 App 底部抽屉（Bottom Sheet）
 *  - 地图全屏铺底，尺寸永不随抽屉变化（Leaflet 无需重算）
 *  - 攻略为底部白色圆角抽屉，三档磁吸：peek 窥视 / half 半屏(默认) / full 沉浸
 *  - 把手跟手拖拽 + 松手按速度/距离吸附；文章滚到顶继续下拉即拖抽屉
 * 桌面端不显示把手，布局完全不变
 * ============================================================ */
#tmg-app .tmg-m-handle { display: none; }

@media (max-width: 780px) {
  /* —— 锁页：iOS 用 dvh 适配动态地址栏；html 也禁滚（防某些安卓浏览器出常驻滚动条）—— */
  html:has(body.page-template-travel-map-guide) { overflow: hidden !important; }
  body.page-template-travel-map-guide {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  body.admin-bar.page-template-travel-map-guide {
    height: calc(100vh - 46px) !important;
    height: calc(100dvh - 46px) !important;
  }
  body.page-template-travel-map-guide #page { padding: 0 !important; }
  /* 手机端隐藏主题页眉/页脚，空间全给地图 + 攻略（返回走"我的足迹"） */
  body.page-template-travel-map-guide #masthead,
  body.page-template-travel-map-guide footer[role="contentinfo"] { display: none !important; }

  .tmg-page-wrapper {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
  }
  #tmg-app {
    flex-direction: column !important; gap: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* —— 地图：全屏铺底（抽屉只是覆盖层，#map 尺寸永不变）—— */
  #tmg-app .tmg-left {
    position: absolute !important;
    inset: 0 !important;
    width: auto !important; height: auto !important;
    flex: none !important;
    display: block !important;
  }
  #tmg-app .tmg-left .tmg-map-box {
    height: 100% !important;
    border: 0 !important; border-radius: 0 !important;
  }
  #tmg-app .alt-strip { display: none; }                  /* 海拔条手机端省空间 */
  #tmg-app .trip-bar { display: none; }                  /* 进度条被抽屉遮挡，无意义 */

  /* —— 攻略抽屉：top 驱动三档，280ms 磁吸动画 —— */
  #tmg-app .tmg-right-col {
    position: absolute !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    top: 42dvh;                          /* 默认 half */
    max-width: none !important;
    display: flex !important; flex-direction: column !important;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0,0,0,.16);
    overflow: hidden !important;
    z-index: 10;
    transition: top .28s cubic-bezier(.22,.61,.36,1);
    will-change: top;
  }
  #tmg-app.tmg-s-peek .tmg-right-col { top: calc(100% - 76px); }
  #tmg-app.tmg-s-half .tmg-right-col { top: 42dvh; }
  #tmg-app.tmg-s-full .tmg-right-col { top: 12dvh; }
  #tmg-app.tmg-s-drag .tmg-right-col { transition: none; }

  /* —— 抽屉把手（白色圆角顶条内）—— */
  #tmg-app .tmg-m-handle {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 24px; width: 100%;
    border: 0; background: #fff; border-radius: 16px 16px 0 0;
    padding: 0; cursor: pointer;
    touch-action: none;
  }
  #tmg-app .tmg-m-grab {
    width: 44px; height: 4px; border-radius: 2px;
    background: #d2d5da;
  }
  #tmg-app .tmg-m-chev {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: #b0b4ba; line-height: 1;
  }

  /* —— 文章区：抽屉内部独立滚动；peek 时被自然裁掉 —— */
  #tmg-app .story-pane {
    flex: 1 1 auto !important; min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 12px 28px;
    scrollbar-width: none;          /* 真机不显示常驻滚动条（不影响手势滚动）*/
  }
  #tmg-app .story-pane::-webkit-scrollbar { display: none; }

  /* —— 地图控件：左上角 加减号→竖排D标签；顶部右侧横排操作钮 —— */
  #tmg-app .map-top {
    position: absolute !important;
    top: 8px !important; left: 8px !important; right: 8px !important;
    bottom: auto !important; height: 0;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    display: block !important;
    z-index: 5 !important;
    pointer-events: none !important;
    transition: opacity .2s;
  }
  #tmg-app .map-top > * { pointer-events: auto; }
  /* 沉浸阅读时地图控件淡出（顶部只剩一条地图） */
  #tmg-app.tmg-s-full .map-top { opacity: 0; pointer-events: none !important; }

  /* D1/D2/D3 按钮尺寸 */
  #tmg-app .day-tab { width: 30px; min-width: 30px !important; height: 27px; border-radius: 5px; }

  /* 操作钮横排：贴地图最上边，左避缩放控件，右避图层按钮 */
  #tmg-app .tmg-actions {
    position: absolute !important;
    top: 0; left: 48px; right: 42px;   /* 左避 zoom（宽约 48px），右避图层（宽约 42px） */
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 4px;
    margin: 0 !important;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  #tmg-app .tmg-actions::-webkit-scrollbar { display: none; }
  #tmg-app .tmg-actions > * { flex: 0 0 auto; }

  /* D1/D2/D3：竖排贴在加减号正下方 */
  #tmg-app .day-tabs {
    position: absolute !important;
    left: 0; top: 68px;
    flex-direction: column !important;
    gap: 3px;
    padding: 3px !important;
    border-radius: 8px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }

  /* 里程胶囊：手机端挂进按钮排末尾（分享按钮后，JS 移入），不再独占一行 */
  #tmg-app .road-badge { display: none; }
  #tmg-app .tmg-actions .road-badge {
    display: block;
    position: static; transform: none;
    flex: 0 0 auto;
    font-size: 10px; line-height: 27px; padding: 0 7px;
    max-width: 52vw;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }

  /* 图层切换按钮：Leaflet 触摸设备默认 44px，手机端缩到 27px——与「播放」等操作钮同高，
     上下端对齐（操作钮行顶部在地图顶下方 8px，故图层控件 margin-top 同步改 8px） */
  #tmg-app .leaflet-touch .leaflet-control-layers-toggle {
    width: 27px; height: 27px;
    background-size: 20px 20px;
  }
  #tmg-app .leaflet-touch .leaflet-top .leaflet-control-layers { margin-top: 8px; }
  #tmg-app .tmg-back-btn,
  #tmg-app .tmg-guide-share,
  #tmg-app .tmg-play-btn,
  #tmg-app .tmg-mode-btn {
    height: 27px !important;
    padding: 5px 8px !important;
    font-size: 11px !important;
    background: rgba(255,255,255,.9);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  #tmg-app .tmg-play-btn,
  #tmg-app .tmg-guide-share.tmg-poster-btn { background: var(--brand); }

  /* —— 文章头紧凑 —— */
  #tmg-app .tmg-right-col .tmg-meta-head {
    flex: 0 0 auto;
    padding: 2px 12px 8px; margin-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
  }
  #tmg-app .tmg-right-col .tmg-meta-title { font-size: 19px; }
  #tmg-app .tmg-right-col .tmg-meta-line { font-size: 12px; gap: 10px; }
  #tmg-app .tmg-action-bar { margin-top: 8px; }
  #tmg-app .tmg-action-btn { padding: 7px 12px; font-size: 12.5px; }
  #tmg-app .day-section { margin-bottom: 18px; }

  /* —— 节点卡片手机排版 —— */
  #tmg-app .node { padding: 10px 12px; }
  #tmg-app .node-title { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
  #tmg-app .node-body { padding-left: 0; font-size: 14px; line-height: 1.75; }
  #tmg-app .tmg-chips { padding-left: 0; }
  #tmg-app .node-ico { width: 26px; height: 26px; font-size: 12px; }

  /* —— 未登录引导条：登录/注册并排，提示文字换行 —— */
  #tmg-app .tmg-guest-bar { align-items: center; row-gap: 6px; }
  #tmg-app .tmg-guest-login { background: #e64980; color: #fff; border-color: #e64980; flex: 1 1 0; justify-content: center; }
  #tmg-app .tmg-guest-register { background: #fff; color: #e64980; border-color: #e64980; flex: 1 1 0; justify-content: center; }
  #tmg-app .tmg-guest-tip { flex: 1 1 100%; font-size: 11.5px; color: #8a8f96; text-align: center; }
}

/* ========================================================
 * v3.4.0：发布 + 导入行程猫按钮（动态攻略页头部）
 * ======================================================== */
#tmg-app .tmg-action-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
#tmg-app .tmg-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 18px; border: 1px solid #e0e0e0;
  background: #fff; font-size: 13px; cursor: pointer;
  text-decoration: none; color: #333; transition: all 0.15s;
}
#tmg-app .tmg-action-btn:hover {
  border-color: #e64980; color: #e64980; background: #fff5f8;
}
#tmg-app .tmg-action-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#tmg-app .tmg-publish-btn { background: #e64980; color: #fff; border-color: #e64980; }
#tmg-app .tmg-publish-btn:hover { background: #d6336c; color: #fff; }
/* v3.6.8：已发布状态——查看按钮白底描边，更新按钮粉色；审核中琥珀色 */
#tmg-app .tmg-viewpub-btn { font-weight: 600; }
#tmg-app .tmg-viewpub-btn:hover { background: #fff5f8; }
#tmg-app .tmg-pending-btn { background: #f59f00; color: #fff; border-color: #f59f00; }
#tmg-app .tmg-pending-btn:hover { background: #e8890c; color: #fff; border-color: #e8890c; }

/* ========================================================
 * v3.4.0：静态路书文章样式（发布后 wp_post 用）
 * ======================================================== */
.entry-content .tmg-guide-header { margin-bottom: 1.5em; }
/* dhx-seo 0.1.0：原 <h1> 降级为 div.tmg-guide-title，视觉沿用父主题 .entry-content h1（21px/1.5） */
.entry-content .tmg-guide-header .tmg-guide-title {
	font-size: 21px;
	font-size: 1.5rem;
	font-weight: bold;
	line-height: 1.5;
	margin: 24px 0 6px;
}
.entry-content .tmg-guide-meta { color: #888; font-size: 13px; margin-bottom: 12px; }
.entry-content .tmg-guide-intro { margin-bottom: 16px; padding: 12px 16px; background: #fafafa; border-left: 3px solid #e64980; border-radius: 0 4px 4px 0; }
.entry-content .tmg-guide-intro-title { font-weight: 700; margin-bottom: 8px; font-size: 15px; color: #e64980; }
.entry-content .tmg-minimap-wrap { margin-bottom: 20px; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.entry-content .tmg-minimap { width: 100%; height: 380px; background: #e9ecef; }
.entry-content .tmg-minimap-hint { background: #fff; padding: 8px 14px; font-size: 12px; color: #666; border-top: 1px solid #f0f0f0; }
.entry-content .tmg-minimap-hint a { color: #e64980; text-decoration: none; font-weight: 600; }
.entry-content .tmg-minimap-hint a:hover { text-decoration: underline; }

.entry-content .tmg-day {
  font-size: 1.1em; color: #e64980;
  border-bottom: 2px solid #e64980; padding-bottom: 6px;
  margin: 28px 0 14px;
}
.entry-content .tmg-node { margin-bottom: 18px; padding-left: 4px; }
.entry-content .tmg-node-title { font-size: 1em; margin-bottom: 6px; }
.entry-content .tmg-node-title a { color: #e64980; text-decoration: none; }
.entry-content .tmg-node-title a:hover { text-decoration: underline; }
.entry-content .tmg-node-attraction { color: #999; font-weight: normal; font-size: 0.85em; }
.entry-content .tmg-node-desc { color: #444; line-height: 1.7; }
.entry-content .tmg-node-photos img { max-width: 100%; height: auto; margin: 6px 0; border-radius: 4px; }

/* 推荐区 */
.entry-content .tmg-recommend { margin-top: 40px; padding-top: 24px; border-top: 1px solid #eee; }
.entry-content .tmg-recommend-title { font-size: 1.05em; margin-bottom: 12px; color: #333; }
.entry-content .tmg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.entry-content .tmg-card { display: block; padding: 14px; border: 1px solid #eee; border-radius: 8px; text-decoration: none; color: inherit; transition: box-shadow 0.15s; }
.entry-content .tmg-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); border-color: #e64980; }
.entry-content .tmg-card-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.entry-content .tmg-card-desc { font-size: 12px; color: #888; margin-bottom: 6px; line-height: 1.5; }
.entry-content .tmg-card-meta { font-size: 11px; color: #aaa; }
.entry-content .tmg-empty { color: #999; font-size: 13px; text-align: center; padding: 20px; }

/* 分享栏 */
.entry-content .tmg-share-bar { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; display: flex; flex-wrap: wrap; gap: 16px; }
.entry-content .tmg-share-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-content .tmg-share-label { font-size: 13px; color: #666; }
.entry-content .tmg-share-btn {
  display: inline-block; padding: 6px 14px; border-radius: 18px;
  background: #f5f5f5; border: 1px solid #e0e0e0; font-size: 12px;
  text-decoration: none; color: #555; cursor: pointer; transition: all 0.15s;
}
.entry-content .tmg-share-btn:hover { background: #e64980; color: #fff; border-color: #e64980; }
.entry-content .tmg-share-btn.tmg-import-planner { background: #4a90d9; color: #fff; border-color: #4a90d9; }
.entry-content .tmg-share-btn.tmg-import-planner:hover { background: #357abd; }
.entry-content .tmg-share-btn.tmg-poster-btn { background: #e64980; color: #fff; border-color: #e64980; font-weight: 600; }
.entry-content .tmg-share-btn.tmg-poster-btn:hover { background: #d6336c; border-color: #d6336c; }
.entry-content .tmg-share-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* v3.4.4: 节点图片画廊 */
.entry-content .tmg-node-photos {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.entry-content .tmg-node-photos img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.2s;
  background: #eee;
}
.entry-content .tmg-node-photos img:hover { transform: scale(1.03); }
/* 单张图用更大比例 */
.entry-content .tmg-node-photos:has(img:only-child) img {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
/* v3.4.5: CSS-only lightbox 放大 */
.entry-content .tmg-photo-link { display: block; }
.entry-content .tmg-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: none; align-items: center; justify-content: center;
  margin: 0; padding: 20px;
  animation: tmg-fade 0.2s ease;
}
.entry-content .tmg-lightbox:target,
/* v3.17.2：JS 接管开关后的 class 通道（pushState 不触发 :target 的浏览器滚动） */
.entry-content .tmg-lightbox.tmg-lb-open { display: flex; }
.entry-content .tmg-lightbox img {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.entry-content .tmg-lb-close {
  position: absolute; top: 16px; right: 24px;
  color: #fff; font-size: 28px; text-decoration: none;
  width: 40px; height: 40px; line-height: 40px; text-align: center;
  border-radius: 50%; background: rgba(255,255,255,0.15);
  transition: background 0.2s;
}
.entry-content .tmg-lb-close:hover { background: rgba(255,255,255,0.35); }
@keyframes tmg-fade { from { opacity: 0; } to { opacity: 1; } }

/* v3.6.0: 海报弹层 */
.tmg-poster-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  animation: tmg-fade 0.2s ease;
}
.tmg-poster-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; max-width: 420px; width: 100%; margin: auto;
}
.tmg-poster-loading {
  color: #fff; font-size: 16px; padding: 80px 0; text-align: center;
}
.tmg-poster-img {
  width: 100%; max-width: 380px; height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  background: #fff;
}
.tmg-poster-actions { display: flex; gap: 12px; }
.tmg-poster-actions .tmg-poster-download,
.tmg-poster-actions .tmg-poster-closebtn {
  display: inline-block; padding: 10px 26px; border-radius: 22px;
  font-size: 15px; cursor: pointer; border: none; text-decoration: none;
}
.tmg-poster-download {
  background: #e64980; color: #fff !important; font-weight: 600;
}
.tmg-poster-download:hover { background: #d6336c; }
.tmg-poster-closebtn {
  background: rgba(255,255,255,0.16); color: #fff;
}
.tmg-poster-closebtn:hover { background: rgba(255,255,255,0.3); }
.tmg-poster-copylink {
  background: #fff; color: #e64980 !important; font-weight: 600;
}
.tmg-poster-copylink:hover { background: #ffe3ef; }
.tmg-poster-tip { color: rgba(255,255,255,0.7); font-size: 13px; margin: 0; }

/* v3.14.0：预想图 / 实拍图角标 + 行前预想标签 + 生命周期提示 */
#tmg-app .node-photo-link { position: relative; }
#tmg-app .node-photo-badge {
  position: absolute; left: 0; bottom: 0;
  font-size: 10px; line-height: 1;
  padding: 2px 5px; color: #fff;
  border-top-right-radius: 6px;
}
#tmg-app .node-photo-badge.is-expect { background: rgba(180, 83, 9, 0.82); }
#tmg-app .node-photo-badge.is-real   { background: rgba(22, 101, 52, 0.82); }
#tmg-app .node-body-label {
  font-size: 12px; font-weight: 600; color: #666; margin: 6px 0 2px;
}
#tmg-app .tmg-action-bar { flex-wrap: wrap; align-items: center; gap: 8px; }
#tmg-app .tmg-lifecycle-tip {
  font-size: 12px; color: #888; line-height: 1.4;
}

/* v3.8.3：海报弹窗手机端优化——长按保存可用 + 按钮竖排 */
.tmg-poster-img { -webkit-touch-callout: default; touch-callout: default; }
@media (max-width: 780px) {
  .tmg-poster-overlay { padding: 16px 10px; }
  .tmg-poster-box { gap: 12px; }
  .tmg-poster-img { max-width: 100%; max-height: 70vh; width: auto; object-fit: contain; }
  .tmg-poster-actions { flex-direction: column; width: 100%; gap: 8px; }
  .tmg-poster-actions .tmg-poster-download,
  .tmg-poster-actions .tmg-poster-closebtn,
  .tmg-poster-copylink { width: 100%; text-align: center; padding: 12px 0; font-size: 15px; }
  .tmg-poster-tip { font-size: 12px; text-align: center; padding: 0 8px; }
}
