/* === 全域與地圖 === */
html,
body {
  margin: 0;
  height: 100%
}

/* 只給螢幕閱讀器看的文字（SEO 也能讀到），不影響版面配置 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 強制所有加上 [hidden] 的元素不顯示（避免 display:flex 等設定蓋掉效果） */
[hidden] {
  display: none !important;
}

#map {
  position: absolute;
  inset: 56px 0 0 0;
  z-index: 1
}

/* === 導覽列（56px）=== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 3000;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #eaeaea;
}

/* === Brand 主副標題樣式 === */
.brand-block {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #111;
}

.brand-sub {
  font-size: 13px;
  color: #555;
  margin-top: 2px;
}


.brand {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  white-space: nowrap
}

.grow {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center
}

/* navbar 右側：說明 / 懶人包 下拉選單 */
.nav-links {
  display: flex;
  align-items: center;
  position: relative;
}

.nav-dropdown-toggle {
  font-size: 14px;
  padding: .35rem .75rem;
  border-radius: 999px;
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1),
              0 4px 6px -4px rgba(0, 0, 0, .1);
  padding: .25rem;
  margin-top: .5rem;
  z-index: 40;
}

.nav-dropdown-item {
  display: block;
  padding: .45rem .75rem;
  font-size: 14px;
  color: #111827;
  text-decoration: none;
  border-radius: .375rem;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: #f3f4f6;
}

.btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer
}

/* === 放大頂部導覽列的「放大鏡」圖示與點擊面積 === */
/* 只影響 navbar 裡的那顆搜尋鈕，不會影響其他 .btn */
#openSearchDrawerBtn {
  /* 稍微加大按鈕本體，觸控更好按 */
  padding: 8px 14px;
}

#openSearchDrawerBtn span[aria-hidden="true"] {
  /* 放大 emoji 本體 */
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  transform: translateY(1px);
  /* 視覺微調，讓圖示更置中 */
}

.btn.primary {
  background: #10b981;
  color: #fff;
  border-color: #10b981
}

.btn.warn {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444
}

/* === Auth === */
.auth {
  display: flex;
  align-items: center;
  gap: 8px
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: .35rem .75rem;
  cursor: pointer;
  font-size: 14px;
  line-height: 1
}

.user-name {
  color: #111827;
  font-weight: 600
}

/* === 放大頂部導覽列的「人像」圖示（僅限 user-btn 內的 .icon） === */
.navbar .user-btn .icon {
  font-size: 22px;
  /* 原先跟隨 14px，改為 22px 更醒目 */
  line-height: 1;
  display: inline-block;
  transform: translateY(1px);
  /* 視覺微調 */
}

/* 若你名稱也想跟著微放大，可加上這行（選擇性）*/
/* .navbar .user-btn { font-size: 15px; } */

.user-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  padding: .25rem;
  margin-top: .5rem;
  z-index: 50
}

.user-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: .5rem .75rem;
  border-radius: .375rem;
  cursor: pointer
}

.user-menu .menu-item:hover {
  background: #f3f4f6
}

/* === 右上角主選單（漢堡按鈕） === */
.nav-menu {
  display: flex;
  align-items: center;
}

.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.nav-menu-btn:hover {
  background: #f3f4f6;
}

/* === 右側主選單抽屜 === */
.side-menu {
  position: fixed;
  inset: 0;
  z-index: 2950;
  pointer-events: none;
}

.side-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .2s ease;
}

.side-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(80vw, 320px);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 30px rgba(0, 0, 0, .25);
  transform: translateX(100%);
  transition: transform .25s ease;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-menu.open {
  pointer-events: auto;
}

.side-menu.open .side-menu-backdrop {
  opacity: 1;
}

.side-menu.open .side-menu-panel {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  justify-content: flex-end;
}

