/* ============================================================
 * 路线广场 hub.css  v3.8.4 —— 移动优先卡片流
 * 桌面端在媒体查询里升级双列；类名全部 tmh- 前缀防冲突
 * v3.8.4：排序切换 + 搜索工具栏；无封面卡片改路线形状 SVG 兜底
 * ============================================================ */

.tmh-wrap {
  --tmh-pink: #e64980;
  --tmh-pink-d: #c2255c;
  --tmh-ink: #222;
  --tmh-gray: #777;
  --tmh-line: #eee;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 12px 40px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--tmh-ink);
}
.tmh-wrap * { box-sizing: border-box; }

/* —— Hero —— */
.tmh-hero {
  position: relative;
  border-radius: 20px;
  padding: 26px 22px 24px;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(135deg, #e64980 0%, #d6336c 55%, #b0204f 100%);
  box-shadow: 0 10px 24px rgba(214, 51, 108, .28);
  overflow: hidden;
}
.tmh-hero::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 150px; height: 150px;
  border: 12px solid rgba(255,255,255,.14);
  border-radius: 50%;
}
.tmh-hero-title {
  margin: 0; font-size: 24px; font-weight: 800; letter-spacing: .5px;
}
.tmh-hero-sub {
  margin: 6px 0 0; font-size: 13.5px; opacity: .92;
}
.tmh-hero-stat {
  margin: 14px 0 0; display: inline-block;
  font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.2);
  padding: 4px 12px; border-radius: 999px;
}

/* —— 工具栏（排序 + 搜索，v3.8.4）—— */
.tmh-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.tmh-sorts {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.tmh-sort {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #666 !important;
  text-decoration: none !important;
  transition: background .15s ease, color .15s ease;
}
.tmh-sort.is-on {
  background: var(--tmh-pink);
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(230,73,128,.32);
}
.tmh-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 150px;
  justify-content: flex-end;
}
.tmh-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 180px;
  font-size: 16px; /* ≥16px 防 iOS 聚焦自动放大 */
  line-height: 1.2;
  padding: 6px 14px;
  border: 1.5px solid #e3e5e8;
  border-radius: 999px;
  background: #fff;
  color: var(--tmh-ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.tmh-search input[type="search"]:focus { border-color: var(--tmh-pink); }
.tmh-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.tmh-search button {
  font-size: 13.5px; font-weight: 600;
  padding: 7px 16px;
  border: 0; border-radius: 999px;
  background: #2b2d31;
  color: #fff;
  cursor: pointer;
}
.tmh-search-clear {
  flex: 0 0 auto;
  font-size: 20px; line-height: 1;
  color: #999 !important;
  text-decoration: none !important;
  padding: 2px 4px;
}

/* —— 卡片列表 —— */
.tmh-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tmh-card {
  position: relative;
  display: block;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform .16s ease, box-shadow .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.tmh-card:active {
  transform: scale(.985);
  box-shadow: 0 1px 6px rgba(0,0,0,.10);
}
@media (hover: hover) {
  .tmh-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
}

/* 封面（v3.15.0）：右侧地图（SVG 折线兜底，JS canvas 渲染行程分享同款真实地图）；
   沿途照片 ≥3 张时左侧 1/5 竖排 3 张，<3 张纯地图 */
/* v3.15.6：封面高度统一——整个封面容器固定 aspect-ratio 16/9（桌面 16/8.6），
   内部照片列与地图均用 flex 自动拉伸填满该高度，两种布局天然等高；
   摒弃 v3.15.4/5 的 :has() 比例反推方案（地图被压成细带） */
.tmh-card-cover { position: relative; display: flex; gap: 2px; aspect-ratio: 16 / 9; }
.tmh-cover-map {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: #eaece6;
  overflow: hidden;
}
.tmh-cover-map .tmh-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tmh-cover-map .tmh-map-none {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.tmh-cover-map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.tmh-cover-photos {
  flex: 0 0 20%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tmh-cover-photos img {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.tmh-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.tmh-badge-loop { background: rgba(230,73,128,.92); color: #fff; }

/* 卡片正文 */
.tmh-card-body { padding: 12px 34px 13px 14px; }
.tmh-card-title {
  margin: 0 0 8px;
  font-size: 17px; font-weight: 800; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 起点 → 终点 */
.tmh-card-route {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: #555;
  margin-bottom: 10px;
  min-width: 0;
}
.tmh-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.tmh-dot-s { background: #2f9e44; }
.tmh-dot-e { background: var(--tmh-pink); }
.tmh-start, .tmh-end {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 38%;
}
.tmh-arrow { flex: 0 0 auto; color: #aaa; font-size: 12px; }
.tmh-end-loop { color: var(--tmh-gray); font-style: normal; }

/* 元信息 chips */
.tmh-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tmh-chip {
  font-size: 11.5px;
  color: #666;
  background: #f4f5f7;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.tmh-chip-author {
  background: #fff0f6;
  color: var(--tmh-pink-d);
  font-weight: 600;
}

/* 右侧箭头 */
.tmh-card-go {
  position: absolute;
  right: 10px; bottom: 16px;
  width: 22px; height: 22px;
  line-height: 20px; text-align: center;
  font-size: 20px; color: #ccc;
  font-weight: 300;
}

/* —— 空态 —— */
.tmh-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--tmh-gray);
}
.tmh-empty-emoji { font-size: 54px; margin-bottom: 10px; }
.tmh-empty p { margin: 0; font-size: 14px; }

/* —— 分页 —— */
.tmh-pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px;
}
.tmh-pager-btn {
  display: inline-block;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--tmh-pink);
  color: var(--tmh-pink) !important;
  background: #fff;
  text-decoration: none !important;
}
.tmh-pager-btn.is-disabled { border-color: #ddd; color: #bbb !important; }
.tmh-pager-n { font-size: 13px; color: var(--tmh-gray); }

/* v3.15.2 桌面 hero 改紧凑单行：标题与统计同一行 */
@media (min-width: 900px) {
  .tmh-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
  .tmh-hero-sub { margin: 0; flex: 1 1 auto; }
  .tmh-hero-stat { margin: 0; }
}

/* —— 桌面：双列 —— */
@media (min-width: 900px) {
  .tmh-wrap { max-width: 920px; padding: 20px 12px 60px; }
  .tmh-hero { padding: 14px 28px 12px; margin-bottom: 14px; }
  .tmh-hero-title { font-size: 22px; }
  .tmh-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
  }
  .tmh-card { width: calc(50% - 9px); }
  .tmh-card-cover { aspect-ratio: 16 / 8.6; }
}
