/**
 * 疗愈地图总览页样式 - 响应式布局
 * 左侧预设路线卡片 + 右侧地图区域
 */

/* ====== 页面容器 ====== */
.hmo-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
  background: #f5f7fa;
}

/* ====== 主内容区 ====== */
.hmo-main {
  display: flex;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ====== 左侧边栏 ====== */
.hmo-sidebar {
  width: 380px;
  min-width: 380px;
  background: #fff;
  border-right: 1px solid #e8ecf1;
  display: flex;
  flex-direction: column;
}

.hmo-sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

/* ====== 定制路线按钮 ====== */
.hmo-create {
  margin-bottom: 20px;
}

.hmo-create__btn {
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  color: #1b8a6b;
  border: 2px solid #1b8a6b;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.hmo-create__btn:hover {
  background: #1b8a6b;
  color: #fff;
}

.hmo-create__arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.hmo-create__btn:hover .hmo-create__arrow {
  transform: translateX(4px);
}

/* ====== 路线卡片列表 ====== */
.hmo-routes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ====== 路线卡片 ====== */
.hmo-route {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.hmo-route:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: #2a6496;
}

.hmo-route__img {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.hmo-route__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 2px;
}

.hmo-route__img-placeholder--green {
  background: linear-gradient(135deg, #1b8a6b, #27ae60);
}
.hmo-route__img-placeholder--blue {
  background: linear-gradient(135deg, #2a6496, #3498db);
}
.hmo-route__img-placeholder--purple {
  background: linear-gradient(135deg, #8e44ad, #a569bd);
}
.hmo-route__img-placeholder--brown {
  background: linear-gradient(135deg, #795548, #a1887f);
}

.hmo-route__body {
  padding: 14px 16px;
}

.hmo-route__title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.hmo-route__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hmo-route__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #eef2f7;
  color: #555;
}

.hmo-route__tag--green {
  background: #e6f7ed;
  color: #27ae60;
}
.hmo-route__tag--blue {
  background: #e3f2fd;
  color: #2980b9;
}
.hmo-route__tag--purple {
  background: #f0e6f6;
  color: #8e44ad;
}
.hmo-route__tag--brown {
  background: #efebe9;
  color: #795548;
}

.hmo-route--active {
  border-color: #2a6496;
  box-shadow: 0 4px 16px rgba(42, 100, 150, 0.15);
}

/* ====== 右侧地图区域 ====== */
.hmo-map {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.hmo-map__search {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 6px;
}

.hmo-map__search-input {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 200px;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hmo-map__search-input:focus {
  border-color: #2a6496;
}

.hmo-map__search-btn {
  padding: 8px 16px;
  background: #2a6496;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hmo-map__search-btn:hover {
  background: #1e5078;
}

/* ====== 分类筛选标签 ====== */
.hmo-map__legend {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 380px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.hmo-map__legend-item {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  border: 2px solid transparent;
}

.hmo-map__legend-item:hover {
  transform: scale(1.05);
}

.hmo-map__legend-item--all {
  background: #f0f0f0;
  color: #555;
}
.hmo-map__legend-item--red {
  background: #fdeaea;
  color: #e74c3c;
}
.hmo-map__legend-item--green {
  background: #e6f7ed;
  color: #27ae60;
}
.hmo-map__legend-item--purple {
  background: #f0e6f6;
  color: #8e44ad;
}
.hmo-map__legend-item--orange {
  background: #fff3e0;
  color: #e67e22;
}
.hmo-map__legend-item--blue {
  background: #e3f2fd;
  color: #2980b9;
}
.hmo-map__legend-item--brown {
  background: #efebe9;
  color: #795548;
}
.hmo-map__legend-item--blue-light {
  background: #e8f4fd;
  color: #3498db;
}

.hmo-map__legend-item--active {
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hmo-map__legend-item--active.hmo-map__legend-item--all {
  background: #555;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--red {
  background: #e74c3c;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--green {
  background: #27ae60;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--purple {
  background: #8e44ad;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--orange {
  background: #e67e22;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--blue {
  background: #2980b9;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--brown {
  background: #795548;
  color: #fff;
}
.hmo-map__legend-item--active.hmo-map__legend-item--blue-light {
  background: #3498db;
  color: #fff;
}

/* ====== 浮动提示框 ====== */
.hmo-map__tips {
  position: absolute;
  bottom: 80px;
  right: 16px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  padding: 14px 18px;
  max-width: 300px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.hmo-map__tip {
  font-size: 0.8rem;
  margin: 0 0 6px;
  line-height: 1.5;
}

.hmo-map__tip--primary {
  color: #e74c8b;
  font-weight: 500;
}

.hmo-map__tip--secondary {
  color: #e74c8b;
  font-weight: 500;
  margin-top: 10px;
}

.hmo-map__tip-params {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0 4px;
}

.hmo-map__tip-params span {
  font-size: 0.75rem;
  color: #888;
}

/* ====== 地图容器 ====== */
.hmo-map__container {
  flex: 1;
  background: #e8ecf1;
  position: relative;
}

/* ====== 地图标记样式 ====== */
.hmo-marker__svg {
  width: 22px;
  height: 22px;
  color: #fff;
  fill: currentColor;
}

.hmo-marker__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hmo-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
}

.hmo-marker:hover {
  transform: scale(1.2);
  z-index: 999 !important;
}

.hmo-marker__label {
  margin-top: 2px;
  font-size: 10px;
  color: #333;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ====== 信息窗体样式 ====== */
.hmo-infowindow {
  padding: 4px;
  min-width: 200px;
}

.hmo-infowindow__tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.hmo-infowindow__title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px;
}

.hmo-infowindow__desc {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 4px;
}

.hmo-infowindow__address {
  font-size: 0.75rem;
  color: #999;
  margin: 0 0 8px;
}

.hmo-infowindow__btn {
  display: inline-block;
  padding: 5px 16px;
  background: linear-gradient(135deg, #2a6496, #1b8a6b);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.hmo-infowindow__btn:hover {
  opacity: 0.85;
}

/* ====== 路线连线高亮 ====== */
.hmo-route-polyline {
  stroke-dasharray: 8 4;
  animation: dash 0.6s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -12;
  }
}

/* ====================================================================
   响应式：平板（<= 1024px）
   ==================================================================== */
@media (max-width: 1024px) {
  .hmo-sidebar {
    width: 320px;
    min-width: 320px;
  }
}

/* ====================================================================
   响应式：手机（<= 768px）
   ==================================================================== */
@media (max-width: 768px) {
  .hmo-page {
    min-height: auto;
  }

  .hmo-main {
    flex-direction: column;
  }

  .hmo-map {
    min-height: 280px;
    order: 1;
  }

  .hmo-map__search-input {
    width: 140px;
  }

  .hmo-map__legend {
    max-width: 260px;
    padding: 8px 10px;
  }

  .hmo-map__tips {
    display: none;
  }

  .hmo-sidebar {
    width: 100%;
    min-width: auto;
    order: 2;
    border-right: none;
    border-top: 1px solid #e8ecf1;
  }

  .hmo-sidebar__scroll {
    max-height: 60vh;
    padding: 14px 12px;
  }

  .hmo-route__img {
    height: 120px;
  }
}

/* ====================================================================
   响应式：小屏手机（<= 480px）
   ==================================================================== */
@media (max-width: 480px) {
  .hmo-map {
    min-height: 220px;
  }

  .hmo-map__search {
    top: 10px;
    right: 10px;
  }

  .hmo-map__search-input {
    width: 110px;
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .hmo-map__legend {
    top: 10px;
    left: 10px;
    max-width: 180px;
    gap: 4px;
  }

  .hmo-map__legend-item {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .hmo-marker {
    width: 32px;
    height: 32px;
    font-size: 0.6rem;
  }

  .hmo-create__btn {
    font-size: 0.85rem;
    padding: 12px 16px;
  }
}
