/* 监测点位悬浮数据卡：贴合平台浅色风格（白卡片/细边框/绿色点缀），标题栏拖动。 */
.mp-pop {
  position: fixed;
  z-index: 640;
  width: 372px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  font-family: "Microsoft YaHei", sans-serif;
  color: #1f2937;
}

.mp-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0ee;
  background: #fafbfa;
  border-radius: 10px 10px 0 0;
  cursor: move;
}

.mp-pop.dragging { box-shadow: 0 16px 40px rgba(0, 0, 0, .22); }

.mp-pop-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mp-color, #d97706);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-color, #d97706) 22%, transparent);
}

.mp-pop-title { flex: 1; min-width: 0; }
.mp-pop-title strong { display: block; font-size: 14px; line-height: 1.25; }
.mp-pop-title small { display: block; margin-top: 1px; color: #9aa3a0; font-size: 11px; }

.mp-pop-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
}

.mp-pop-close:hover { background: #eef6f1; color: var(--green, #0e7a52); }

.mp-pop-body { padding: 12px; max-height: 58vh; overflow-y: auto; user-select: text; }

.mp-pop-loading, .mp-pop-error {
  padding: 14px 4px;
  color: #6b7280;
  font-size: 12px;
}

.mp-pop-error { color: #b91c1c; }

.mp-pop-alarm {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
}

/* 最新读数：三块统计卡 */
.mp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mp-stat {
  padding: 8px 10px;
  border: 1px solid #eef0ee;
  border-radius: 8px;
  background: #f7f8f8;
}

.mp-stat span { display: block; color: #6b7280; font-size: 11px; }
.mp-stat b { font: 600 16px Consolas, monospace; color: #1f2937; }
.mp-stat small { margin-left: 2px; color: #9aa3a0; font-size: 10px; }

.mp-time { margin: 8px 2px 10px; color: #9aa3a0; font-size: 11px; }

/* 趋势图与指标切换 */
.mp-chart-tabs { display: flex; gap: 6px; margin-bottom: 6px; }

.mp-chart-tabs button {
  padding: 4px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  cursor: pointer;
}

.mp-chart-tabs button:hover { border-color: var(--green, #0e7a52); color: var(--green, #0e7a52); }

.mp-chart-tabs button.on {
  background: var(--green, #0e7a52);
  border-color: var(--green, #0e7a52);
  color: #fff;
}

.mp-chart svg {
  display: block;
  width: 100%;
  height: 88px;
  border: 1px solid #eef0ee;
  border-radius: 8px;
  background: #fcfdfc;
}

.mp-chart-max, .mp-chart-min { fill: #9aa3a0; font-size: 9px; font-family: Consolas, monospace; }
.mp-chart-cap { fill: #b8bfb9; font-size: 9px; }

.mp-chart-empty { padding: 22px 0; text-align: center; color: #9aa3a0; font-size: 11px; }

/* 历史记录 */
.mp-hist { margin-top: 10px; border-top: 1px dashed #e5e7eb; padding-top: 8px; }

.mp-hist summary { color: #374151; font-size: 12px; cursor: pointer; user-select: none; }
.mp-hist summary:hover { color: var(--green, #0e7a52); }

.mp-hist-scroll { max-height: 176px; overflow-y: auto; margin-top: 6px; }

.mp-hist table { width: 100%; border-collapse: collapse; font-size: 11.5px; }

.mp-hist th {
  position: sticky;
  top: 0;
  padding: 5px 6px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.mp-hist td {
  padding: 5px 6px;
  border-bottom: 1px solid #f4f5f4;
  color: #374151;
  font-family: Consolas, monospace;
  text-align: right;
  white-space: nowrap;
}

.mp-hist th:first-child, .mp-hist td:first-child { text-align: left; font-family: "Microsoft YaHei", sans-serif; }
.mp-hist tr:hover td { background: #f6faf7; }

/* 底部静态属性 */
.mp-meta { margin-top: 10px; border-top: 1px dashed #e5e7eb; padding-top: 8px; display: grid; gap: 4px; }

.mp-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; }
.mp-meta span { color: #6b7280; }
.mp-meta b { color: #374151; font-weight: 400; text-align: right; }
