* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  min-height: 100vh;
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: #222;
  background: #f4f4f4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========== 頂部列 ========== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.logo {
  font-weight: 700;
  font-size: 17px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  line-height: 1;
}
.logo-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  margin-top: 1px;
}
.logo-text {
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.logo-sub {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  color: #888;
  margin-left: 2px;
}

/* 搜尋 + 篩選 */
.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  padding: 0 16px;
}
.search-box {
  flex: 1;
  position: relative;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid #e0e0e0;
  border-radius: 19px;
  font-size: 14px;
  font-family: inherit;
  background: #f5f5f5;
  outline: none;
  transition: all 0.15s;
}
.search-box input:focus {
  background: #fff;
  border-color: #e65100;
  box-shadow: 0 0 0 3px rgba(230,81,0,0.08);
}
.search-box svg.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: #888;
  pointer-events: none;
}
.filter-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 19px;
  background: #f5f5f5;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  color: #333;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-btn:hover { background: #eee; }
.filter-btn.active {
  background: #fff3e0;
  border-color: #e65100;
  color: #e65100;
  font-weight: 500;
}
.filter-btn svg { width: 16px; height: 16px; }
.filter-badge {
  background: #e65100;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

/* 篩選下拉面板 */
.filter-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 16px;
  min-width: 240px;
  z-index: 200;
  display: none;
  border: 1px solid #e8e8e8;
  animation: filter-in 0.18s ease-out;
}
.filter-panel.show { display: block; }
@keyframes filter-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.filter-panel h4 {
  font-size: 13px;
  color: #666;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.amenity-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: background 0.1s;
}
.amenity-option:hover { background: #f5f5f5; }
.amenity-option input {
  width: 16px; height: 16px;
  accent-color: #e65100;
  cursor: pointer;
}
.amenity-option .amenity-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}
.amenity-option.checked { background: #fff3e0; }
.filter-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}
.filter-footer button {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: #f0f0f0;
  color: #666;
}
.filter-footer button:hover { background: #e0e0e0; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
#gsiBtn { min-height: 38px; display: flex; align-items: center; }

/* 圓形圖示按鈕 */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.icon-btn:hover {
  background: #f8f9fa;
  border-color: #bbb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.signin-icon svg { width: 20px; height: 20px; }
.user-icon { border-color: #ccc; padding: 0; overflow: hidden; }
.user-icon:hover { border-color: #999; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; }
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* 使用者下拉選單 */
.user-menu {
  position: fixed;
  top: 60px; right: 12px;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: menu-in 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-menu.show { display: block; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 頭像資訊區 */
.user-menu-head {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffccbc 100%);
}
.avatar-lg {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-info { flex: 1; min-width: 0; }
.user-menu-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-email {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 貢獻值統計 */
.user-menu-stats {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat { flex: 1; }
.stat-divider {
  width: 1px;
  height: 32px;
  background: #e0e0e0;
  flex-shrink: 0;
}
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: #e65100;
  font-family: Georgia, serif;
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* 選單項目 */
.user-menu-items { padding: 6px 0; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  text-align: left;
  transition: background 0.1s;
}
.user-menu-item:hover { background: #f5f5f5; }
.user-menu-item svg { width: 18px; height: 18px; color: #666; flex-shrink: 0; }
.user-menu-item span:not(.item-badge) { flex: 1; }
.item-badge {
  font-size: 10px;
  background: #e0e0e0;
  color: #666;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.fav-count {
  font-size: 12px;
  color: #999;
  font-family: Georgia, serif;
  font-weight: 500;
  margin-left: 6px;
}
.fav-count.full { color: #e91e63; font-weight: 600; }

/* 選單底部版權 */
.user-menu-footer {
  padding: 10px 16px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ========== 排行榜 ========== */
.ranking-dialog {
  max-width: 420px;
  padding: 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ranking-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #fff;
}
.ranking-tab {
  flex: 1;
  padding: 11px 0;
  text-align: center;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ranking-tab:hover { background: #fafafa; }
.ranking-tab.active { color: #e65100; border-bottom-color: #e65100; }

.ranking-intro {
  padding: 6px 16px;
  background: linear-gradient(135deg, #fff3e0 0%, #fff 100%);
  font-size: 12px;
  color: #888;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.ranking-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 20px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: #fafafa; }
.rank-item.top-1 { background: linear-gradient(90deg, rgba(255,193,7,0.08), transparent); }
.rank-item.top-2 { background: linear-gradient(90deg, rgba(144,164,174,0.08), transparent); }
.rank-item.top-3 { background: linear-gradient(90deg, rgba(160,82,45,0.08), transparent); }
.rank-item.top-1 .rank-name-main { font-weight: 600; }

/* 排名數字 */
.rank-num {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #888;
  font-family: Georgia, serif;
  border-radius: 50%;
  background: #f5f5f5;
  flex-shrink: 0;
}
.rank-trophy {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  flex-shrink: 0;
}

/* 頭像 / 泊點 icon */
.rank-avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
}
.rank-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.rank-spot-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe0b2, #ffcc80);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* 資訊區 */
.rank-info {
  flex: 1;
  min-width: 0;
}
.rank-name-main {
  font-size: 14px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-name-sub {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rank-name-sub .stars {
  color: #ffc107;
  letter-spacing: -1px;
  font-size: 10px;
}

/* 右側數字 */
.rank-count {
  text-align: right;
  flex-shrink: 0;
  min-width: 60px;
}
.rank-count-num {
  font-size: 16px;
  font-weight: 700;
  font-family: Georgia, serif;
  line-height: 1;
  color: #e65100;
}
.rank-count-num.heart { color: #e91e63; }
.rank-count-label {
  font-size: 10px;
  color: #999;
  margin-top: 3px;
}

/* 泊點榜項目可點擊（跳到地圖） */
.rank-item.clickable { cursor: pointer; }
.rank-item.clickable:hover { background: #f0f0f0; }

.rank-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}
.rank-empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }
.rank-empty-text { font-size: 14px; }

/* 空位樣式（只顯示排名） */
.rank-empty-slot { opacity: 0.4; }
.rank-empty-slot .rank-trophy { filter: grayscale(1); }
.rank-empty-slot .rank-num { background: #f5f5f5; color: #bbb; }

/* ========== 地圖（修正高度問題） ========== */
#map {
  position: absolute !important;
  top: 56px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: calc(100vh - 56px) !important;
}

/* ========== 定位按鈕 ========== */
.locate-btn {
  position: fixed;
  right: 10px; bottom: 120px;
  width: 40px; height: 40px;
  background: #fff; border: none;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  color: #666;
  transition: color 0.15s;
}
.locate-btn:hover { color: #1976d2; }
.locate-btn.active { color: #1976d2; }
.locate-btn svg { width: 22px; height: 22px; }
.locate-btn.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 新增泊點按鈕 ========== */
.add-btn {
  position: fixed;
  right: 10px; bottom: 170px;
  width: 40px; height: 40px;
  background: #e65100; border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(230,81,0,0.35);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  color: #fff;
  transition: all 0.15s;
}
.add-btn:hover {
  background: #d84315;
  transform: scale(1.05);
}
.add-btn.active {
  background: #555;
  transform: rotate(45deg);
}
.add-btn svg { width: 22px; height: 22px; }

/* 新增模式提示橫幅 */
.add-mode-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #1976d2;
  color: #fff;
  padding: 10px 16px 10px 20px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(25,118,210,0.4);
  z-index: 150;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  max-width: 92%;
}
.add-mode-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.add-mode-banner button {
  background: rgba(255,255,255,0.25);
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}
.add-mode-banner button:hover {
  background: rgba(255,255,255,0.35);
}

/* 新增模式時，地圖游標變十字 */
/* 新增模式：游標改成圖釘（📍 emoji 畫在 SVG 上） */
#map.add-mode,
#map.add-mode * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><text y='28' font-size='28'>%F0%9F%93%8D</text></svg>") 8 28, crosshair;
}

/* ========== Info Window ========== */
/* ========== Info Window ========== */
/* 修正 Google InfoWindow 2024 改版後的 header 空間浪費 */
.gm-style-iw.gm-style-iw-c {
  padding: 12px !important;
  max-width: 280px !important;
  max-height: none !important;
}
.gm-style-iw-d {
  overflow: hidden !important;
  max-height: none !important;
  max-width: 260px !important;
}

/* 把 header 容器（含 × 按鈕）變成浮動在右上角 */
.gm-style-iw-chr {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 2;
}
.gm-style-iw-ch {
  display: none !important;
}

/* 小卡片固定尺寸 + 內容自動斷行 */
.iw {
  width: 240px;
  padding: 0;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.iw-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  padding-right: 24px;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 標題最多 2 行，超過截斷省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 詳細面板建立者資訊 */
.detail-creator {
  font-size: 12px;
  color: #999;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}
.iw-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #555; margin-bottom: 6px;
}
.iw-desc {
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
  /* 描述最多顯示 3 行，詳細內容到詳細面板看 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.iw-creator { font-size: 12px; color: #888; margin-bottom: 8px; }

/* 設施小標籤 */
.amenity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.amenity-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  color: #555;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.amenity-tag .ic { font-size: 13px; }

/* 新增對話框的設施勾選 */
.amenity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.amenity-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: all 0.15s;
  position: relative;
}
.amenity-check:hover { border-color: #bbb; }
.amenity-check input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.amenity-check.checked {
  border-color: #e65100;
  background: #fff3e0;
  color: #e65100;
  font-weight: 500;
}
.amenity-check .ic { font-size: 18px; }

/* InfoWindow 按鈕 */
.iw-actions { display: flex; gap: 6px; }
.iw-actions button {
  flex: 1;
  background: #e65100; color: #fff; border: none; padding: 8px 10px;
  border-radius: 4px; font-size: 13px; cursor: pointer;
  font-family: inherit; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.iw-actions button:hover { background: #d84315; }
.iw-actions .btn-nav { background: #1976d2; }
.iw-actions .btn-nav:hover { background: #1565c0; }
.iw-actions .btn-iw-share { flex: 0 0 34px; background: #06C755; color: #fff; border: none !important; }
.iw-actions .btn-iw-share:hover { background: #059b44; }
.iw-actions svg { width: 14px; height: 14px; }
.stars { color: #ffa000; letter-spacing: 1px; }

/* ========== 詳細面板 導航按鈕 ========== */
.detail-actions {
  display: flex; gap: 8px;
  padding: 12px 16px 0;
}
.detail-actions button {
  border: none; border-radius: 6px;
  padding: 10px 8px; font-size: 13px;
  cursor: pointer; font-family: inherit; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.15s;
}
.btn-nav-main  { flex: 4; background: #1976d2; color: #fff; }
.btn-nav-main:hover { background: #1565c0; }
.btn-nav-main svg { width: 16px; height: 16px; }
.btn-detail-main { flex: 4; background: #f5f5f5; color: #333; border: 0.5px solid #ddd !important; }
.btn-detail-main:hover { background: #eee; }
.btn-detail-main svg { width: 16px; height: 16px; }
.btn-share-spot { flex: 0 0 40px !important; width: 40px !important; background: #fff !important; color: #666; border: 0.5px solid #ccc !important; padding: 10px 0 !important; font-weight: normal !important; }
.btn-share-spot:hover { background: #f5f5f5 !important; }
.btn-share-spot svg { width: 16px; height: 16px; }

/* ========== 新增泊點 對話框 ========== */
.dialog-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.dialog-mask.show { display: flex; }
.dialog {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}
.dialog h3 { font-size: 18px; margin-bottom: 12px; }
.dialog .coord { font-size: 12px; color: #888; margin-bottom: 12px; }
.dialog label { display: block; font-size: 13px; color: #555; margin: 10px 0 4px; }
.dialog input[type="text"], .dialog textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.dialog input[type="text"]:focus, .dialog textarea:focus { border-color: #e65100; }
.dialog textarea { resize: vertical; min-height: 80px; }
.dialog-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }
.btn-primary, .btn-secondary {
  border: none; border-radius: 4px; padding: 8px 16px;
  font-size: 14px; cursor: pointer;
}
.btn-primary { background: #e65100; color: #fff; }
.btn-primary:hover { background: #d84315; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #ddd; }

/* ========== 詳細面板 ========== */
.detail-panel {
  position: fixed;
  top: 56px; bottom: 0; right: 0;
  width: 400px;
  max-width: 100%;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.detail-panel.show { transform: translateX(0); }
.detail-head {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.detail-head h3 {
  font-size: 17px;
  flex: 1;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 標題最多 2 行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.detail-icon-btn {
  background: none; border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.detail-icon-btn svg { width: 18px; height: 18px; }
.detail-icon-btn:hover { background: #f0f0f0; color: #333; }
.detail-icon-btn.danger:hover { background: #ffebee; color: #c62828; }

/* 愛心按鈕 */
.detail-icon-btn#btnFavorite:hover { background: #fce4ec; color: #e91e63; }
.detail-icon-btn#btnFavorite.favorited { color: #e91e63; }
.detail-icon-btn#btnFavorite.favorited .heart-outline { display: none; }
.detail-icon-btn#btnFavorite.favorited .heart-filled { display: block !important; }
.detail-icon-btn#btnFavorite.favorited:hover { background: #fce4ec; }
@keyframes heart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.detail-icon-btn#btnFavorite.animating { animation: heart-pop 0.4s ease-out; }

/* 我的最愛清單對話框 */
.favorites-dialog {
  max-width: 400px;
  padding: 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.favorites-head {
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.favorites-head h3 {
  margin: 0;
  font-size: 15px;
}
.favorites-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f5f5f5;
}
.fav-item:last-child { border-bottom: none; }
.fav-item:hover { background: #fafafa; }
.fav-info { flex: 1; min-width: 0; }
.fav-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #777;
}
.fav-remove {
  background: none; border: none;
  color: #e91e63; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.fav-remove:hover { background: #fce4ec; }
.fav-remove svg { width: 18px; height: 18px; }
.fav-empty {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}
.fav-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.fav-empty-text {
  font-size: 14px;
  margin-bottom: 6px;
}
.fav-empty-hint {
  font-size: 12px;
  color: #bbb;
}
.detail-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: #666; line-height: 1;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.detail-close:hover { background: #f0f0f0; }

/* 刪除確認對話框 */
.dialog-confirm { max-width: 340px; text-align: center; padding: 28px 24px; }
.confirm-icon { font-size: 42px; margin-bottom: 12px; }
.dialog-confirm h3 { text-align: center; margin-bottom: 10px; font-size: 17px; }
.confirm-msg { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 16px; }
.dialog-confirm .dialog-actions { justify-content: center; }
.btn-danger {
  background: #c62828; color: #fff;
  border: none; border-radius: 6px;
  padding: 9px 18px; font-size: 14px;
  cursor: pointer; font-family: inherit; font-weight: 500;
}
.btn-danger:hover { background: #b71c1c; }
.detail-meta {
  display: flex; gap: 8px; padding: 0 16px 10px;
  font-size: 13px; color: #555;
}
.detail-desc {
  padding: 0 16px 14px;
  font-size: 14px; color: #333;
  white-space: pre-wrap;
  border-bottom: 1px solid #eee;
}

.rate-box { padding: 14px 16px; border-bottom: 1px solid #eee; background: #fafafa; }
.rate-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.rate-hint { font-size: 13px; color: #888; }
.star-input { font-size: 28px; color: #ffa000; letter-spacing: 4px; margin-bottom: 8px; }
.star-input span { cursor: pointer; user-select: none; }
.rate-box textarea {
  width: 100%; border: 1px solid #ccc; border-radius: 4px;
  padding: 8px; font-size: 13px; font-family: inherit;
  min-height: 60px; resize: vertical;
}
.rate-box button {
  margin-top: 8px; background: #e65100; color: #fff;
  border: none; padding: 8px 16px; border-radius: 4px; font-size: 14px;
  cursor: pointer;
}
.rate-box button:disabled { background: #aaa; }

.rating-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}
.rating-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
}
.rating-item:last-child { border-bottom: none; }
.ri-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-size: 13px;
}
.ri-name { font-weight: 500; }
.ri-comment { font-size: 13px; color: #333; margin: 4px 0; white-space: pre-wrap; }
.ri-date { font-size: 11px; color: #999; }
.loading, .empty { text-align: center; color: #999; padding: 20px; font-size: 13px; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 2000;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #c62828; }

/* ========== 手機版 ========== */
@media (max-width: 600px) {
  .topbar { padding: 0 8px; gap: 6px; align-items: center; }
  .logo-text { display: none; }
  .logo-sub { display: none; }
  .logo-icon { font-size: 22px; }
  .logo { gap: 0; }
  .topbar-center {
    position: static;
    transform: none;
    left: auto;
    flex: 1;
    padding: 0;
    max-width: none;
  }
  .topbar-right { align-items: center; }
  .uname { max-width: 60px; font-size: 13px; }
  .filter-label { display: none; }
  .filter-btn { padding: 0 10px; height: 36px; }
  .search-box input { font-size: 13px; height: 36px; padding-left: 34px; }
  .search-box svg.search-icon { left: 10px; width: 16px; height: 16px; }
  .search-box input::placeholder { font-size: 12px; }
  .filter-panel { right: 8px; left: 8px; min-width: auto; }

  /* 手機版統一所有頂部按鈕高度為 36px */
  .icon-btn { width: 36px; height: 36px; }
  #gsiBtn { min-height: 36px; display: flex; align-items: center; flex-shrink: 0; }
  .topbar-right { flex-shrink: 0; margin-left: 0; }
  .user-menu { right: 8px; width: calc(100vw - 16px); max-width: 340px; }

  .detail-panel {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 75vh;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
  }
  .detail-panel.show { transform: translateY(0); }
}

/* 更窄的螢幕（小於 400px） */
@media (max-width: 400px) {
  .search-box input { padding-left: 30px; font-size: 12px; }
  .search-box input::placeholder { font-size: 11px; }
}

/* ========== 會員方案對話框 ========== */
.membership-dialog {
  max-width: 480px;
  width: 95vw;
  padding: 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.membership-intro {
  padding: 12px 16px;
  background: #fff8f0;
  border-bottom: 0.5px solid #eee;
}
.membership-intro-q {
  font-size: 16px;
  font-weight: 700;
  color: #854F0B;
  margin-bottom: 5px;
}
.membership-intro-p {
  font-size: 14px;
  color: #777;
  line-height: 1.65;
}
.membership-plans {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 10%;
  overflow-y: auto;
}
.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.plan-title-gray  { font-size: 18px; font-weight: 500; color: #5F5E5A; }
.plan-title-coral { font-size: 18px; font-weight: 500; color: #993C1D; }
.plan-title-amber { font-size: 18px; font-weight: 500; color: #854F0B; }
.plan-price-tag { font-size: 12px; font-weight: 500; color: #854F0B; }
.vip-extra {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vip-tag-inline {
  font-size: 10px;
  font-weight: 500;
  background: #e0e0e0;
  color: #555;
  padding: 2px 7px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}
.plan-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-card-vip {
  border: 2px solid #EF9F27;
}
.plan-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 8px;
  display: inline-block;
  width: fit-content;
}
.badge-gray  { background: #F1EFE8; color: #5F5E5A; }
.badge-coral { background: #FAECE7; color: #993C1D; }
.badge-amber { background: #FAEEDA; color: #854F0B; }
.plan-title  { font-size: 16px; font-weight: 500; color: #1a1a1a; }
.plan-price  { font-size: 12px; color: #999; margin-top: -6px; }
.plan-desc   { font-size: 14px; color: #777; line-height: 1.6; margin-top: -2px; }
.plan-divider { height: 0.5px; background: #eee; }
.plan-features { display: flex; flex-direction: column; gap: 7px; }
.plan-feature {
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-feature-off { opacity: 0.35; }
.feat-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}
.dot-coral { background: #993C1D; }
.dot-amber { background: #854F0B; }
.plan-btn-vip {
  margin-top: 4px;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid #EF9F27;
  background: #FAEEDA;
  color: #633806;
  width: 100%;
  font-family: inherit;
  transition: background 0.1s;
}
.plan-btn-vip:hover { background: #FAC775; }

/* ========== 分享泊點 ========== */
.share-dialog {
  max-width: 340px;
  width: 95vw;
}
.share-dialog-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.share-url-box {
  font-size: 12px;
  color: #1a73e8;
  background: #f5f5f5;
  padding: 10px 12px;
  border-radius: 8px;
  word-break: break-all;
  line-height: 1.5;
}
.share-dialog-btns {
  display: flex;
  gap: 8px;
}
.share-copy-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: #e65100;
  color: #fff;
  font-family: inherit;
  transition: background 0.1s;
}
.share-copy-btn:hover { background: #bf360c; }
.share-line-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: #06C755;
  color: #fff;
  font-family: inherit;
  transition: background 0.1s;
}
.share-line-btn:hover { background: #059b44; }

/* ========== 付款對話框 ========== */
.payment-dialog {
  max-width: 360px;
  width: 95vw;
}
.payment-dialog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.payment-plan-info {
  background: #fff8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0.5px solid #EF9F27;
}
.payment-plan-name { font-size: 14px; font-weight: 500; color: #854F0B; }
.payment-plan-price { font-size: 18px; font-weight: 600; color: #e65100; }
.payment-method-label { font-size: 12px; color: #999; }
.payment-methods { display: flex; flex-direction: column; gap: 8px; }
.payment-method-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid #e0e0e0; background: #fff;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: all 0.15s;
}
.payment-method-btn.active {
  border-color: #e65100;
  background: #fff8f5;
}
.payment-method-btn:hover { border-color: #ccc; background: #fafafa; }
.payment-method-btn.active:hover { border-color: #e65100; background: #fff8f5; }
.pm-icon { font-size: 22px; flex-shrink: 0; }
.pm-text { display: flex; flex-direction: column; gap: 2px; }
.pm-name { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.pm-sub { font-size: 12px; color: #999; }
.payment-confirm-btn {
  padding: 12px; border-radius: 10px; border: none;
  background: #e65100; color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: background 0.15s;
}
.payment-confirm-btn:hover { background: #bf360c; }
.payment-confirm-btn:disabled { background: #ccc; cursor: not-allowed; }
.payment-note { font-size: 11px; color: #bbb; text-align: center; }

/* ========== 會員方案側邊欄 ========== */
.membership-panel {
  position: fixed;
  top: 56px; bottom: 0; right: 0;
  width: 400px;
  max-width: 100%;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.membership-panel.show { transform: translateX(0); }
.membership-panel-body {
  flex: 1;
  overflow-y: auto;
}
@media (max-width: 600px) {
  .membership-panel {
    width: 100%;
    top: 56px;
  }
}

/* ========== 會員方案側邊欄多步驟 ========== */
.mp-back {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #666; padding: 0 8px 0 0;
  line-height: 1;
}
.mp-back:hover { color: #1a1a1a; }
.mp-step3-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.mp-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 16px;
}
.mp-spinner {
  width: 36px; height: 36px;
  border: 3px solid #eee; border-top-color: #e65100;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mp-loading-text { font-size: 13px; color: #999; }

/* ATM 面板 */
.atm-panel { padding: 16px; }
.atm-title { font-size: 15px; font-weight: 500; margin-bottom: 14px; color: #1a1a1a; }
.atm-rows { display: flex; flex-direction: column; gap: 0; border: 0.5px solid #eee; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.atm-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-bottom: 0.5px solid #eee; font-size: 13px; }
.atm-row:last-child { border-bottom: none; }
.atm-label { color: #888; }
.atm-value { font-weight: 500; color: #1a1a1a; }
.atm-account { font-size: 18px; font-weight: 600; color: #e65100; letter-spacing: 2px; }
.atm-note { font-size: 12px; color: #aaa; line-height: 1.6; }

/* 完成畫面 */
.mp-success {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center; gap: 12px;
}
.mp-success-icon { font-size: 48px; }
.mp-success-title { font-size: 18px; font-weight: 500; color: #1a1a1a; }
.mp-success-sub { font-size: 13px; color: #888; line-height: 1.6; }
.mp-success-btn {
  margin-top: 8px; padding: 10px 24px;
  border-radius: 8px; border: none;
  background: #e65100; color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}

/* ========== 修改暱稱 ========== */
.user-menu-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.edit-name-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
  line-height: 1;
}
.edit-name-btn:hover { opacity: 1; }
.edit-name-dialog {
  max-width: 320px;
  width: 95vw;
  padding: 0;
}
.edit-name-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edit-name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.edit-name-input:focus { border-color: #e65100; }
.edit-name-hint { font-size: 11px; color: #aaa; }
.edit-name-save {
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #e65100;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.edit-name-save:hover { background: #bf360c; }
