:root {
  --primary: #006994;
  --accent: #E63946;
  --glass: rgba(255, 255, 255, 0.85);
  --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; }

#navbar-placeholder { position: relative; z-index: 30000 !important; }

#mapRoot { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 1; }
#swapMap { width: 100%; height: 100%; }

.top-left-tools { position: absolute; top: 15px; left: 15px; z-index: 10; }
.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: 25px; 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; scrollbar-width: none; }
.cat-btn {
  flex: 0 0 auto; background: var(--glass); border: none; padding: 10px 20px;
  border-radius: 50px; font-weight: 900; font-size: 14px; color: #334155; cursor: pointer;
}
.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; }
.dock-item span { font-size: 11px; font-weight: 700; }
.dock-item.active { color: #48CAE4; }
.dock-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.1); }

/* Marker 樣式 */
.marker-wrap { display: flex; flex-direction: column; align-items: center; }
.marker { width: 24px; height: 24px; border-radius: 50%; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.marker.ionex { background: #0284c7; }
.marker.gogoro { background: #16a34a; }
.marker-label { margin-top: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,0.6); color: white; white-space: nowrap; }

.maplibregl-popup-content { border-radius: 18px; padding: 15px; width: 260px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.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: 10px; font-weight: bold; }

.custom-attribution { position: fixed; bottom: 5px; left: 10px; font-size: 10px; color: #888; z-index: 5; }
/* 資訊卡片容器 */
.p-card {
  padding: 5px;
  font-family: 'Noto Sans TC', sans-serif;
}

.p-header {
  margin-bottom: 10px;
}

.p-title {
  font-size: 16px;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 6px;
}

.p-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 50px;
  display: inline-block;
  letter-spacing: 0.5px;
}
.badge-ionex { background: #e0f2fe; color: #0369a1; }
.badge-gogoro { background: #dcfce7; color: #15803d; }

.p-body {
  margin-bottom: 15px;
}

.p-info {
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
  line-height: 1.4;
}

.p-dist {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 8px;
  font-weight: 500;
}

/* 按鈕區塊 */
.p-footer {
  display: flex;
  gap: 8px;
}

.btn-fly, .btn-google {
  flex: 1;
  border: none;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: 0.2s;
}

.btn-fly {
  background: #007bff;
  color: white;
}

.btn-google {
  background: #f1f5f9;
  color: #1e293b;
}

.btn-fly:hover { background: #0056b3; }
.btn-google:hover { background: #e2e8f0; }

/* 修正 Popup 預設樣式 */
.maplibregl-popup-content {
  border-radius: 20px !important;
  padding: 16px !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

.maplibregl-popup-close-button {
  font-size: 16px;
  right: 8px;
  top: 8px;
  color: #94a3b8;
}
/* 左上角藥丸標題樣式 */
.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;
}

/* 微調工具列排版，確保垂直排列 */
.top-left-tools {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* --- 補上 Popup 圖片卡片樣式 --- */
.maplibregl-popup-content {
  padding: 0 !important; /* 移除預設 padding */
  overflow: hidden;
  border-radius: 18px;
}

.p-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.p-content {
  padding: 15px;
}

.p-title {
  font-size: 16px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.p-addr {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
}

.p-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-ionex { background: #e0f2fe; color: #0369a1; }
.badge-gogoro { background: #dcfce7; color: #15803d; }

.p-nearest-name { font-weight: 800; color: var(--accent); font-size: 16px; }
.p-dist-badge { 
    display: inline-block; background: #fff0f0; color: var(--accent); 
    padding: 4px 12px; border-radius: 20px; margin: 8px 0; font-weight: 700;
}

/* 衛星圖切換按鈕啟動狀態 */
.dock-item.active {
    color: #48CAE4 !important;
}