* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #1f2937;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: #104da6;
  color: #fff;
}

#topbar h1 { font-size: 16px; margin: 0; }

#stats { font-size: 14px; opacity: 0.9; }

#sidebar-toggle {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

#layout {
  display: flex;
  height: calc(100% - 41px);
}

#sidebar {
  width: 320px;
  flex: none;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  background: #fafafa;
}

#layout.sidebar-collapsed #sidebar { display: none; }

#map { flex: 1; }

/* 侧边栏筛选工具条 */
#geo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

#geo-hint { font-size: 12px; color: #6b7280; }

#geo-reset {
  padding: 2px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

#geo-reset:hover { background: #eff6ff; }

/* 大洲 → 国家 → 酒店三级树 */
#geo-tree details { border-bottom: 1px solid #e5e7eb; background: #fff; }

#geo-tree summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: #374151;
}

#geo-tree summary::-webkit-details-marker { display: none; }

.continent-group > summary {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.country-group > summary {
  padding-left: 26px;
  border-top: 1px solid #f3f4f6;
}

.geo-name { min-width: 0; overflow-wrap: anywhere; }

.geo-count {
  margin-left: auto;
  color: #6b7280;
  font-weight: 400;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.geo-toggle {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #104da6;
  cursor: pointer;
}

/* 勾掉的国家整组降透明度(marker 已隐藏),节点保留可随时勾回 */
.geo-off > summary { opacity: 0.55; }

.chip {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
}

/* 酒店列表项 */
.hotel-item {
  display: block;
  width: 100%;
  padding: 6px 12px 6px 44px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.hotel-item:hover:not(:disabled) { background: #eff6ff; }

.hotel-item:disabled {
  color: #9ca3af;
  cursor: default;
}

.hotel-item small { display: block; color: #d1a72c; }

/* marker 圆点 */
.hotel-marker span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 品牌图例(即筛选器),浮在地图右上角 */
#legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  max-width: 250px;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.legend-title {
  padding: 2px 6px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  text-align: left;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.legend-item:hover { background: #eff6ff; }

.legend-name { min-width: 0; overflow-wrap: anywhere; }

.legend-count {
  margin-left: auto;
  padding-left: 8px;
  color: #6b7280;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* 隐藏的品牌:置灰并划线,与 aria-pressed 同步 */
.legend-item[aria-pressed="false"] { opacity: 0.45; }
.legend-item[aria-pressed="false"] .legend-name { text-decoration: line-through; }

/* popup */
.leaflet-popup-content { font-size: 13px; line-height: 1.6; }

.popup-name { font-size: 14px; }

.popup-brand .chip { display: inline-block; vertical-align: middle; margin-right: 4px; }

.popup-link {
  display: inline-block;
  margin-top: 4px;
  color: #104da6;
}
