/* 首页地图组件样式 */

.content-section {
  display: flex;
  gap: 24px;
  margin: 24px 0;
  padding: 0 20px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box; /* 确保padding包含在宽度内 */
}

.map-section {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 300px; /* 调整最小宽度，确保在平板布局中有合适的比例 */
}

.map-container {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 400px;
  position: relative;
  overflow: hidden;
}

.map-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.1),
    0 3px 6px rgba(0, 0, 0, 0.05),
    inset 0 2px 2px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.85);
}

#home-map {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2E4154;
}

/* 加载覆盖层 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 15px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1a73e8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

/* 地图信息面板 */
.map-info-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.02),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.map-info-panel:hover {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.03),
    inset 0 2px 2px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.85);
}

.map-notice {
  text-align: center;
}

.map-notice p {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
}

/* 车站标记样式 - 与station-map.html保持一致 */
.station-marker {
  background: #1a73e8;
  border: 2px solid white;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.station-marker:hover {
  transform: scale(1.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.station-marker.highlighted {
  background: #ff6f61;
  transform: scale(1.4);
  box-shadow: 0 6px 16px rgba(255, 111, 97, 0.6);
}

/* 弹出窗口样式 - 与station-map.html保持一致 */
.station-popup {
  max-width: 280px;
  font-family: 'Noto Serif SC', serif;
  padding: 0;
  text-align: left;
}

/* 优化Leaflet弹出框的样式 */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 180px;
  min-width: 140px;
}

.leaflet-popup-content {
  margin: 3px !important;
  padding: 3px;
  text-align: left;
  border-radius: 3px;
  overflow: hidden;
  font-size: 0.75rem;
}

.station-popup h3 {
  margin: 0 0 4px 0;
  color: #1a73e8;
  font-size: 0.85rem;
  font-weight: bold;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 3px;
  text-align: left;
}

.station-popup p {
  margin: 3px 0;
  font-size: 0.7rem;
  color: #666;
  line-height: 1.1;
  display: flex;
  align-items: flex-start;
  gap: 3px;
  justify-content: flex-start;
}

.station-popup p > span {
  flex: 1;
  word-break: break-word;
  text-align: left;
}

.station-popup .location {
  font-size: 0.65rem;
  color: #999;
  background: #f8f9fa;
  padding: 1px 3px;
  border-radius: 1px;
  margin: 1px 0;
  display: inline-block;
}

/* 弹出框中的归属图标样式 */
.station-popup .affiliation-icons {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
  flex: 1;
}

.station-popup .affiliation-icons img {
  border-radius: 1px;
  transition: transform 0.2s ease;
}

.station-popup .affiliation-icons img:hover {
  transform: scale(1.1);
}

.station-popup .popup-buttons {
  margin-top: 4px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.station-popup .view-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  background: #1a73e8;
  color: white;
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
  min-width: 70px;
}

.station-popup .view-btn:hover {
  background: #1557b0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.station-popup .view-btn.current-page {
  background: #34a853;
}

.station-popup .view-btn.current-page:hover {
  background: #2d8e47;
}

.station-popup .view-btn.new-tab {
  background: #ea4335;
}

.station-popup .view-btn.new-tab:hover {
  background: #d33426;
}

.station-popup .view-btn span {
  font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content-section {
    flex-direction: column;
  }
  
  .map-section {
    flex: none;
    width: 100%;
    min-width: 0; /* 在垂直布局时移除最小宽度限制 */
  }
  
  .map-container {
    height: 300px;
  }
  
  .map-info-panel {
    padding: 12px;
  }
  
  .station-popup {
    max-width: 130px;
  }
  
  .leaflet-popup-content-wrapper {
    max-width: 110px;
    min-width: 90px;
  }
  
  .leaflet-popup-content {
    padding: 1px;
    font-size: 0.65rem;
    margin: 1px !important;
  }
  
  .station-popup h3 {
    font-size: 0.7rem;
    margin: 0 0 2px 0;
    padding-bottom: 1px;
  }
  
  .station-popup p {
    font-size: 0.6rem;
    margin: 1px 0;
    gap: 1px;
  }
  
  .station-popup .location {
    font-size: 0.55rem;
    padding: 0px 1px;
  }
  
  .station-popup .view-btn {
    padding: 1px 3px;
    font-size: 0.55rem;
    min-width: 40px;
    gap: 1px;
  }
  
  .station-popup .popup-buttons {
    margin-top: 2px;
    gap: 1px;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 250px;
    padding: 10px;
  }
  
  .map-info-panel {
    padding: 10px;
  }
  
  .station-popup {
    max-width: 200px;
  }
  
  .leaflet-popup-content-wrapper {
    max-width: 180px;
    min-width: 160px;
  }
  
  .leaflet-popup-content {
    padding: 5px;
    font-size: 0.75rem;
  }
  
  .station-popup h3 {
    font-size: 0.85rem;
    margin: 0 0 5px 0;
    padding-bottom: 3px;
  }
  
  .station-popup p {
    font-size: 0.7rem;
    margin: 3px 0;
    gap: 3px;
  }
  
  .station-popup .location {
    font-size: 0.65rem;
    padding: 2px 3px;
  }
  
  .station-popup .view-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
    min-width: 70px;
    gap: 2px;
  }
  
  .station-popup .popup-buttons {
    margin-top: 6px;
    gap: 3px;
  }
} 