/* ===== 地图页样式 ===== */

.map-page-banner {
  height: 200px;
  background: linear-gradient(135deg, #1a2a1a 0%, #2c4a2c 40%, #8B1A1A 100%);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.map-page-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 0h40v40H0zm40 40h40v40H40z'/%3E%3C/g%3E%3C/svg%3E");
}
.map-page-banner-overlay { position:absolute;inset:0;background:rgba(0,0,0,0.15); }
.map-page-banner-content { position:relative;text-align:center;color:#fff; }
.map-page-banner-content h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem; letter-spacing: 4px; font-weight: 700;
}
.map-page-banner-content p {
  font-family: var(--font-serif); letter-spacing: 3px;
  color: rgba(255,255,255,.8); font-size: .9rem;
}

/* ===== 地图主卡片 ===== */
.map-container { background: var(--paper-dark); }

.map-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,168,76,.2);
  overflow: hidden;
  height: 100%;
}
.map-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: .9rem 1.3rem;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-bottom: 2px solid var(--gold);
}
.map-title {
  font-family: var(--font-serif);
  font-size: .92rem; color: var(--paper);
  font-weight: 700; letter-spacing: 1.5px; margin: 0;
}
.map-legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.legend-dot-item {
  display: flex; align-items: center; gap: .3rem;
  font-family: var(--font-serif); font-size: .72rem;
  color: var(--paper); letter-spacing: .5px;
}
.ldot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ===== 类型筛选 ===== */
.map-body { padding: 1rem; }
.map-filter-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.map-filter-label { font-family: var(--font-serif); font-size: .82rem; color: var(--ink-light); white-space: nowrap; }
.mftag {
  border: 1px solid rgba(139,26,26,.25);
  background: transparent; color: var(--ink-light);
  border-radius: 16px; padding: 3px 12px;
  font-size: .78rem; font-family: var(--font-serif);
  cursor: pointer; transition: all .2s;
}
.mftag:hover { border-color: var(--primary); color: var(--primary); }
.mftag.active { background: var(--primary); color: var(--paper); border-color: var(--primary); }

/* ===== SVG 地图区 ===== */
.svg-map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(201,168,76,.15);
  background: #F5F0E8;
  cursor: default;
}
#chinaMap { width: 100%; display: block; }

/* ===== 右侧面板 ===== */
.map-side-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,168,76,.2);
  overflow: hidden;
  height: 100%;
  display: flex; flex-direction: column;
  max-height: 680px;
}
.map-side-header {
  background: var(--paper-dark);
  border-bottom: 1px solid rgba(201,168,76,.15);
  padding: .9rem 1.1rem;
}
.map-side-header h6 {
  font-family: var(--font-serif); font-size: .88rem;
  color: var(--ink); font-weight: 700; letter-spacing: 1px; margin: 0;
}
.map-side-header small {
  font-family: var(--font-serif); font-size: .72rem;
  color: var(--ink-light); display: block; margin-top: .2rem;
}
.map-spot-list { flex: 1; overflow-y: auto; padding: .5rem; }
.map-spot-list::-webkit-scrollbar { width: 5px; }
.map-spot-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.map-spot-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s;
  border: 1px solid transparent;
  margin-bottom: .3rem;
}
.map-spot-item:hover { background: var(--paper); }
.map-spot-item.active {
  background: rgba(139,26,26,.06);
  border-color: rgba(139,26,26,.2);
}
.map-spot-item img {
  width: 50px; height: 50px;
  border-radius: var(--radius);
  object-fit: cover; flex-shrink: 0;
}
.map-spot-info { flex: 1; min-width: 0; }
.map-spot-name {
  font-family: var(--font-serif); font-size: .88rem;
  font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-spot-meta { font-size: .72rem; color: var(--ink-light); font-family: var(--font-serif); margin-top: .1rem; }
.map-spot-region { font-weight: 600; }
.map-spot-rating { font-size: .72rem; color: var(--gold); margin-top: .1rem; }
.map-spot-actions { display: flex; flex-direction: column; gap: .3rem; flex-shrink: 0; }
.map-spot-fav {
  background: transparent; border: none;
  color: #ccc; font-size: .9rem; cursor: pointer;
  padding: 3px; transition: color .2s;
}
.map-spot-fav:hover, .map-spot-fav.active { color: var(--primary); }
.map-spot-go {
  color: var(--ink-light); font-size: 1.1rem;
  text-decoration: none; transition: color .2s;
}
.map-spot-go:hover { color: var(--primary); }

.map-no-spot {
  text-align: center; padding: 3rem 1rem;
  color: var(--ink-light); font-family: var(--font-serif);
}
.map-no-spot i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .3; }

