body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 20px;
  background: #f5f5f5;
}
h1 {
  margin-bottom: 6px;
}
.hint {
  margin-bottom: 12px;
  color: #555;
  font-size: 14px;
}
.controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.search-box {
  width: 100%;
  max-width: 380px;
}
.search-box input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.search-box input:focus {
  border-color: #222;
  box-shadow: 0 0 0 1px #2222;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.tab.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

.map-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 8px 0 16px 0;
}
#map-title {
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}
#map {
  width: 100%;
  height: 520px;        /* 地圖加大 */
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 4px;
}
#map-coord {
  font-size: 12px;
  color: #666;
}

.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.flag-card {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
}
.flag-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-bottom: 6px;
}
.meta {
  text-align: center;
}
.code {
  font-weight: 700;
  margin-right: 4px;
}
.name-zh {
  font-weight: 600;
}
.name-en {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}
.subregion {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #999;
}
.error {
  color: #d00;
  font-size: 12px;
  margin-top: 4px;
}
.no-result {
  margin-top: 16px;
  font-size: 14px;
  color: #777;
}

/* Leaflet 用國旗 icon 的外框效果 */
.flag-marker-icon {
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 0 4px rgba(0,0,0,0.35);
  background: #fff;
}

.leaflet-popup-content .popup-flag {
  text-align: center;
  font-size: 12px;
}

.leaflet-popup-content .popup-flag img {
  width: 64px;
  height: auto;
  display: block;
  margin: 0 auto 4px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.leaflet-popup-content .popup-code {
  font-weight: 600;
  margin-bottom: 2px;
}

.leaflet-popup-content .popup-name {
  color: #555;
}
