/* ?hotspotEdit=1 — 拖拉角點微調框位（desktop） */

body[data-hotspot-edit] .mp4-hotspots {
  z-index: 20;
  pointer-events: auto;
}

body[data-hotspot-edit] .chat-widget {
  opacity: 0.22;
  pointer-events: none;
}

body[data-hotspot-edit] .mp4-hotspot {
  cursor: move;
  z-index: 3;
  outline: 2px dashed rgba(255, 213, 106, 0.85);
  background: rgba(255, 213, 106, 0.18);
}

body[data-hotspot-edit] .mp4-hotspot.is-editor-selected,
body[data-hotspot-edit] .mobile-hotspot.is-editor-selected {
  outline: 2px solid #ffd56a;
  z-index: 5;
}

.hotspot-editor__handle {
  position: absolute;
  z-index: 6;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ff3355;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.hotspot-editor__handle:active {
  cursor: grabbing;
  background: #ffd56a;
}

.hotspot-editor__handle--tl { cursor: nwse-resize; }
.hotspot-editor__handle--tr { cursor: nesw-resize; }
.hotspot-editor__handle--br { cursor: nwse-resize; }
.hotspot-editor__handle--bl { cursor: nesw-resize; }

.hotspot-editor__handle--middle {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 3px;
  background: #33dd88;
  border-color: #0a3d22;
}

.hotspot-editor__handle--tm { cursor: ns-resize; }
.hotspot-editor__handle--bm { cursor: ns-resize; }

body[data-hotspot-edit]::before {
  content: '框位編輯 — 紅角改形 · 綠點上下邊拉高拉低 · 1px 微調 →「複製全部設定」';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 10px 14px;
  background: linear-gradient(90deg, #8b6914, #c9a227);
  color: #fff;
  font: 700 13px/1.4 system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.hotspot-editor-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 200;
  width: min(360px, calc(100vw - 24px));
  max-height: 72vh;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 6, 4, 0.95);
  border: 1px solid rgba(255, 213, 106, 0.55);
  color: #f5e6c8;
  font: 12px/1.45 system-ui, sans-serif;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
}

.hotspot-editor-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px -2px 6px;
  padding: 4px 2px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.hotspot-editor-panel.is-dragging .hotspot-editor-panel__head {
  cursor: grabbing;
}

.hotspot-editor-panel__head strong {
  display: block;
  color: #ffd56a;
  font-size: 14px;
  margin: 0;
}

.hotspot-editor-panel__grip {
  opacity: 0.75;
  font-size: 16px;
  line-height: 1;
}

.hotspot-editor-panel p {
  margin: 0 0 8px;
  opacity: 0.85;
}

.hotspot-editor-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.hotspot-editor-panel__actions button {
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #c9a227, #8b6914);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.hotspot-editor-panel__actions button:hover {
  filter: brightness(1.06);
}

.hotspot-editor-panel__actions button.is-secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 213, 106, 0.35);
}

.hotspot-editor-panel__nudge {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 213, 106, 0.2);
}

.hotspot-editor-panel__nudge-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.hotspot-editor-panel__nudge-row:last-child {
  margin-bottom: 0;
}

.hotspot-editor-panel__nudge-row span {
  flex: 0 0 32px;
  font-size: 10px;
  opacity: 0.8;
}

.hotspot-editor-panel__nudge-row button {
  flex: 1;
  margin: 0;
  padding: 5px 4px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffe8b0;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.hotspot-editor-panel__nudge-row button:hover {
  background: rgba(255, 213, 106, 0.25);
}

.hotspot-editor-panel__status {
  margin: 0 0 8px;
  color: #5dff9a;
  font-size: 11px;
}

.hotspot-editor-panel pre {
  margin: 0;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 213, 106, 0.2);
  color: #ffe8b0;
  font-size: 10px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
