/* 与 Tailwind 互补的局部样式 */

.card-surface {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* 热区：默认可点，父层 hotspot-layer 在 JS 里对子元素开启 pointer-events */
.hotspot {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0.5rem;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease,
    background-color 0.15s ease;
}

.hotspot:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

.hotspot.is-active {
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.85),
    inset 0 0 0 9999px rgba(251, 191, 36, 0.22);
  transform: scale(1.02);
}

.hotspot.is-pressed {
  background-color: rgba(124, 58, 237, 0.12);
}

/* 调试：显示热区范围与序号（由 body.hotspot-debug-on 控制） */
.hotspot-debug-badge {
  pointer-events: none;
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
  display: none;
  min-width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  background: rgba(124, 58, 237, 0.92);
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

body.hotspot-debug-on .hotspot {
  outline: 2px dashed rgba(124, 58, 237, 0.9);
  outline-offset: -1px;
  background: rgba(124, 58, 237, 0.1);
}

body.hotspot-debug-on .hotspot-debug-badge {
  display: flex;
}

body.hotspot-debug-on .hotspot.is-active {
  outline-style: solid;
  outline-color: rgba(245, 158, 11, 0.95);
  background: rgba(251, 191, 36, 0.2);
}

/* 自定义热区：框选层（编辑模式显示） */
.hotspot-draw-layer {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#hotspot-draw-preview {
  box-sizing: border-box;
  z-index: 1;
}

body.hotspot-edit-on {
  -webkit-user-select: none;
  user-select: none;
}

/* 控制按钮激活态（播放中） */
.ctrl-btn.is-playing {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
}

.ctrl-btn.is-playing-mine {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45);
}

.ctrl-btn.is-playing-compare {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5);
}

/* 录音按钮按下 */
.btn-record.is-recording {
  background: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.55);
}

/* 录音指示灯闪烁 */
@keyframes rec-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

.rec-dot {
  animation: rec-pulse 1s ease-in-out infinite;
}

/* 小屏安全区 */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