.side-menu-close {
  border: none;
  background: transparent;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

.side-menu-section {
  margin-top: 8px;
}

.side-menu-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-menu-auth-btn,
.side-menu-logout-btn {
  width: 100%;
  justify-content: center;
}

.side-menu-parent {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 15px;
  cursor: pointer;
}

.side-menu-parent-chevron {
  font-size: 12px;
}

.side-menu-sub {
  margin-top: 6px;
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-menu-link {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  text-decoration: none;
}

.side-menu-link:hover {
  background: #f3f4f6;
}

/* === Modal（Auth）=== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3100
}

.modal.show {
  display: block
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: saturate(180%) blur(2px)
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* 桌機維持原樣，小螢幕會另外覆蓋為「視窗寬 - 安全邊界」 */
  width: min(92vw, 460px);
  max-width: 520px;
  max-height: min(86vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  /* 讓右上角關閉鈕可以「懸浮」出卡片邊緣 */
  overflow: visible;
  /* 內距微調（不再需要為關閉鈕預留過多右側空間） */
  padding: 52px 32px 16px 18px;
  /* top right bottom left */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1)
}

/* 放大可點範圍、圓形化、加上互動狀態與陰影 */
.modal-close {
  position: absolute;
  /* 懸浮在卡片右上角外緣 */
  right: -14px;
  top: -14px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  /* 深色底 */
  color: #fff;
  /* 白字 */
  border: none;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22), 0 4px 10px rgba(0, 0, 0, .12);
  transition: transform .12s ease, box-shadow .18s ease, opacity .18s ease;
}

/* === 新增：行動裝置的安全邊界與 X 內貼 === */
@media (max-width: 768px) {

  /* 讓整個 modal 保留安全邊界（iOS 瀏海也照顧到） */
  .modal {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  /* 卡片寬度：不要滿版，手機時再縮小一些，視覺更舒服 */
  .modal-card {
    width: min(88vw, 520px);
    max-width: 520px;
    border-radius: 20px;
  }

  /* 在手機改為「內貼」右上角，保證可見可點 */
  .modal-close {
    right: 10px;
    top: 10px;
  }
}

/* iPhone 15 Pro Max 直立寬度為 430px；這個斷點專門再縮小一點 */
@media (max-width: 440px) {
  .modal-card {
    width: 84vw;
    border-radius: 22px;
  }
}

.modal-close:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .24), 0 6px 12px rgba(0, 0, 0, .14);
}

.modal-close:focus-visible {
  outline: 3px solid #93c5fd;
  /* 輕量可見的鍵盤焦點 */
  outline-offset: 2px;
}

@media (max-width:420px) {
  .modal-card {
    width: 82vw;
    max-height: 88vh;
    /* 行動端縮小預留空間以提升可用高度 */
    padding: 44px 48px 14px 14px;
  }

  .modal-close {
    /* 420px 以下仍採更緊湊的內貼位置與尺寸 */
    right: 8px;
    top: 8px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

.tabs {
  display: flex;
  /* 取消 gap，讓兩顆分頁按鈕貼齊成「一整條」→ 視覺寬度就與下方 input/button 完全相等 */
  gap: 0;
  margin-bottom: 8px;
  /* 不再為關閉鈕預留右側空間，維持與下方表單欄位同寬 */
  padding-right: 0;
}

.tab {
  flex: 1 1 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  /* 左右兩顆做成同一條 pill：外側圓角、內側直角 */
  border-radius: 8px 0 0 8px;
  /* 預設給第一顆 */
  cursor: pointer;
  font-weight: 600
}

.tab+.tab {
  border-radius: 0 8px 8px 0;
  /* 第二顆右邊圓角 */
  border-left: none;
  /* 中間不重複畫邊線 */
}

.tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827
}

.view input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px; 
  box-sizing: border-box
}

.view .btn.primary {
  width: 100%;
}

/* 主按鈕寬度鎖定為與輸入框一致 */

.switch-tip {
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
  text-align: center
}

.switch-tip a {
  color: #2563eb;
  text-decoration: underline
}

.view .btn.primary {
  min-height: 38px
}

/* === Toast === */
#toastWrap {
  position: fixed;
  right: 16px;
  top: 72px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  font: 600 14px/1.25 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  text-align: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: all .18s ease
}

.toast.show {
  opacity: 1;
  transform: translateY(0)
}

.toast.success {
  background: #10b981
}

