body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #333;
  color: #fff;
  padding: 10px;
  text-align: center;
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 地图容器 */
#map {
  position: relative;
  height: 95vh;
  width: 100%;
  background-color: #e0e0e0; /* 地图背景色示例 */
  overflow: hidden;
}

/* 更新排名表样式，使其更美观 */
#rankContainer {
  position: absolute;
  top: 60px;
  left: 10px;
  width: 300px;
  background-color: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  max-height: 70vh;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#rankContainer.collapsed {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

#expandButton {
  position: absolute;
  top: 60px;
  left: 0;
  background-color: #333;
  color: white;
  padding: 10px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  cursor: pointer;
  display: none;
  z-index: 1001;
}

#expandButton:hover {
  background-color: #555;
}


#rankTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#rankTable th,
#rankTable td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  color: #333;
}

#rankTable th {
  background-color: #333; /* 深色背景 */
  color: white; /* 白色文字 */
  font-weight: bold;
}

#rankTable tr:nth-child(even) {
  background-color: #f7f7f7; /* 增加交替行背景色 */
}

#rankTable tr:hover {
  background-color: #e0e0e0; /* 悬停时变色 */
}

/* 表格标题样式 */
#rankContainer h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

/* 右上角的搜索栏 */
#searchContainer {
  position: absolute;
  top: 60px; /* 与标题栏有一定距离 */
  right: 10px;
  width: 250px;
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000; /* 确保搜索栏在地图上方 */
}

#searchBox {
  width: 90%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

#suggestionsList {
  list-style: none;
  padding: 0;
  margin-top: 5px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
}

#suggestionsList li {
  padding: 8px;
  cursor: pointer;
}

#suggestionsList li:hover {
  background-color: #eee;
}

/* 排名表样式 */
#rankTable {
  width: 100%;
  border-collapse: collapse;
}

#rankTable th,
#rankTable td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#rankTable th {
  background-color: #333;
  color: white;
}

#rankTable tr:nth-child(even) {
  background-color: #f9f9f9;
}

#rankTable tr:hover {
  background-color: #e6e6e6;
}
/* 通用模态窗口样式 */
.modal {
  display: none;
  position: fixed;
  top: 15%; /* 窗口顶部距离屏幕 */
  left: 50%;
  transform: translate(-50%, 0);
  width: 90%; /* 默认占据屏幕宽度的90% */
  max-width: 700px; /* 限制最大宽度 */
  background-color: white;
  border-radius: 10px; /* 圆角边框 */
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2); /* 添加阴影 */
  z-index: 1000;
  padding: 20px; /* 内容与边框的内边距 */
  overflow-y: auto; /* 允许垂直滚动 */
}

/* 移动端模态窗口调整 */
@media screen and (max-width: 768px) {
  .modal {
    position: fixed; /* 固定定位 */
    width: 85%; /* 宽度改为85%，增加两侧的空隙 */
    margin: 0 auto; /* 居中显示 */
    left: 50%; /* 左右居中 */
    transform: translateX(-50%); /* 水平居中对齐 */
    padding: 15px; /* 内容内边距 */
  }

  .modal-content {
    width: 100%; /* 确保模态窗口内部内容自适应 */
    padding: 10px; /* 缩小内部间距 */
  }
}


.modal-content {
  background-color: #fefefe;
  padding: 20px; /* 模态窗口内边距 */
  width: 100%;
  max-width: 700px; /* 同样增加内容的最大宽度 */
  border-radius: 8px;
  text-align: left;
  max-height: 70vh;
  overflow-y: auto; /* 当内容溢出时显示滚动条 */
  position: relative;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  cursor: pointer;
  background-color: #f0f0f0;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  color: #333;
  z-index: 1001;
}

.close:hover {
  background-color: #ddd; /* 悬停效果 */
}

/* 天气标签放置在模态窗口右上角 */
.weather-info-box {
  display: block; /* 使用块显示 */
  background-color: transparent; /* 确保背景透明 */
  padding: 0; /* 移除多余的内边距 */
  margin: 0; /* 移除外边距 */
  border: none; /* 移除边框 */
  box-shadow: none; /* 移除阴影 */
   margin-top: 0; /* 移除顶部多余间距 */
  padding: 5px 0; /* 缩小内容的内边距 */
}



.chart-container {
  margin-top: 20px; /* 图表上方的间距 */
}

/* 为模态窗口的内容增加顶部间距 */
.modal-content > * {
  margin-top: 10px; /* 在内容之间增加间距 */
}

/* 给天气信息框的顶部增加空间 */
.weather-info-box {
  margin-top: 50px; /* 在天气框上方留出空间 */
}

/* 移动端样式 */
/* 移动端布局 */
@media screen and (max-width: 768px) {
  /* 地图区域调整，确保搜索栏显示在地图模块顶部 */
  #map {
    position: relative;
    padding-top: 80px; /* 为搜索栏留出空间 */
  }

  /* 搜索栏：置顶居中 */
  #searchContainer {
    position: absolute;
    top: 10px; /* 设置在地图顶部 */
    left: 50%; /* 居中对齐 */
    transform: translateX(-50%);
    width: 90%; /* 占据屏幕宽度的90% */
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* 确保在地图上方 */
  }

  /* 排名列表：显示在搜索栏下方 */
    #rankContainer {
    position: relative; /* 不再固定位置，跟随布局 */
    width: 85%; /* 宽度改为屏幕宽度的85% */
    margin: 10px auto; /* 左右自动居中，顶部和搜索栏留出间距 */
    padding: 15px; /* 内部填充 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    background-color: white; /* 保持白色背景 */
    z-index: 999; /* 确保在地图上方 */
    overflow-y: auto; /* 支持垂直滚动 */
  }
}
