/* 高校地图通用样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; }
#map { width: 100%; height: 100vh; z-index: 1; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: white; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between;
}

.header h1 { font-size: 18px; font-weight: 600; }

.back-link {
  color: white; text-decoration: none; font-size: 14px;
  padding: 4px 12px; border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px; transition: all 0.2s;
}

.back-link:hover { background: rgba(255,255,255,0.2); }
button.back-link { background: transparent; border: 1px solid rgba(255,255,255,0.5); color: white; cursor: pointer; }
button.back-link.active { background: rgba(255,255,255,0.3); border-color: white; }

.header-links { display: flex; gap: 8px; }

.controls {
  position: fixed; top: 50px; right: 16px; z-index: 10; display: flex;
}

.controls button {
  padding: 4px 14px; border: 1px solid #1a73e8; cursor: pointer;
  font-size: 13px; transition: all 0.2s; background: #f0f0f0; color: #333;
  margin-left: -1px;
}

.controls button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.controls button:last-child { border-radius: 0 4px 4px 0; }
.controls button.active { background: #1a73e8; color: white; position: relative; z-index: 1; }

.search-box {
  position: fixed; top: 50px; left: 16px; z-index: 10;
  background: white; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  padding: 6px 12px; display: flex; align-items: center; gap: 6px;
}

.search-box input { border: none; outline: none; font-size: 14px; width: 180px; background: transparent; }

.clear-btn {
  cursor: pointer; font-size: 18px; color: #999; border: none; background: none;
  display: none; padding: 0 4px;
}

.popup-content { font-size: 13px; line-height: 1.6; }
.leaflet-popup-content { margin: 6px 8px; }
.leaflet-popup-content-wrapper { padding: 6px; }
.popup-content strong { font-size: 14px; }

.popup-content .attr {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 11px; color: white; margin-top: 2px;
}

.school-label {
  background: rgba(255,255,255,0.95); border: 2px solid #1a73e8; border-radius: 4px;
  padding: 2px 8px; font-size: 13px; font-weight: 700; color: #1a73e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.8);
  white-space: nowrap;
}

.city-label {
  background: white; border: 2px solid #1a73e8; border-radius: 20px;
  padding: 2px 8px; font-size: 12px; font-weight: 600; color: #1a73e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap;
  cursor: pointer; text-align: center; display: inline-block; line-height: 1.5;
}

.city-label:hover { background: #f0f7ff; }

.province-label {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: white; border: none; border-radius: 14px;
  padding: 2px 8px; font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(26,115,232,0.3);
  white-space: nowrap; cursor: pointer;
  text-align: center; display: inline-block; line-height: 1.3;
  transition: all 0.2s;
}

.province-label:hover { background: linear-gradient(135deg, #1557b0, #0a3578); transform: scale(1.05); }

.province-label.disabled {
  background: linear-gradient(135deg, #aaa, #888);
  box-shadow: 0 2px 5px rgba(0,0,0,0.10); cursor: default;
}

.province-label.disabled:hover { transform: none; background: linear-gradient(135deg, #aaa, #888); }

.loading {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: white; padding: 20px 40px; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); z-index: 1000;
  font-size: 16px; color: #333;
}

/* iPad 底部控件间距 */
.leaflet-bar { margin-bottom: 30px !important; }

@media (max-width: 1024px) { .leaflet-bar { margin-bottom: 50px !important; } }
@media (max-width: 768px) { .leaflet-bar { margin-bottom: 70px !important; } }

/* 隐藏元素 */
.hidden { display: none !important; }

/* 显示元素（用于动态控制） */
.show { display: block !important; }
.show-inline { display: inline-block !important; }

/* 地图控制按钮样式 */
.leaflet-bar a.leaflet-control-zoom-in,
.leaflet-bar a.leaflet-control-zoom-out {
  border-bottom: 1px solid #ccc;
}

.leaflet-bar a:last-child {
  border-bottom: none;
}