.toast.error {
  background: #ef4444;
  /* 輕微紅色光暈，加強錯誤感受但不刺眼 */
  box-shadow:
    0 12px 28px rgba(239, 68, 68, .35),
    0 2px 10px rgba(0, 0, 0, .12);
}

.toast.info {
  /* 改為偏「告知/提醒」的 amber 系色調 */
  background: #f59e0b;
}

/* 新增：實價登錄專用的青色 Toast */
.toast.cyan {
  background: #00BCD4;
  box-shadow:
    0 12px 28px rgba(0, 188, 212, .35),
    0 2px 10px rgba(0, 0, 0, .12);
}


#toastCenterWrap {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center
}

/* 置中顯示的錯誤 Toast：再稍微加一點柔和紅色環光，仍屬輕微強調 */
#toastCenterWrap .toast.error {
  box-shadow:
    0 16px 42px rgba(239, 68, 68, .45),
    0 0 0 3px rgba(239, 68, 68, .22) inset;
}

/* === 圓圈標籤 & 清除鈕（保留你原有同心圓功能）=== */
.circle-label .circle-pill {
  display: inline-block;
  white-space: nowrap;
  line-height: 1.1;
  font: 700 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid
}

.circle-label .pill-300 {
  color: #388e3c;
  border-color: #43a047
}

.circle-label .pill-500 {
  color: #ff6f00;
  border-color: #ffb300
}

.circle-clear-btn .circle-clear-btn__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
  height: 30px;
  padding: 0 14px;
  background: #fff;
  color: #ff6f00;
  border: 1px solid #ffb300;
  border-radius: 12px;
  font: 700 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08)
}

/* === Popup 追蹤按鈕（感到興趣 / 取消追蹤）=== */
.popup-fav-row {
  margin-bottom: 6px;
}

.popup-fav-row .fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.popup-fav-row .fav-toggle.on {
  background: #fee2e2;
  border-color: #fca5a5;
}

.popup-fav-row .fav-icon {
  font-size: 15px;
}

/* === FAB + Bottom Sheet（與 index_1.html 一致風格）=== */
.fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1100
}

.fab button {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25)
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  transform: translateY(100%);
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .25);
  padding: 14px 12px 16px;
  transition: transform .25s ease
}

.sheet.open {
  transform: translateY(0)
}

/* ★ 新增：拖曳關閉時，關掉過度動畫，讓拖曳更跟手 */
.sheet.dragging {
  transition: none !important;
}

/* === Mobile safety: 抽屜區域避免觸發系統雙指縮放與跨區域捲動 === */
/* 允許垂直捲動（pan-y），但不允許 pinch-zoom；Leaflet 的地圖縮放不受影響 */
.sheet {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.sheet .grip {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: #ddd;
  margin: 4px auto 12px;
}

/* ★ 新增：讓 grip 更像可拖曳的手把，也避免選字 */
.sheet .grip {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  /* 只在手把上關閉預設手勢，避免捲動/縮放干擾 */
}

.sheet .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0
}

.sheet .row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px
}

.sheet .row input[type="range"] {
  flex: 1
}

.sheet .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px
}

.sheet .actions button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f7f7f7
}

/* === 工具列（桌機）=== */
.toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .95);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans TC, sans-serif;
  z-index: 999
}

.toolbar label {
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px
}

.toolbar .spacer {
  flex: 1
}

/* LINE 邀請條（保留） */
#bottomBar {
  position: fixed;
  bottom: 40px; /* 往上抬，騰出底部 footer 空間，約 40px + 緩衝 */
  left: 50%;
  transform: translateX(-50%);
  background: #00c300;
  color: #fff;
  padding: 8px 15px;
  border-radius: 50px;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  z-index: 1600; /* 高於 footer(800)，仍低於 FAB(3000) 與 toast */
  transition: transform .25s ease, opacity .2s ease
}

/* 任何抽屜打開時，暫時把 LINE BAR 往下推離視窗並關閉點擊 */
body.has-sheet-open #bottomBar {
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
}

