html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
}

#app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 340px;
  padding: 16px 18px;
  box-sizing: border-box;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  box-shadow: 0 0 30px rgba(15, 23, 42, 0.08);
  z-index: 1;
}

.sidebar h1 {
  font-size: 18px;
  margin: 0 0 8px;
  color: #111827;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input[type="number"],
input[type="datetime-local"] {
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:focus,
input[type="datetime-local"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.buttons {
  display: flex;
  gap: 8px;
}

button {
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover {
  background: #1d4ed8;
}

button:active {
  transform: scale(0.97);
}

#map {
  flex: 1;
  background: #e5e7eb;
}

.message {
  min-height: 20px;
  font-size: 13px;
  color: #333;
}

.message.error {
  color: #c62828;
}

.distance-info {
  min-height: 20px;
  font-size: 13px;
  color: #333;
}

.export-times {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.export-time-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.export-time-row span {
  font-size: 12px;
}

.export-time-row input[type="datetime-local"] {
  flex: 1.2;
}

.export-pace-min,
.export-pace-sec {
  width: 40px;
  font-size: 12px;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-chart {
  border: 1px solid #e5e7eb;
  padding: 4px 6px;
  border-radius: 4px;
  background: #f9fafb;
}

.preview-chart h2 {
  margin: 0 0 4px;
  font-size: 13px;
}

.preview-chart canvas {
  width: 100%;
  height: 120px;
}

.live-info {
  min-height: 20px;
  font-size: 13px;
  color: #111827;
}

.tip {
  font-size: 12px;
  color: #666;
}

/* 版权区域整体样式 */
.leaflet-control-attribution {
  background: transparent !important;
  padding: 5px 10px 3px 10px !important;
  text-align: right !important;
  border: none !important;
  box-shadow: none !important;
}

/* 文字行背景 */
.leaflet-control-attribution::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.85);
  z-index: -1;
  border-radius: 3px;
}

/* 确保内容在背景之上 */
.leaflet-control-attribution > * {
  position: relative;
  z-index: 1;
}

/* 天地图logo悬停效果 */
.leaflet-control-attribution a:hover img {
  opacity: 0.8;
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* 当前位置标记样式 */
.current-location-marker {
  background: transparent;
  border: none;
}

.location-pulse {
  width: 20px;
  height: 20px;
  background: #4285f4;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
  animation: pulse 2s infinite;
  position: relative;
}

.location-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

@keyframes pulse {
  0% {
      box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
  }
  50% {
      box-shadow: 0 0 0 10px rgba(66, 133, 244, 0);
  }
  100% {
      box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
  }
}

/* 弹窗优化 */
.leaflet-popup-content {
  margin: 10px 15px;
  line-height: 1.6;
}