/* 首页地图业务改造：全幅地图、文字工具、异常与方位追踪。 */
.tbar .t-item { position: relative; }
.tbar .t-item .tcount {
  position: absolute;
  top: 5px;
  left: calc(50% + 7px);
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  border: 2px solid #fff;
  font: 800 10px/1 var(--app-font);
  font-style: normal;
}
.tbar .t-item .tcount.is-total {
  background: var(--g-700);
}
.map.mh-map.is-overview { height: auto; min-height: 0; flex: 1; }
.home-filter-bar {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.home-filter-bar .btn { flex: 1; height: 48px; }
.home-filter-bar .btn-o { flex: 0 0 108px; }
.map-btn { position: relative; }
.map-btn-count {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1.5px solid #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--g-700);
  color: #fff;
  font: 800 9px/1 var(--app-font);
  font-style: normal;
}
.map.mh-map.is-drawing { cursor: crosshair; }
.map.mh-map.is-drawing.is-circle, .map.mh-map.is-drawing.is-drawn { cursor: grab; }
.map.mh-map.is-drawn .fence-vertex { pointer-events: auto; cursor: pointer; }
.map.mh-map.is-drawing .map-viewport .map-animal,
.map.mh-map.is-drawing .map-viewport .cluster-pin { pointer-events: none; }
.home-fence-draw .fence-cross, .home-fence-draw .fence-center-hit { pointer-events: auto; cursor: grab; touch-action: none; }
.home-fence-draw .fence-vertex,
.fence-edit-map.is-live-create .fence-vertex { pointer-events: auto; cursor: pointer; }
.home-fence-draw, .home-fence-draw .fence-poly, .home-fence-draw .fence-circle, .home-fence-draw .fence-tag, .home-fence-draw .fence-cross { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.home-fence-draw .fence-circle, .home-fence-draw .fence-tag, .home-fence-draw .fence-cross, .home-fence-draw .fence-center-hit { inset: auto; }
.home-fence-circle, .home-fence-cross, .home-fence-draw .fence-center-hit { left: 50%; top: 50%; }
.home-fence-radius { position: absolute; left: 12px; right: 12px; bottom: 72px; z-index: 6; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: var(--sh-1); }
.home-fence-radius span, .home-fence-radius b { flex: none; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.home-fence-radius input { flex: 1; min-width: 0; }
.home-fence-radius-tag { left: 50%; top: calc(50% + 28px); }
.home-fence-cross { width: 104px; height: 104px; }
.home-fence-cross i:first-child { left: 0; right: 0; top: 50%; height: 1px; }
.home-fence-cross i:last-child { top: 0; bottom: 0; left: 50%; width: 1px; }
.home-fence-tip { left: 50%; right: auto; top: 16px; z-index: 6; width: max-content; max-width: 78%; transform: translateX(-50%); border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.94); box-shadow: var(--sh-1); font-size: 13px; font-weight: 700; }
.fence-vertex-map { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; background: #E5484D; color: #fff; font: 700 11px/1 system-ui; box-shadow: 0 1px 4px rgba(0,0,0,.28); }
.home-fence-actions { position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 6; display: flex; gap: 8px; }
.fence-edit-map.is-creating .amap-logo,
.fence-edit-map.is-creating .amap-copyright { bottom: 76px; }
.fence-edit-map.is-live-create { position: absolute; top: 96px; right: 0; bottom: 0; left: 0; z-index: 2; min-height: 0; height: auto; flex: none; }
.fence-edit-map.is-live-create .map-viewport,
.fence-edit-map.is-live-create .map-art,
.fence-edit-map.is-live-create .map-art .amap-host { position: absolute; inset: 0; }
.fence-edit-map.is-live-create.is-creating .map-art,
.fence-edit-map.is-live-create.is-creating .map-art .amap-host { pointer-events: auto; }
.fence-edit-map.is-live-create .map-ctrl { top: 12px; right: 14px; left: auto; transform: none; }
.fence-edit-map.is-live-create .home-fence-sheet,
.fence-create-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; max-height: 62%; margin: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(20,40,28,.16); }
.home-fence-actions button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: #fff; color: var(--ink-2); box-shadow: 0 1px 4px rgba(0,0,0,.16); font: inherit; font-size: 15px; font-weight: 700; }
.home-fence-actions .fence-adjust-done { background: var(--g-700); color: #fff; }
.home-fence-actions .fence-adjust-delete { color: var(--danger); }
.home-fence-actions button:disabled { opacity: .4; }
.map.is-drawn .home-fence-actions, .fence-edit-map.is-drawn .home-fence-actions { justify-content: flex-end; }
.map.is-drawn .home-fence-actions button, .fence-edit-map.is-drawn .home-fence-actions button { flex: none; min-width: 96px; }
.home-fence-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; flex: none; flex-direction: column; height: auto; max-height: 62%; margin: 0; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(20,40,28,.16); overflow: hidden; }
.map.is-fullscreen {
  position: absolute;
  inset: 0;
  z-index: 8;
  height: auto;
}
.map-art.is-live { background: #e8eef2; }
.map-art.is-live .amap-host,
.map-art.is-live .amap-host .amap-container { position: absolute; inset: 0; width: 100%; height: 100%; }
.map:has(.map-art.is-live) { overscroll-behavior: contain; }
.map-art.is-live .amap-logo,
.map-art.is-live .amap-copyright { transform: scale(.72); transform-origin: left bottom; z-index: 1; }
.fence-edit-map .map-art.is-live,
.fence-edit-map .map-art.is-live .amap-host,
.fence-edit-map.is-creating .map-art.is-live { pointer-events: none; }
.amap-marker .map-animal { position: relative; left: auto; top: auto; transform: none; display: block; }
.amap-maps .cluster-pin, .amap-marker .cluster-pin { position: absolute; left: 0; top: 0; margin: 0; }
.home-fence-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.home-fence-layer[hidden], .map-art.is-live ~ .home-fence-layer { display: none; }
.home-fence-layer svg { width: 100%; height: 100%; overflow: visible; }
.home-fence-layer span {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 108px;
  padding: 2px 5px;
  border: 1px solid;
  border-radius: 5px;
  background: rgba(255,255,255,.9);
  color: var(--ink-2);
  font: 700 9px/1.2 var(--app-font);
  white-space: nowrap;
}
.map-btn {
  width: 60px;
  height: 52px;
  min-height: 52px;
  padding: 5px 3px 4px;
  grid-template-rows: 23px auto;
  gap: 2px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.13);
}
.map-btn::before { width: 60px; height: 52px; box-shadow: none; }
.map-btn.is-on { color: var(--g-700); }
.map-btn.is-on::before { background: var(--g-050); box-shadow: inset 0 0 0 1.5px var(--g-700); }
.map-btn-label {
  max-width: 56px;
  color: var(--ink-2);
  font: 700 10px/1.05 var(--app-font);
  text-align: center;
  overflow-wrap: anywhere;
}
.map-ctrl { gap: 10px; max-height: calc(100% - 24px); overflow-y: auto; scrollbar-width: none; }
.map-ctrl::-webkit-scrollbar { display: none; }
	.map.mh-map[data-anchor="mapHomeMap"] > .map-ctrl[data-anchor="mapctrl"] { top: 12px; }
.map.mh-map[data-anchor="mapHomeMap"] > .map-refresh { bottom: 16px; }

	/* 异常：顶部筛选、全幅地图、右侧搜索。 */
.attention-page { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.attention-filters {
  flex: none;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.attention-filter {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-3);
  font: 700 12px/1.1 var(--app-font);
  white-space: nowrap;
}
.attention-filter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.attention-filter b { flex: none; font-variant-numeric: tabular-nums; }
.attention-filter.on { color: var(--g-700); border-color: var(--g-500); background: var(--g-050); }
	.attention-map { flex: 1; min-height: 0; }
	.attention-map .map-ctrl { max-height: calc(100% - 16px); }
	.attention-map .map-refresh { bottom: 16px; }
.attention-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 3;
  min-width: 190px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: var(--g-700);
  box-shadow: var(--sh-2);
}
/* 设备摘要：头像已含物种、性别和状态；电量在页头，正文留设备类型、定位时间和所属分组。 */
.map-device-sheet.compact { max-height: 82%; overflow-y: auto; padding-bottom: 8px; }
.map-device-sheet.compact .map-device-head { gap: 8px; padding: 6px 12px 10px; }
.map-device-sheet.compact .map-device-title h2 { font-size: 16px; }
.map-device-sheet.compact .map-device-title h2 small { display: block; margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.map-device-battery { margin-top: 4px; display: flex; align-items: center; gap: 3px; color: var(--g-700); font-size: 12px; font-weight: 700; }
.map-device-battery.low { color: var(--danger); }
.map-summary-main { margin: 0 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.summary-alert { margin: 0 0 8px; }
.summary-alert .summary-row span { color: var(--danger-d); }
.summary-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 10px; align-items: start; }
.summary-row + .summary-row { margin-top: 6px; }
.summary-row span { color: var(--ink-4); font-size: 11px; line-height: 1.4; }
.summary-row b { color: var(--ink-2); font-size: 12px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.summary-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-tags:empty { display: none; }
.summary-meta { display: grid; gap: 0; margin-top: 0; }
.summary-place { margin-top: 8px; color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.summary-detail-hint { margin-top: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink-4); }
.map-device-sheet.compact .map-device-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; padding: 8px 6px 0; }
.map-device-actions .summary-action { min-width: 0; min-height: 56px; padding: 5px 2px; font-size: 11px; }
[data-od-id="attention-device-details"] .map-device-actions { display: flex; align-items: stretch; }
[data-od-id="attention-device-details"] .summary-action { flex: 1 1 0; }
[data-od-id="attention-device-details"] .summary-action.is-secondary { flex: 0 0 52px; margin-left: 4px; border-left: 1px solid var(--line); color: var(--ink-3); }
.device-full-details { overflow-y: auto; padding-bottom: 12px; }
.device-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.device-edit-sex { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.device-edit-sex-button { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink-2); }
.device-edit-sex-button b { font-size: 22px; }
.device-edit-sex-button.s-M b { color: #1686E8; }
.device-edit-sex-button.s-F b { color: #E84C9B; }
.device-edit-sex-button.is-selected { border-color: var(--g-500); background: var(--g-050); }
.fence-color-row { min-height: 48px; width: 100%; display: flex; align-items: center; gap: 8px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--ink-2); font: inherit; font-size: 16px; text-align: left; }
.fence-color-row i { width: 22px; height: 22px; margin-left: auto; border: 1px solid var(--line); border-radius: 50%; }
.fence-color-row b { font-size: 13px; font-weight: 650; color: var(--ink-3); }
.fence-color-picker { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.fence-color-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fence-color-picker i { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; }
.fence-color-picker b { font-size: 16px; color: var(--ink-2); }
.fence-color-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.fence-color-option { min-height: 44px; padding: 5px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-2); font-size: 10.5px; }
.fence-color-option i { width: 15px; height: 15px; border-radius: 50%; }
.fence-color-option.is-selected { border-color: var(--g-600); box-shadow: 0 0 0 2px var(--g-100); }
.help-hero { margin: 14px; padding: 22px 16px; border-radius: 16px; background: var(--g-050); color: var(--g-700); text-align: center; }
.help-hero h2 { margin: 8px 0 4px; font-size: 20px; }
.help-hero p { margin: 0; color: var(--ink-3); font-size: 12px; }
.help-note { margin: 0 14px 14px; padding: 4px 2px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.help-note p { margin: 0 0 10px; }
.help-points { margin: 0 14px 18px; padding: 0 0 0 1.3em; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.help-points li { margin: 0 0 10px; padding-left: 2px; }
.help-points li::marker { color: var(--g-700); }

/* 追踪页：普通页面，我的位置是固定在广州的方向圆圈。 */
.amap-marker .my-location, .amap-marker .map-animal, .amap-marker .tracking-distance { position: relative; left: auto; top: auto; transform: none; }
.my-location-stage { position: absolute; z-index: 4; transform: translate(-50%,-50%); pointer-events: none; }
.my-location { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.my-location > em { padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.92); color: #1d4f8c; font: 700 9px/1.2 var(--app-font); font-style: normal; box-shadow: 0 1px 3px rgba(0,0,0,.16); }
.my-location-ring {
  position: relative;
  width: 92px;
  height: 92px;
  border: 2px solid #2f7de1;
  border-radius: 50%;
  background: rgba(47,125,225,.12);
  box-shadow: 0 0 0 1px rgba(255,255,255,.7);
}
.my-location-ring > span { position: absolute; color: #1d4f8c; font: 800 10px/1 var(--app-font); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.my-location-ring .dir-n { left: 50%; top: 5px; transform: translateX(-50%); }
.my-location-ring .dir-e { right: 5px; top: 50%; transform: translateY(-50%); }
.my-location-ring .dir-s { left: 50%; bottom: 5px; transform: translateX(-50%); }
.my-location-ring .dir-w { left: 5px; top: 50%; transform: translateY(-50%); }
.my-location-beam {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 28px solid #2f7de1;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.8));
}
.my-location-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%,-50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2f7de1;
  box-shadow: 0 1px 4px rgba(20,60,120,.45);
}
.tracking-track, .tracking-bearing { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tracking-track { z-index: 2; }
.tracking-track path { fill: none; stroke: #2D7DFF; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tracking-bearing { z-index: 3; }
.tracking-bearing line { stroke: rgba(255,255,255,.9); stroke-width: 1.2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.amap-marker:has(.tracking-distance) { width: auto !important; height: auto !important; }
.tracking-distance, .amap-marker .tracking-distance { position: relative; left: auto; top: auto; display: inline-block; width: auto; white-space: nowrap; transform: translateY(-8px); z-index: 4; padding: 3px 8px; border-radius: 5px; background: #1677FF; color: #fff; font: 800 12px/1.2 var(--app-font); box-shadow: 0 1px 4px rgba(12,60,140,.35); pointer-events: none; }
.monitoring-map .map-ctrl { top: 12px; }
.monitoring-map .map-refresh { bottom: 16px; }
.monitoring-map .map-float-back { position: absolute; left: 12px; top: 12px; z-index: 5; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.16); cursor: pointer; padding: 0; }
.monitoring-map .map-float-back:hover { background: var(--g-050); }
.tracking-map-hint { position: absolute; left: 50%; top: 16px; z-index: 4; transform: translateX(-50%); max-width: 70%; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink-2); font-size: 13px; font-weight: 700; box-shadow: var(--sh-1); pointer-events: none; }
.tracking-detail-head { position: relative; display: flex; justify-content: center; padding: 16px 48px 0; }
.tracking-detail-title { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; color: var(--ink); text-align: center; }
.tracking-detail-title b { font-size: 17px; line-height: 1.3; }
.tracking-detail-title small { color: var(--ink-4); font-size: 12px; font-weight: 600; }
.tracking-detail-close { position: absolute; top: 10px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.tracking-detail-close:hover { background: var(--fill); color: var(--ink); }
.tracking-detail-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 16px 0; }
.chip.s-male { background: #E8F3FC; color: #1686E8; }
.chip.s-female { background: #FDE8F2; color: #E84C9B; }
.tracking-detail-time { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 16px 0; color: var(--ink-3); font-size: 12px; }
.dlg-sheet .tracking-stats .st { text-align: center; }
.tracking-detail-distance { display: flex; align-items: center; justify-content: space-between; margin: 12px 16px 16px; padding: 10px 12px; border-radius: 12px; background: var(--g-050); color: var(--ink-3); font-size: 12px; }
.tracking-detail-distance b { color: var(--ink); font-size: 16px; }
.dlg-sheet .tracking-stats { margin: 14px 16px 0; }
.dlg-sheet .tracking-warning { margin: 12px 16px 0; text-align: center; }
.tracking-sheet.compact { padding: 10px 12px; }
.tracking-context { margin-top: 8px; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 10.5px; }
.tracking-context > span:last-child { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tracking-sheet.compact .tracking-stats { margin-top: 8px; }
.tracking-warning { margin-top: 7px; padding: 6px 8px; border-radius: 7px; background: #FFF6E5; color: #8A5A00; font-size: 10.5px; line-height: 1.35; }
.tracking-empty-device { display: flex; align-items: center; gap: 10px; color: var(--g-700); }
.tracking-empty-device > div { flex: 1; min-width: 0; }
.tracking-empty-device b { color: var(--ink); font-size: 14px; }
.tracking-empty-device p { margin: 4px 0 0; color: var(--ink-3); font-size: 10.5px; line-height: 1.35; }

	
