/* Bootstrap Reboot 已提供 box-sizing 与基础 reset */

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f2f5;
  height: 100vh;
  overflow: hidden;
}

.layout {
  display: flex;
  height: 100vh;
}

/* ---- 左侧面板 ---- */
.panel {
  width: 300px;
  min-width: 300px;
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 13px; color: #555; font-weight: 600; }

/* 单行设置项：label 固定宽靠左，控件紧跟其后左对齐 */
.control-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.control-row label {
  font-size: 13px;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 72px; /* 统一 label 宽度，保证控件左边缘对齐 */
}
.control-row .inline-check {
  flex: 0 0 auto;
}
.control-row .form-control,
.control-row .form-select {
  width: 172px;
  flex: 0 0 auto;
}

/* 缩小 Input / Select 聚焦时的外光圈 */
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 .1rem rgba(25, 135, 84, .25);
  border-color: #198754;
}
.form-check-input:focus {
  box-shadow: 0 0 0 .1rem rgba(25, 135, 84, .25);
  border-color: #198754;
}

textarea.form-control { resize: vertical; }

/* 批量导入 placeholder 颜色调浅（默认 #6c757d 较深） */
#batchInput::placeholder {
  color: #b8b8b8;
}

/* 表单控件统一小字号：与 13px 标签/表格文字一致 */
.form-control-sm, .form-select-sm, .btn-sm { font-size: 13px; }

.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* 地图模式切换（按钮式 radio） */
.mode-switch { display: flex; gap: 8px; }
.mode-switch .btn { flex: 1; }

/* 随机数范围 */
.range-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-inline input {
  flex: 1;
  min-width: 0;
}
/* control-row 中的随机范围：两个输入框固定窄宽，右侧显示 */
.control-row .range-inline input {
  flex: 0 0 72px;
}

/* 显示设置：省份 / 数字 两个复选框 */
.show-checks {
  display: flex;
  gap: 14px;
}
/* 数字颜色下拉：紧凑宽度 */
.show-checks select {
  width: 78px;
}
.show-checks .inline-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}
.range-sep { font-size: 13px; color: #777; white-space: nowrap; }

/* 对齐微调 */
.align-grid {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 6px 8px;
  align-items: center;
}
.align-grid span { font-size: 12px; color: #777; white-space: nowrap; }
.align-grid input {
  min-width: 0;
}

/* 地图左下角图例（图片模式，垂直柱型） */
.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  pointer-events: none;
}
.legend-bar {
  width: 16px;
  height: 110px;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: linear-gradient(to top, #E7F1FF, #0D6EFD);
}
.legend-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #555;
  line-height: 1.2;
  white-space: nowrap;
}

/* 数据表 */
.table-wrap { flex: 1; }
/* 区域快速选择 */
.region-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fafbfc;
}
.region-line { display: flex; align-items: flex-start; gap: 10px; }
.region-title {
  font-size: 12px;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 1px;
  min-width: 48px;
}
.region-checks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.region-checks label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #666;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}
.region-checks .form-check-input {
  width: 13px;
  height: 13px;
  margin: 0;
}

#dataTable { width: 100%; border-collapse: collapse; font-size: 13px; }

#dataTable th, #dataTable td {
  border: 1px solid #e5e5e5;
  padding: 8px;
  text-align: left;
}
#dataTable .col-check { width: 40px; text-align: center; }
#dataTable .col-province { width: 80px; }
#dataTable td.col-check, #dataTable th.col-check { padding: 4px 6px; text-align: center; }
#dataTable thead th { background: #f7f7f7; text-align: center; }
#dataTable td { white-space: nowrap; text-align: center; padding: 4px; }

#dataTable .col-check input {
  margin: 0;
  position: relative;
  top: 2px;
}
#checkAll { width: 14px; height: 14px; }
#dataTable tbody tr { cursor: pointer; }
#dataTable tbody tr:hover { background: #f5f8ff; }

/* ---- 地图区域 ---- */
.map-area {
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 宽度同时受容器宽度与可视高度限制（map.jpg 宽高比约 1.414），保证完整显示且无滚动条 */
.map-container {
  position: relative;
  top: -30px;
  width: min(100%, 1200px, calc((100vh - 100px) * 1.4142));
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.map-base {
  display: block;
  width: 100%;
  height: auto;
}

/* ECharts 容器：与图片模式同宽高比（4961/3508 ≈ 1.4142） */
#chartContainer {
  aspect-ratio: 4961 / 3508;
}

/* SVG 覆盖层：铺满整个容器 */
.svg-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.svg-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}
.svg-layer svg path {
  pointer-events: auto;
  cursor: pointer;
  transition: fill .2s;
}
svg text.map-label {
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}
/* 悬浮提示（覆盖 Bootstrap .tooltip 的 opacity:0） */
.tooltip {
  position: fixed;
  display: none;
  opacity: 1;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 99;
  white-space: nowrap;
}