/* === Fix: FAB 在桌機不可見／被蓋住 === */
.fab {
  position: fixed;
  /* 由 absolute → fixed，固定右下角 */
  right: 16px;
  bottom: 16px;
  z-index: 3000;
  /* 提高層級，壓過地圖與 bottom bar */
  display: block !important;
  /* 防止任何媒體查詢不小心把它關掉 */
}

.fab button {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #2196f3;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: background .2s ease;
}

.fab button:hover {
  background: #1976d2;
}

/* 抽屜層級：可在地圖上方，但低於 Toast／FAB */
.sheet {
  z-index: 2500;
}

/* === 重要：抽屜開啟時，鎖住整頁下拉與系統 Pull-to-Refresh === */
/* 說明：
   1) body.has-sheet-open：關閉整頁滾動，避免向下拖動誤觸下拉刷新
   2) html.has-sheet-open + body.has-sheet-open：在根節點關掉 overscroll-y
      這是 Android Chrome 阻止系統拉動重整的關鍵設定
*/
html.has-sheet-open,
body.has-sheet-open {
  overscroll-behavior-y: none;
}

body.has-sheet-open {
  overflow: hidden;
}


/* === 桌機：隱藏搜尋抽屜中的「登入/註冊」捷徑 === */
@media (min-width: 641px) {
  #searchSheet #quickAuthBtn {
    display: none !important;
  }
}

/* === 放大管理人輸入框的高度/字級（僅在搜尋抽屜內） === */
#searchSheet #managerSearch {
  height: 18px;
  /* 原本是瀏覽器預設高度；這裡拉高 */
  padding: 10px 12px;
  /* 增加內距，較好點擊 */
  font-size: 16px;
  /* 放大字級，易讀 */
  border-radius: 10px;
  /* 視覺一致 */
}

/* === Footer: 放在地圖上層 === */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;      /* 高於地圖本身，但低於 LINE BAR(#bottomBar) 與 FAB */
  text-align: center;
  font-size: 13px;
  color: #666;
  padding: 5px;
  background: #f8f8f8cc;  /* 微透明白底，避免遮住地圖但仍可讀 */
  backdrop-filter: blur(6px);
  border-top: 1px solid #e5e5e5;
}
.site-footer strong { color: #111; }

/* Footer 內聯絡方式樣式 */
.site-footer .footer-email {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
}

.site-footer a.footer-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a.footer-link:hover {
  text-decoration: underline;
}

/* === 3D 建築物 footprint popup：縮小寬度（含手機） === */
/* 只影響在 app_shadow.js 裡加了 className: 'building-popup' 的 popup */
.leaflet-popup.building-popup .leaflet-popup-content-wrapper {
  width: auto !important;         /* 取消可能的 100% 寬度設定（含手機版） */
  max-width: 260px !important;    /* 桌機上維持約 260px 寬 */
}

/* 讓整個 popup 容器本身也不要撐太寬 */
.leaflet-popup.building-popup {
  max-width: 260px !important;
}

/* 內文再收窄一些，避免文字貼到邊緣 */
.leaflet-popup.building-popup .leaflet-popup-content {
  max-width: 240px !important;
}

/* 手機寬度（小螢幕）時，再用 vw 做一層限制，避免貼滿整個螢幕 */
@media (max-width: 768px) {
  .leaflet-popup.building-popup,
  .leaflet-popup.building-popup .leaflet-popup-content-wrapper {
    max-width: 82vw !important;   /* 最多佔 82% 螢幕寬度，兩側留一點空白 */
  }
  .leaflet-popup.building-popup .leaflet-popup-content {
    max-width: 78vw !important;
  }
}

/* ====== 地圖 popup 內的「感到興趣」愛心按鈕 ====== */
.popup-fav-row {
  margin-bottom: 6px;
  display: flex;
  justify-content: flex-end;
}

.fav-toggle {
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease; /* 加入過渡效果讓文字切換更滑順 */
}

.fav-toggle:hover {
  background-color: #f9fafb;
  border-color: #ccc;
}

.fav-toggle .fav-icon {
  font-size: 14px;
  line-height: 1;
}

.fav-toggle .fav-text {
  font-size: 12px;
  color: #4b5563; /* 稍微深一點的灰色 */
  line-height: 1;
}

.fav-toggle.on {
  border-color: #fca5a5;
  background: #fff1f2; /* 淺粉紅底 */
}

.fav-toggle.on .fav-text {
  font-weight: 600;
  color: #e11d48; /* 配合愛心的紅色系文字 */
}

/* === 新增：Popup 內的導航按鈕 === */
.popup-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  background-color: #4285F4; /* Google Blue */
  color: white !important;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  transition: filter 0.2s ease;
}

