:root {
  --primary: #006994;
  --accent: #E63946;
  --glass: rgba(255, 255, 255, 0.8);
  --dark-glass: rgba(15, 23, 42, 0.85);
  --nav-h: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: 'Noto Sans TC', sans-serif; background: #0b0e12; overflow: hidden; }

/* 導覽列保持原始外觀 */
.main-navbar { position: fixed; top: 0; width: 100%; height: var(--nav-h); z-index: 1000; background: var(--primary); display: flex; align-items: center; }

/* 地圖滿版 */
#mapRoot { position: absolute; inset: var(--nav-h) 0 0 0; z-index: 1; }
#toiletMap { width: 100%; height: 100%; }

/* 左上角狀態列 */
.top-left-tools {
  position: absolute; top: 15px; left: 15px; z-index: 10;
  display: flex; flex-direction: column; gap: 10px;
}
.glass-tag {
  background: var(--dark-glass); color: white; padding: 6px 14px;
  border-radius: 20px; font-size: 13px; font-weight: bold;
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.1);
}
.btn-locate {
  background: var(--glass); border: none; width: 45px; height: 45px;
  border-radius: 12px; font-size: 18px; color: var(--primary);
  cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.2); backdrop-filter: blur(5px);
}

/* 底部控制中心 (手機/電腦適配) */
.bottom-ui {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 92%; max-width: 500px; z-index: 10;
  display: flex; flex-direction: column; gap: 12px;
}

/* 分類滑動條 */
.category-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: 0 0 auto; background: var(--glass); border: none; padding: 8px 16px;
  border-radius: 50px; font-weight: bold; font-size: 13px; color: #334155;
  cursor: pointer; backdrop-filter: blur(5px); transition: 0.3s;
}
.cat-btn.active { background: var(--primary); color: white; }

/* 主動作列 */
.action-dock {
  background: var(--dark-glass); backdrop-filter: blur(15px);
  border-radius: 24px; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-around;
  border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.dock-item {
  background: none; border: none; color: rgba(255,255,255,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: 0.3s;
}
.dock-item i { font-size: 20px; }
.dock-item span { font-size: 11px; font-weight: 500; }
.dock-item.active { color: #48CAE4; }
.dock-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.1); }

/* Popup 樣式優化 */
.maplibregl-popup-content { border-radius: 18px; padding: 0; width: 260px; overflow: hidden; box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.p-img { width: 100%; height: 130px; object-fit: cover; }
.p-content { padding: 15px; }
.p-title { font-size: 18px; font-weight: 900; margin: 0; color: #1e293b; display: flex; justify-content: space-between; align-items: center; }
.p-badge { font-size: 11px; background: #f1f5f9; padding: 2px 8px; border-radius: 6px; color: #64748b; }
.p-status { font-size: 13px; margin: 8px 0; font-weight: bold; }
.p-status.open { color: #10b981; }
.p-status.closed { color: #ef4444; }
.p-nav {
  display: block; width: 100%; background: var(--primary); color: white !important;
  text-decoration: none; text-align: center; padding: 10px; border-radius: 10px;
  margin-top: 12px; font-weight: bold;
}

/* 電腦版 hover 效果 */
@media (min-width: 768px) {
  .cat-btn:hover { background: #fff; transform: translateY(-2px); }
  .dock-item:hover { color: white; }
}

/* --- 使用者定位脈衝光圈 --- */
.user-marker {
  width: 20px;
  height: 20px;
  background: #4285F4;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.2);
  position: relative;
}
.user-marker::after {
  content: "";
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.4);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* --- 定位導航專用彈窗 (仿圖片樣式) --- */
.nav-popup .maplibregl-popup-content {
  padding: 20px !important;
  text-align: center;
  border-radius: 12px;
  min-width: 250px;
}
.nav-popup .p-location-label { color: #888; font-size: 13px; margin-bottom: 5px; }
.nav-popup .p-nearest-name { 
  color: #E63946; font-size: 18px; font-weight: 900; margin-bottom: 8px; 
}
.nav-popup .p-dist-badge {
  display: inline-block;
  background: #FFF0F0;
  color: #E63946;
  padding: 4px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 15px;
  border: 1px solid #FFDADA;
}
.nav-popup .p-google-btn {
  background: #006994;
  color: white !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
}

/* 左上角藥丸標題樣式 */
.map-title-badge {
  background: var(--glass); /* 使用原本定義的玻璃半透明白 */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 14px;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  margin-bottom: 12px; /* 與下方按鈕保持間距 */
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.4);
  white-space: nowrap;
}