* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #FF6B35;
  --user-marker-color: #E74C3C;
  --shop-marker-color: #2C3E50;
  --line-color: #BDC3C7;
  --bg-color: #FAFAFA;
  --highlight-color: #FFD700;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 100;
  align-items: center;
  position: relative;
}

.location-status {
  margin-left: auto;
  font-size: 12px;
  color: #666;
  background: rgba(0,0,0,0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.force-graph-container {
  flex: 1;
  position: relative;
  background: var(--bg-color);
  overflow: hidden;
}

.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.force-graph-container svg {
  width: 100%;
  height: 100%;
}

.link {
  stroke: var(--line-color);
  stroke-opacity: 0.6;
  stroke-width: 2px;
}

.link-label {
  font-size: 11px;
  fill: var(--primary-color);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.link-label-bg {
  fill: white;
  rx: 3;
  ry: 3;
}

.node-user {
  fill: var(--user-marker-color);
  stroke: white;
  stroke-width: 2px;
  cursor: default;
}

.node-shop {
  fill: var(--shop-marker-color);
  stroke: white;
  stroke-width: 2px;
  cursor: grab;
}

.node-shop:hover {
  stroke-width: 3px;
  stroke: #ddd;
}

.node-shop.highlighted {
  stroke: var(--highlight-color);
  stroke-width: 4px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.node-shop.failed {
  fill: #95A5A6;
  stroke-dasharray: 3,3;
}

@keyframes pulse {
  0% { r: 24; opacity: 1; }
  50% { r: 28; opacity: 0.8; }
  100% { r: 24; opacity: 1; }
}

.node-user-pulse {
  fill: none;
  stroke: var(--user-marker-color);
  stroke-width: 2px;
  animation: pulse 2s ease-in-out infinite;
}

.shop-list {
  width: 300px;
  background: #fff;
  overflow-y: auto;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.shop-list h3 {
  padding: 16px;
  font-size: 16px;
  color: #333;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

#shopListContent {
  flex: 1;
  overflow-y: auto;
}

.shop-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shop-item:hover {
  background: #f5f5f5;
}

.shop-item.highlighted {
  background: #FFF9E6;
}

.shop-info {
  flex: 1;
}

.shop-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.shop-distance {
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
}

.shop-remark {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}

.shop-status {
  font-size: 12px;
  color: #E74C3C;
}

.shop-delete {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  transition: color 0.2s;
}

.shop-delete:hover {
  color: #E74C3C;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  min-width: 320px;
}

.modal-content h3 {
  margin-bottom: 16px;
  color: #333;
}

.modal-content input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.poi-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  margin: 8px 0;
}

.poi-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.poi-result-item:hover {
  background: #f5f5f5;
}

.poi-result-item:last-child {
  border-bottom: none;
}

.poi-name {
  font-weight: 600;
  color: #333;
}

.poi-address {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s;
}

.empty-tip {
  padding: 20px;
  text-align: center;
  color: #999;
}

.info-card {
  position: absolute;
  background: white;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 500;
  min-width: 180px;
  pointer-events: auto;
}

.info-card h4 {
  margin: 0 0 8px;
  color: #333;
  font-size: 15px;
}

.info-card p {
  margin: 4px 0;
  font-size: 13px;
  color: #666;
}

.info-card .distance {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .shop-list {
    width: 100%;
    height: 35%;
    min-height: 150px;
    border-left: none;
    border-top: 1px solid #eee;
  }

  .toolbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
  }

  .btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .location-status {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: 4px;
    font-size: 11px;
  }

  .modal-content {
    min-width: auto;
    width: 95vw;
    max-height: 90vh;
  }
}
