html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* 地圖鋪滿 */
#map {
  position: absolute;
  inset: 0;
}

/* 右側卡片一定浮在最上層 */
#card {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 340px;
  max-height: calc(100vh - 32px);
  overflow: auto;

  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 14px;

  z-index: 9999; /* ⭐ 重點 */
  backdrop-filter: blur(6px);
}

.cardHeader {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.cardTitle {
  font-weight: 800;
  font-size: 18px;
}

.cardSub {
  color: #555;
  font-size: 12px;
}

.scoreRow {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
}

#scoreValue {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.advice {
  font-weight: 700;
}

.meta {
  margin-top: 4px;
  color: #555;
  font-size: 12px;
}

.tagRow {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tagLabel {
  font-size: 12px;
  color: #555;
  margin-right: 2px;
}

.tagBtn {
  border: 1px solid rgba(0,0,0,.2);
  background: #fff;
  color: #111;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tagBtn.active {
  background: #111;
  color: #fff;
}

.tagHint {
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

.reasons {
  margin-top: 10px;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

button {
  border: 0;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  background: #111;
  color: #fff;
  font-weight: 700;
}

button:hover { opacity: 0.9; }

.ghostMini {
  background: #f2f2f2;
  color: #111;
  border: 1px solid rgba(0,0,0,.15);
}

.ghostBtn {
  margin-top: 10px;
  width: 100%;
  background: #f2f2f2;
  color: #111;
  border: 1px solid rgba(0,0,0,.15);
}

hr {
  margin: 14px 0;
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.08);
}

.spotTitle {
  font-weight: 800;
  margin-bottom: 8px;
}

.sectionTitle {
  font-weight: 800;
  margin-bottom: 8px;
}

.coordForm {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.spotForm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

#spotNote {
  grid-column: 1 / -1;
}

input {
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
}

textarea {
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  font-family: inherit;
  resize: vertical;
}

.spotList {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotItem {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
}

.spotNote {
  font-size: 12px;
  color: #333;
  line-height: 1.4;
  margin-top: 4px;
  white-space: pre-wrap;
}

.spotActions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spotEdit {
  display: none;
  grid-column: 1 / -1;
  margin-top: 6px;
  gap: 6px;
}

.spotEdit textarea {
  width: 100%;
}

.spotEditActions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.spotItem.editing .spotView {
  display: none;
}

.spotItem.editing .spotEdit {
  display: grid;
}

.spotName {
  font-weight: 800;
  font-size: 13px;
}

.miniBtn {
  background: #444;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.delBtn {
  background: #b00020;
}

.feedbackList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.noteForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.noteForm button {
  width: 100%;
}

.noteList {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.noteItem {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
}

.noteTitle {
  font-weight: 800;
  font-size: 13px;
}

.noteMeta {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}

.noteText {
  font-size: 12px;
  color: #333;
  line-height: 1.4;
  white-space: pre-wrap;
}

.noteActions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.noteActions .miniBtn {
  width: 64px;
}

.feedbackItem {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
}

.feedbackTitle {
  font-weight: 800;
  font-size: 13px;
}

.feedbackMeta {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}

.muted {
  font-size: 12px;
  color: #666;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

.gps-marker {
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
}

.gps-marker .gps-dot {
  width: 12px;
  height: 12px;
  background: #2196f3;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(33,150,243,0.3), 0 0 10px rgba(33,150,243,0.6);
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
}

.gps-marker .gps-pulse {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(33,150,243,0.2);
  position: absolute;
  left: 0;
  top: 0;
  animation: gpsPulse 1.6s ease-out infinite;
}

@keyframes gpsPulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.placeForm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.placeResults {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.placeItem {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
  cursor: pointer;
}

.placeItem:hover {
  background: rgba(0,0,0,.08);
}

.placeName {
  font-weight: 800;
  font-size: 12px;
}

.placeMeta {
  font-size: 11px;
  color: #666;
}

.cardTop {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
}

.collapseBtn {
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

#card.collapsed {
  width: 48px;
  padding: 8px;
}

#card.collapsed .cardBody {
  display: none;
}

#card.collapsed .cardTop {
  margin-bottom: 0;
  justify-content: center;
}

