* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
  width: 100%;
  height: 100%;
}

/* ========== 顶部状态栏 ========== */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

#location-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #333;
  flex: 1;
  min-width: 0;
}

#search-input {
  flex: 1;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  min-width: 0;
  outline: none;
}

#search-input:focus {
  border-color: #1890ff;
}

#search-btn {
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: #1890ff;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

#search-btn:active {
  background: #096dd9;
}

#radius-select {
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  background: #f8f8f8;
  flex-shrink: 0;
}

/* ========== 刷新按钮 ========== */
#refresh-btn {
  position: fixed;
  right: 12px;
  bottom: 320px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#refresh-btn:active {
  background: #f0f0f0;
}

#locate-btn {
  position: fixed;
  right: 12px;
  bottom: 268px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#locate-btn:active {
  background: #f0f0f0;
}

/* ========== 底部面板 ========== */
#bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 240px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: height 0.3s ease;
  overflow: hidden;
}

#bottom-panel.expanded {
  height: 60vh;
}

#panel-handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  cursor: pointer;
  flex-shrink: 0;
}

#handle-bar {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
}

#panel-summary {
  display: flex;
  justify-content: space-around;
  padding: 4px 16px 8px;
  font-size: 14px;
  color: #333;
  flex-shrink: 0;
}

#panel-summary strong {
  font-size: 18px;
}

/* ========== 筛选按钮 ========== */
#panel-filter {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 15px;
  background: #f8f8f8;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn.active {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* ========== 店铺列表 ========== */
#panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.store-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  touch-action: manipulation;
}

.store-item:last-child {
  border-bottom: none;
}

.store-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.store-name {
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-type {
  font-size: 12px;
  color: #999;
}

.store-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  flex-shrink: 0;
  margin-left: 8px;
}

.store-status.available {
  color: #52c41a;
}

.store-status.restricted {
  color: #999;
}

.store-distance {
  font-size: 12px;
  color: #999;
  margin-left: 4px;
}

/* ========== 加载提示 ========== */
#loading-overlay {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 240px;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 99;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #ddd;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: #666;
}


#admin-link {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  margin-left: 6px;
  border-radius: 6px;
  background: #722ed1;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.store-item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-actions {
  flex-shrink: 0;
  margin-left: 8px;
}

.save-lead-btn {
  min-width: 66px;
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 15px;
  background: #1677ff;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.save-lead-btn.saved {
  background: #f0f5ff;
  color: #2f54eb;
  cursor: default;
}

.save-lead-btn:disabled {
  opacity: 0.65;
}

.store-phone {
  color: #1677ff;
}

@media (max-width: 420px) {
  #top-bar { padding: 0 8px; }
  #location-icon { display: none; }
  #search-btn { padding: 0 8px; }
  #radius-select { padding: 0 4px; }
  #admin-link { padding: 0 7px; margin-left: 4px; }
  #panel-list { padding-left: 10px; padding-right: 10px; }
  .store-status {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
}