.popup-nav-btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
}

/* === 地塊點擊時的脈衝動畫 === */
@keyframes leaflet-pulse {
  0% { stroke-opacity: 1; stroke-width: 3; }
  50% { stroke-opacity: 0.6; stroke-width: 8; }
  100% { stroke-opacity: 1; stroke-width: 3; }
}

.pulse-active {
  animation: leaflet-pulse 1.5s infinite;
  stroke: #FF00EA !important; /* 強制覆蓋顏色為亮粉紅 */
  stroke-dasharray: 4, 4; /* 虛線邊框增加科技感 */
}

/* 新增：實價登錄青框的心跳(呼吸)動畫 */
@keyframes realprice-pulse {
  0% { stroke-opacity: 1; stroke-width: 3; }
  50% { stroke-opacity: 0.6; stroke-width: 8; }
  100% { stroke-opacity: 1; stroke-width: 3; }
}

.pulse-realprice {
  animation: realprice-pulse 1.5s infinite;
  stroke: #00BCD4 !important;
  stroke-dasharray: 4, 4;
  fill: transparent; /* 確保只閃爍邊框，不影響填色 */
  /* 確保動畫層級夠高，不被底圖蓋過 */
  z-index: 500; 
}

/* 新增：將 OSM 底圖轉為灰階淡色風格 */
/* 這會套用到 Leaflet 的 TileLayer 圖片上 */
.osm-gray-filter {
  /* 100% 灰階，稍微調亮一點避免太黑，對比度稍微降低柔和一點 */
  filter: grayscale(100%) brightness(110%) contrast(90%);
  /* 透明度稍微降低，讓它更像背景 */
  opacity: 0.85; 
}


/* === Popup 內的實價登錄區塊樣式 === */
.popup-price-tag {
  margin-top: 8px;
  padding: 8px 10px;
  background-color: #e0f7fa; /* 淺青底 */
  border: 1px solid #4dd0e1; /* 青色邊框 */
  border-radius: 8px;
  color: #006064; /* 深青文字 */
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.popup-price-header {
  font-weight: 700;
  color: #00838f;
  border-bottom: 1px dashed #4dd0e1;
  padding-bottom: 4px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-price-row {
  display: flex;
  justify-content: space-between;
}
.popup-price-val {
  font-weight: 700;
}

/* === 土地實價登錄列表樣式 === */
.lp-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.lp-item {
  border-bottom: 1px solid #fde68a; /* 淺黃分隔線 */
  padding: 6px 0;
}
.lp-item:last-child {
  border-bottom: none;
}

.lp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.lp-date {
  font-weight: 700;
  color: #92400e;
}

.lp-badge {
  font-size: 11px;
  background: #fff;
  border: 1px solid #d97706;
  color: #d97706;
  padding: 1px 4px;
  border-radius: 4px;
}

.lp-row {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

.lp-row b {
  color: #000;
}

/* === 實價登錄詳情 Modal 表格樣式 === */
.rp-table-wrap {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

.rp-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rp-detail-table th,
.rp-detail-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}

.rp-detail-table th {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  color: #374151;
}

.rp-detail-table tr:hover {
  background: #fdfdfd;
}

.rp-note-col {
  font-size: 12px;
  color: #888;
  max-width: 120px;
}

/* 讓 Popup 裡的「查看更多」按鈕漂亮一點 */
.btn-view-more-rp {
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  background-color: #fff;
  border: 1px solid #00BCD4;
  color: #00BCD4;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-view-more-rp:hover {
  background-color: #e0f7fa;
}

