/* hotspots.css — 不规则物件轮廓 + 点↔标签连线 + 悬停/聚焦浮窗 */

.hotspots {
  position: absolute;
  inset: 0;
  z-index: var(--z-hotspots);
  pointer-events: none;       /* 仅 shape/dot/label 本身可点 */
}

/* ── SVG 覆盖层：轮廓与连线 ── */
.hotspot-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
}

.hotspot-group {
  pointer-events: none;
  outline: none;
}

/* 不规则物件轮廓 */
.hotspot-shape {
  pointer-events: auto;
  cursor: pointer;
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition:
    fill var(--t-fast) var(--ease),
    stroke var(--t-fast) var(--ease),
    filter var(--t-fast) var(--ease);
}

.hotspot-group.is-active .hotspot-shape,
.hotspot-shape:hover,
.hotspot-shape:focus-visible {
  fill: rgba(217, 164, 65, 0.10);
  stroke: rgba(217, 164, 65, 0.78);
  filter: drop-shadow(0 0 14px rgba(217,164,65,0.35));
}

/* 点 → 标签的连线 */
.hotspot-line {
  pointer-events: none;
  stroke: rgba(243, 233, 212, 0.30);
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
  transition: stroke var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.hotspot-group.is-active .hotspot-line,
.hotspot-line.is-active {
  stroke: rgba(217, 164, 65, 0.85);
  filter: drop-shadow(0 0 5px rgba(217,164,65,0.45));
}

/* ── 中心热点脉冲点 ── */
.hotspot {
  --x: 50; --y: 50;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent;
  transition: transform var(--t-fast) var(--ease);
  z-index: 2;
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.14); }
.hotspot:focus-visible { transform: translate(-50%, -50%) scale(1.14); outline: none; }

.hotspot__dot {
  position: relative;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #f5ecd7;
  box-shadow:
    0 0 0 3px rgba(217,164,65,0.55),
    0 1px 6px rgba(0,0,0,0.45),
    0 0 12px rgba(217,164,65,0.55);
  z-index: 2;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.hotspot.is-active .hotspot__dot,
.hotspot:hover .hotspot__dot,
.hotspot:focus-visible .hotspot__dot {
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(217,164,65,0.75),
    0 1px 8px rgba(0,0,0,0.55),
    0 0 18px rgba(217,164,65,0.85);
}

.hotspot__ping {
  position: absolute;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: rgba(217,164,65,0.55);
  opacity: 0.55;
  animation: hotspot-ping 2.4s var(--ease) infinite;
}
.hotspot__ping--2 { animation-delay: 1.2s; }

@keyframes hotspot-ping {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(3.0); opacity: 0; }
  100% { transform: scale(3.0); opacity: 0; }
}

/* ── 浮动应用名标签（连线终点） ── */
.hotspot-name {
  --lx: 50; --ly: 50;
  position: absolute;
  left: calc(var(--lx) * 1%);
  top: calc(var(--ly) * 1%);
  transform: translate(-50%, calc(-100% - 10px));
  z-index: 3;
  white-space: nowrap;
  font-family: var(--font-label);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #f3e9d4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(22, 15, 9, 0.55);
  border: 1px solid rgba(196, 168, 130, 0.42);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  cursor: pointer;
  transition:
    opacity var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
  opacity: 0.82;
}
.hotspot-name.is-active,
.hotspot-name:hover {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 14px));
  background: rgba(38, 29, 21, 0.82);
  border-color: rgba(217, 164, 65, 0.75);
}
/* 触屏：标签常显，脉冲点略大方便点按 */
@media (hover: none) {
  .hotspot-name {
    opacity: 1;
    font-size: var(--fs-11);
    padding: 4px 9px;
  }
  .hotspot { width: 50px; height: 50px; }
  .hotspot__dot { width: 15px; height: 15px; }
  .hotspot-shape:hover { fill: rgba(217, 164, 65, 0.08); }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  .hotspot__ping { animation: none; opacity: 0; }
}

/* 校准模式：隐藏所有热区与标签，只显示 crosshair */
body.is-calibrating .room { cursor: crosshair; }
body.is-calibrating .hotspots { pointer-events: none; }
body.is-calibrating .hotspot-svg,
body.is-calibrating .hotspot,
body.is-calibrating .hotspot-name,
body.is-calibrating .popover { display: none; }
.calib-tip {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 70; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 14px; font-family: var(--font-label);
  font-size: var(--fs-12); color: var(--text-secondary); box-shadow: var(--shadow-1);
}
