/* 主頁功能導覽（非 WELCOME 引導）— 四主功能並排儀表板 */
.tm-hub {
  --hub-ink: var(--text-main, #2C221E);
  --hub-brand: var(--color-brand, #1F5A85);
  --hub-paper: var(--card-bg, #fffdf8);
  --hub-panel: var(--bg-surface, #f3ebe0);
  --hub-line: var(--border-soft, #cbbba8);
  --hub-muted: var(--text-muted, #6b5d52);
  padding: 6px 4px 28px;
  color: var(--hub-ink);
}

/* —— Brand strip —— */
.tm-hub__brand {
  background:
    radial-gradient(ellipse 70% 80% at 8% 0%, rgba(31, 90, 133, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 60% at 92% 30%, rgba(141, 110, 99, 0.12), transparent 50%),
    linear-gradient(165deg, var(--card-bg) 0%, var(--bg-surface) 100%);
  border: 2px solid var(--hub-ink);
  border-radius: 16px;
  box-shadow: var(--shadow-flat, 2px 2px 0 var(--hub-ink));
  padding: 16px 18px 14px;
  margin-bottom: 14px;
}

.tm-hub__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--hub-brand);
  text-transform: uppercase;
}

.tm-hub__title {
  margin: 0 0 4px;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--hub-ink);
}

.tm-hub__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted, #5c4f45);
  max-width: 36em;
}

/* —— Dashboard：四主功能同時顯示 —— */
.tm-hub-dash {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
}

.tm-hub-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 14px 12px;
  border: 2px solid var(--hub-ink);
  border-radius: 18px;
  background:
    linear-gradient(165deg, var(--card-bg) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-flat-lg, 4px 4px 0 var(--hub-ink));
}

.tm-hub-card--panel {
  min-height: 280px;
}

.tm-hub-card--map {
  background: linear-gradient(160deg, color-mix(in srgb, #34d399 16%, var(--card-bg)) 0%, var(--card-bg) 55%);
}
.tm-hub-card--colony {
  background: linear-gradient(160deg, color-mix(in srgb, #818cf8 16%, var(--card-bg)) 0%, var(--card-bg) 55%);
}
.tm-hub-card--overview {
  background: linear-gradient(160deg, color-mix(in srgb, #a78bfa 10%, var(--bg-surface)) 0%, var(--card-bg) 55%);
}
.tm-hub-card--sea {
  background: linear-gradient(160deg, color-mix(in srgb, #38bdf8 16%, var(--card-bg)) 0%, var(--card-bg) 55%);
}
.tm-hub-card--market {
  background: linear-gradient(160deg, color-mix(in srgb, #f472b6 14%, var(--card-bg)) 0%, var(--card-bg) 55%);
}
.tm-hub-card--lfg {
  background: linear-gradient(160deg, color-mix(in srgb, #34d399 16%, var(--card-bg)) 0%, var(--card-bg) 55%);
}

.tm-hub-card__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tm-hub-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid var(--hub-ink);
  background: var(--hub-panel);
  color: var(--hub-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tm-hub-card__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tm-hub-card--map .tm-hub-card__icon { background: #dcfce7; color: #15803d; }
.tm-hub-card--colony .tm-hub-card__icon { background: #e0e7ff; color: #3730a3; }
.tm-hub-card--overview .tm-hub-card__icon { background: #f3ebe0; color: #7c5c3e; }
.tm-hub-card--sea .tm-hub-card__icon { background: #e0f2fe; color: #0369a1; }
.tm-hub-card--rules .tm-hub-card__icon { background: var(--warn-bg); color: #b45309; }
.tm-hub-card--market .tm-hub-card__icon { background: #fce7f3; color: #be185d; }
.tm-hub-card--lfg .tm-hub-card__icon { background: var(--ok-bg); color: var(--ok-text); }
.tm-hub-card--news .tm-hub-card__icon { background: var(--bg-surface); color:var(--text-muted); }
.tm-hub-card--rank .tm-hub-card__icon,
.tm-hub-card--game-leaderboard .tm-hub-card__icon,
.tm-hub-card--leaderboard .tm-hub-card__icon { background: #ffedd5; color: #c2410c; }
.tm-hub-card--hall .tm-hub-card__icon,
.tm-hub-card--hall-of-fame .tm-hub-card__icon { background: #ecfeff; color: #0e7490; }
.tm-hub-card--fun .tm-hub-card__icon { background: var(--warn-bg); color: #a16207; }
.tm-hub-card--seller .tm-hub-card__icon,
.tm-hub-card--seller-desk .tm-hub-card__icon { background: #ede9fe; color: #6d28d9; }
.tm-hub-card--chat .tm-hub-card__icon { background: #e0f2fe; color: #0284c7; }

.tm-hub-card__titles {
  min-width: 0;
  flex: 1;
}

.tm-hub-card__name {
  margin: 0 0 2px;
  font-size: clamp(16px, 2.6vw, 20px);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tm-hub-card__desc {
  margin: 0;
  font-size: 12px;
  color: #5c4f45;
  line-height: 1.4;
}

.tm-hub-card__preview {
  flex: 1;
  min-height: 140px;
  border: 1.5px solid var(--hub-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  overflow: hidden;
}

.tm-hub-card__cta {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin-top: auto;
  padding: 10px 14px;
  border: 2px solid var(--hub-ink);
  border-radius: 12px;
  background: var(--hub-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-flat, 2px 2px 0 var(--hub-ink));
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tm-hub-card__cta:hover,
.tm-hub-card__cta:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-flat-lg, 4px 4px 0 var(--hub-ink));
  outline: none;
}

.tm-hub-card__cta:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--hub-ink);
}

/* —— Live previews —— */
.tm-hub-preview__stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.tm-hub-preview__stat strong {
  font-size: 28px;
  font-weight: 900;
  color: var(--hub-brand);
  line-height: 1;
}

.tm-hub-preview__stat span,
.tm-hub-preview__stat--inline span {
  font-size: 13px;
  font-weight: 700;
  color: var(--hub-muted);
}

.tm-hub-preview__stat--inline {
  margin-bottom: 8px;
}

.tm-hub-preview__stat--inline strong {
  font-size: 18px;
}

.tm-hub-preview__thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.tm-hub-preview__thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid var(--hub-ink);
  overflow: hidden;
  background: #e8e0d4;
}

.tm-hub-preview__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tm-hub-preview__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--hub-muted);
  font-size: 14px;
}

/* 桌遊海：封面由右漸入、向左漸出的連續滾動 */
.tm-hub-preview--sea {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.tm-hub-sea-rail {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1.5px solid var(--hub-line);
  background: rgba(255, 255, 255, 0.55);
  padding: 8px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.tm-hub-sea-rail__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  padding: 0 10px;
  will-change: transform;
}

.tm-hub-sea-rail__track--scroll {
  animation: tm-hub-sea-marquee 36s linear infinite;
}

.tm-hub-sea-rail__item {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1.5px solid var(--hub-ink);
  overflow: hidden;
  background: #e8e0d4;
  box-shadow: 1px 1px 0 rgba(44, 34, 30, 0.2);
}

.tm-hub-sea-rail__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes tm-hub-sea-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .tm-hub-sea-rail__track--scroll {
    animation: none;
  }
}

.tm-hub-preview__empty {
  margin: 18px 0 0;
  color: var(--hub-muted);
  font-size: 13px;
  font-weight: 600;
}

/* —— Real Leaflet mini-map —— */
.tm-hub-preview--map {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 168px;
}

.tm-hub-mini-map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 168px;
  height: 168px;
  border-radius: 10px;
  border: 1.5px solid #86efac;
  overflow: hidden;
  background: #dbeafe;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.tm-hub-mini-map .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 168px;
  font: inherit;
  background: #dbeafe;
}

.tm-hub-mini-map .leaflet-tile-pane {
  opacity: 1;
}

.tm-hub-preview__map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-hub-preview__map-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--hub-ink);
  background: var(--card-bg);
  color: #14532d;
}

.tm-hub-preview__map-chip--store {
  color: #1d4ed8;
  border-color: #1e3a8a;
  background: #eff6ff;
}

.tm-hub-preview__map-chip--lfg {
  color: var(--ok-text);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.tm-hub-preview__count {
  font-weight: 700;
  color: var(--hub-muted);
  font-size: 12px;
}

.tm-hub-preview__bullets,
.tm-hub-preview__list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 13px;
  line-height: 1.55;
  color: #3f342c;
  font-weight: 600;
}

.tm-hub-preview__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 168px;
  overflow-y: auto;
}

.tm-hub-preview__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid #e4d8c8;
}

.tm-hub-preview__badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(44, 34, 30, 0.28);
  background: var(--card-bg);
  color:var(--text-muted);
  opacity: 0.9;
}

.tm-hub-preview__row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tm-hub-preview__row-body strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-hub-preview__meta,
.tm-hub-preview__snip {
  font-size: 11px;
  color: var(--hub-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-hub-preview__row-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--hub-line);
  flex-shrink: 0;
}

.tm-hub-preview__row-img--empty {
  display: inline-block;
  background: #e8e0d4;
}

.tm-hub-preview--teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  text-align: center;
  color: #5c4f45;
  font-size: 14px;
  font-weight: 600;
}

.tm-hub-preview__teaser-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 2px solid var(--hub-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hub-panel);
  color: var(--hub-brand);
}

.tm-hub-preview__teaser-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* —— Secondary feature grid —— */
.tm-hub-sec {
  margin-top: 4px;
  padding: 14px 12px 12px;
  border: 2px solid var(--hub-ink);
  border-radius: 16px;
  background:
    linear-gradient(165deg, var(--card-bg) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-flat, 2px 2px 0 var(--hub-ink));
}

.tm-hub-sec__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 900;
  color: var(--hub-muted);
  letter-spacing: 0.04em;
}

.tm-hub-sec__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.tm-hub-sec__btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 86px;
  padding: 10px 8px 8px;
  border: 1.5px solid var(--hub-ink);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--hub-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 1px 1px 0 var(--hub-ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  overflow: visible;
}

.tm-hub-sec__btn:hover,
.tm-hub-sec__btn:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--hub-ink);
  outline: none;
  background: var(--card-bg);
}

.tm-hub-sec__btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--hub-ink);
}

.tm-hub-sec__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1.5px solid var(--hub-ink);
  background: var(--hub-panel);
  color: var(--hub-brand);
  overflow: visible;
}

.tm-hub-sec__icon svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tm-hub-sec__label {
  display: block;
  width: 100%;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.tm-hub-sec__btn--rules .tm-hub-sec__icon { background: var(--warn-bg); color: #b45309; }
.tm-hub-sec__btn--market .tm-hub-sec__icon { background: #fce7f3; color: #be185d; }
.tm-hub-sec__btn--lfg .tm-hub-sec__icon { background: var(--ok-bg); color: var(--ok-text); }
.tm-hub-sec__btn--news .tm-hub-sec__icon { background: var(--bg-surface); color:var(--text-muted); }
.tm-hub-sec__btn--rank .tm-hub-sec__icon { background: #ffedd5; color: #c2410c; }
.tm-hub-sec__btn--hall .tm-hub-sec__icon { background: #ecfeff; color: #0e7490; }
.tm-hub-sec__btn--fun .tm-hub-sec__icon { background: var(--warn-bg); color: #a16207; }
.tm-hub-sec__btn--seller .tm-hub-sec__icon { background: #ede9fe; color: #6d28d9; }
.tm-hub-sec__btn--chat .tm-hub-sec__icon { background: #e0f2fe; color: #0284c7; }

/* —— Motion (opacity only — transform breaks Leaflet tiles) —— */
@keyframes tm-hub-brand-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tm-hub--enter .tm-hub__brand {
  animation: tm-hub-brand-in 0.36s ease both;
}

.tm-hub--enter .tm-hub-dash {
  animation: none;
}

.tm-hub--enter .tm-hub-dash .tm-hub-card:nth-child(1) { animation: tm-hub-brand-in 0.34s ease 0.04s both; }
.tm-hub--enter .tm-hub-dash .tm-hub-card:nth-child(2) { animation: tm-hub-brand-in 0.34s ease 0.08s both; }
.tm-hub--enter .tm-hub-dash .tm-hub-card:nth-child(3) { animation: tm-hub-brand-in 0.34s ease 0.12s both; }
.tm-hub--enter .tm-hub-dash .tm-hub-card:nth-child(4) { animation: tm-hub-brand-in 0.34s ease 0.16s both; }

.tm-hub--enter .tm-hub-sec {
  animation: tm-hub-brand-in 0.34s ease 0.2s both;
}

@media (max-width: 800px) {
  .tm-hub {
    padding: 4px 0 20px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .tm-hub__brand {
    padding: 14px 12px;
    margin-left: 0;
    margin-right: 0;
  }

  .tm-hub-dash {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .tm-hub-card {
    min-width: 0;
    max-width: 100%;
  }

  .tm-hub-card--panel {
    min-height: 240px;
  }

  .tm-hub-card__cta {
    white-space: normal;
    font-size: 13px;
    line-height: 1.25;
    padding: 9px 10px;
  }

  .tm-hub-mini-map,
  .tm-hub-mini-map .leaflet-container {
    min-height: 180px;
    height: 180px;
    max-width: 100%;
  }

  .tm-hub-sec {
    min-width: 0;
    max-width: 100%;
  }

  .tm-hub-sec__grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    min-width: 0;
  }

  .tm-hub-sec__btn {
    overflow: hidden;
    min-width: 0;
  }

  .mega-tab-buttons--with-hub {
    gap: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .mega-tab-buttons--with-hub .mega-tab-buttons-inner {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-hub--enter .tm-hub__brand,
  .tm-hub--enter .tm-hub-dash .tm-hub-card,
  .tm-hub--enter .tm-hub-sec {
    animation: none;
  }
  .tm-hub-card__cta,
  .tm-hub-sec__btn {
    transition: none;
  }
  .tm-hub-card__cta:hover,
  .tm-hub-card__cta:focus-visible,
  .tm-hub-card__cta:active,
  .tm-hub-sec__btn:hover,
  .tm-hub-sec__btn:focus-visible,
  .tm-hub-sec__btn:active {
    transform: none;
  }
}

/* —— Chrome (nav / map return) —— */
.tm-hub-logo-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.tm-hub-logo-btn:hover {
  filter: brightness(1.03);
}

.tm-hub-logo-btn:focus-visible {
  outline: 2px solid var(--color-brand, #1F5A85) !important;
  outline-offset: 2px;
}

/* 主頁鈕：與 mega-tab 同結構，但以品牌淡色底＋圖示圓角標示特殊性（非奶油厚框卡片） */
.tm-hub-nav-btn {
  appearance: none;
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  margin: 0;
  border: 2px solid var(--text-main);
  border-radius: 14px 14px 0 0;
  border-bottom: 3px solid transparent;
  background: rgba(31, 90, 133, 0.07);
  color: var(--color-brand);
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.tm-hub-nav-btn .nav-icon {
  width: 16px;
  height: 16px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(31, 90, 133, 0.12);
  box-sizing: content-box;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  flex-shrink: 0;
}

.tm-hub-nav-btn:hover {
  background: rgba(31, 90, 133, 0.11);
}

.tm-hub-nav-btn:active {
  transform: scale(0.97);
}

.tm-hub-nav-btn.active,
.tm-hub-nav-btn[aria-current="page"] {
  background: var(--card-bg);
  color: var(--color-brand);
  border-color: var(--color-brand);
  border-bottom: 3px solid var(--color-brand);
  box-shadow: 1px 1px 0 var(--color-brand);
}

.tm-hub-nav-btn.active .nav-icon,
.tm-hub-nav-btn[aria-current="page"] .nav-icon {
  background: rgba(31, 90, 133, 0.18);
}

.mega-tab-buttons--with-hub {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.mega-tab-buttons--with-hub .mega-tab-buttons-inner {
  display: flex;
  flex: 3;
  min-width: 0;
  gap: 8px;
}

/* 底欄三主分頁：探索｜主頁｜社群 */
.mega-tab-buttons--primary-three {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.mega-tab-buttons--primary-three > .mega-tab-btn,
.mega-tab-buttons--primary-three > .tm-hub-nav-btn {
  flex: 1;
  min-width: 0;
}

.map-return-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--ok-bg);
  border: 2px solid var(--border-dark);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-flat);
  color: var(--ok-text);
}

.map-return-bar.is-visible {
  display: flex;
}

.map-return-bar__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--ok-border);
  background: var(--card-bg);
  color: var(--ok-text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.map-return-bar__btn:hover {
  background: color-mix(in srgb, var(--ok-text) 14%, var(--ok-bg));
}

.map-return-bar__hint {
  font-size: 12px;
  color: var(--ok-text);
  font-weight: 600;
}

/* 揪團｜找團區 — 頁首分段（手機也固定置頂可見） */
.lfg-sub-tabs {
  display: flex;
  gap: 0;
  padding: 10px 12px;
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border-soft, #e2e8f0);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
}

.lfg-sub-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 12px;
  border: 1.5px solid var(--border-soft, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-muted, #64748b);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lfg-sub-tab:first-child {
  border-radius: 12px 0 0 12px;
}

.lfg-sub-tab:last-child {
  border-radius: 0 12px 12px 0;
  margin-left: -1.5px;
}

.lfg-sub-tab.is-active {
  background: #10b981;
  border-color: #059669;
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
  z-index: 1;
}

.lfg-sub-tab--find.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
}

.lfg-sub-tab:not(.is-active):hover {
  background: var(--bg-surface, #f1f5f9);
  color: var(--text-main, #334155);
}

.lfg-page-header {
  background: var(--bg-main, #f8fafc);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-soft, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  box-sizing: border-box;
  color: var(--text-main);
}

.lfg-page-heading {
  margin: 0;
  color: var(--text-main, #334155);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.lfg-page-heading svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.lfg-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
  max-width: 100%;
  box-sizing: border-box;
}

.lfg-header-start-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.lfg-map-entry-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(4, 120, 87, 0.15);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lfg-map-entry-btn:hover {
  background: color-mix(in srgb, var(--ok-text) 14%, var(--ok-bg));
}

.lfg-map-entry-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.lfg-map-entry-btn__label-short {
  display: none;
}

@media (max-width: 640px) {
  .lfg-sub-tabs {
    padding: 8px 10px;
  }

  .lfg-sub-tab {
    padding: 12px 10px;
    font-size: 15px;
  }

  .lfg-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .lfg-page-heading {
    width: 100%;
    font-size: 17px;
    flex: none;
  }

  .lfg-header-actions {
    width: 100%;
    flex: none;
    justify-content: flex-start;
  }

  .lfg-map-entry-btn {
    padding: 7px 10px;
    font-size: 12px;
    gap: 4px;
  }

  .lfg-map-entry-btn__label {
    display: none;
  }

  .lfg-map-entry-btn__label-short {
    display: inline;
  }

  .lfg-map-entry-btn svg {
    width: 14px;
    height: 14px;
  }

  .lfg-header-start-btn {
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* 發文表單：揪團地點 + 地圖選點（手機不撐出視窗） */
.lfg-form-loc-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lfg-form-loc-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}

.lfg-form-map-btn {
  flex: 0 0 auto;
  background: var(--border-soft);
  color:var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  box-sizing: border-box;
}

.lfg-form-map-btn svg {
  width: 14px;
  height: 14px;
  color: #ef4444;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .lfg-form-loc-row {
    flex-wrap: wrap;
  }

  .lfg-form-map-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

body.hub-tab-active .search-container,
body.hub-tab-active #filter-settings-modal,
body.hub-tab-active #top-filter-drawer {
  display: none !important;
}

/* —— Community overview feed（舊自訂卡樣式保留相容；主流程改走 feed-view-host） —— */
.tm-overview {
  padding: 4px 2px 24px;
}

.tm-overview__head {
  margin-bottom: 14px;
}

.tm-overview__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main, #2C221E);
}

.tm-overview__lead {
  margin: 0 0 10px;
  font-size: 13px;
  color:var(--text-muted);
}

.tm-overview-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-overview-jump {
  appearance: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid #2C221E;
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 1.5px 1.5px 0 #2C221E;
}

.tm-overview-jump:hover {
  background: var(--info-bg);
}

.tm-overview__feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tm-overview-card {
  border: 2px solid #2C221E;
  border-radius: 14px;
  background: var(--card-bg);
  padding: 12px;
  box-shadow: 2px 2px 0 #2C221E;
  cursor: pointer;
}

.tm-overview-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tm-overview-card__badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(44, 34, 30, 0.28);
  background: var(--card-bg);
  opacity: 0.92;
}

.tm-overview-card__badge--market { background: var(--info-bg); color: #9d174d; }
.tm-overview-card__badge--news { background: var(--bg-surface); color:var(--text-muted); }
.tm-overview-card__badge--lfg { background: var(--ok-bg); color: var(--ok-text); }

.tm-overview-card__price {
  font-size: 13px;
  font-weight: 900;
  color: #be185d;
}

.tm-overview-card__body {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tm-overview-card__img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid #cbbba8;
  flex-shrink: 0;
}

.tm-overview-card__img--empty {
  background: #e8e0d4;
}

.tm-overview-card__title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 800;
}

.tm-overview-card__meta {
  margin: 0;
  font-size: 12px;
  color:var(--text-muted);
}

.tm-overview-wrap__badge-row {
  margin-bottom: 6px;
}

.tm-overview-empty {
  text-align: center;
  color:var(--text-muted);
  padding: 40px 12px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: var(--card-bg);
}

@media (max-width: 640px) {
  .tm-hub-carousel {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
    max-width: none;
  }
  .tm-hub-nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .tm-hub-card {
    min-height: 280px;
    padding: 14px 12px 12px;
  }
  .tm-hub-sea-rail__item {
    width: 48px;
    height: 48px;
  }
}