/* ===== 弹出卡片 ===== */
.map-popup {
  position: fixed;
  bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: min(380px, 90vw);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,168,76,.3);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  z-index: 500;
  overflow: hidden;
  animation: popupIn .3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popupIn { from { opacity:0; transform:translateX(-50%) scale(.92) translateY(20px); } }
.map-popup-close {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(0,0,0,.4); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem; z-index: 10;
  transition: background .2s;
}
.map-popup-close:hover { background: rgba(139,26,26,.8); }
.popup-img {
  height: 140px;
  background-size: cover; background-position: center;
}
.popup-body { padding: .9rem 1.1rem; }
.popup-badges { display: flex; gap: .4rem; margin-bottom: .5rem; }
.popup-region, .popup-type {
  font-family: var(--font-serif); font-size: .68rem;
  color: #fff; padding: 2px 10px; border-radius: 12px; letter-spacing: .5px;
}
.popup-name {
  font-family: var(--font-serif); font-size: 1.1rem;
  font-weight: 700; color: var(--ink); letter-spacing: 2px; margin-bottom: .3rem;
}
.popup-province { font-family: var(--font-serif); font-size: .8rem; color: var(--ink-light); margin-bottom: .3rem; }
.popup-rating { font-size: .8rem; color: var(--gold); margin-bottom: .5rem; }
.popup-tags { margin-bottom: .7rem; }
.popup-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--paper); padding: .45rem 1.3rem;
  border-radius: 20px; font-family: var(--font-serif);
  font-size: .82rem; letter-spacing: 1px;
  text-decoration: none; transition: all .25s;
}
.popup-btn:hover { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--ink); }

/* ===== 响应式 ===== */
@media (max-width: 991px) {
  .map-side-panel { max-height: 400px; margin-top: 0; }
  .map-page-banner { height: 160px; }
  .map-page-banner-content h1 { font-size: 1.7rem; }
}
@media (max-width: 576px) {
  .map-popup { bottom: 4.5rem; }
}

/* ===== 地图控件行 ===== */
.map-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

/* 搜索框 */
.map-search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 240px;
  display: flex;
  align-items: center;
}
.map-search-icon {
  position: absolute;
  left: .7rem;
  color: var(--ink-light);
  font-size: .85rem;
  pointer-events: none;
}
.map-search-input {
  width: 100%;
  border: 1.5px solid rgba(139,26,26,.2);
  border-radius: 20px;
  padding: .38rem .7rem .38rem 2rem;
  font-family: var(--font-serif);
  font-size: .82rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .2s;
}
.map-search-input:focus { border-color: var(--primary); }
.map-search-clear {
  position: absolute;
  right: .5rem;
  background: transparent;
  border: none;
  color: var(--ink-light);
  cursor: pointer;
  font-size: .8rem;
  padding: 2px;
  line-height: 1;
  transition: color .2s;
}
.map-search-clear:hover { color: var(--primary); }

/* 标记大小控件 */
.map-filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.map-size-ctrl {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}

/* 深色模式 */
.dark-mode .map-search-input { background:#2a2a2a; color:#e8e0d0; border-color:rgba(201,168,76,.2); }

@media (max-width: 576px) {
  .map-controls-row { flex-direction: column; align-items: stretch; }
  .map-search-wrap { max-width: 100%; }
}
