/* ============================================================
   新手引导样式 — 遮罩 / 高亮 / 气泡 / 按钮 / 3D 标注
   ============================================================ */

/* ---- 遮罩层 ---- */
.guide-overlay {
  position: fixed;
  top: var(--titlebar-height, 38px);               /* 标题栏高度，确保关闭按钮永远可点击 */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  pointer-events: none;   /* ← 默认不拦截，让点击透传到场景 */
  transition: opacity 0.35s ease;
  opacity: 0;
}

/* modal 步骤需要拦截背景点击 */
.guide-overlay.guide-block-clicks {
  pointer-events: all;
}

.guide-svg-mask {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  pointer-events: none;
}

#guideHighlightCutout,
#guideHighlightBorder {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- 气泡 ---- */
.guide-bubble {
  position: absolute;
  z-index: 9600;
  pointer-events: all;    /* ← 气泡按钮始终可点 */
  background: var(--panel-bg, rgba(14, 24, 34, 0.96));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 14px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 255, 255, 0.08) inset,
    0 0 30px rgba(0, 255, 255, 0.1);
  min-width: 300px;
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  transition: top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.25s ease;
}

.guide-bubble.pos-center {
  max-width: 460px !important;
}

/* 气泡箭头 */
.guide-bubble-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--panel-bg, rgba(14, 24, 34, 0.96));
  border: 1px solid rgba(0, 255, 255, 0.4);
  transform: rotate(45deg);
  pointer-events: none;
}

/* 气泡朝上：箭头在底部 */
.guide-bubble.pos-bottom .guide-bubble-arrow {
  top: -7px;
  left: 50%;
  margin-left: -7px;
  border-right: none;
  border-bottom: none;
}

/* 气泡朝下：箭头在顶部 */
.guide-bubble.pos-top .guide-bubble-arrow {
  bottom: -7px;
  left: 50%;
  margin-left: -7px;
  border-left: none;
  border-top: none;
}

/* 气泡朝右：箭头在左侧 */
.guide-bubble.pos-left .guide-bubble-arrow {
  right: -7px;
  top: 50%;
  margin-top: -7px;
  border-top: none;
  border-right: none;
}

/* 气泡朝左：箭头在右侧 */
.guide-bubble.pos-right .guide-bubble-arrow {
  left: -7px;
  top: 50%;
  margin-top: -7px;
  border-bottom: none;
  border-left: none;
}

/* ---- 气泡头部 ---- */
.guide-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.guide-bubble-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-light, #aef0ff);
  letter-spacing: 0.3px;
}

.guide-bubble-progress {
  font-size: 12px;
  color: var(--text-secondary, #aac);
  font-weight: 500;
  background: rgba(0, 255, 255, 0.08);
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ---- 气泡正文 ---- */
.guide-bubble-body {
  padding: 12px 18px 6px;
  color: var(--text-primary, #eef);
  line-height: 1.65;
}

.guide-bubble-body kbd {
  background: rgba(0, 255, 255, 0.12);
  color: #0ff;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 255, 0.25);
  font-size: 12px;
  font-family: 'Segoe UI', Consolas, monospace;
}

/* ---- 气泡底部按钮 ---- */
.guide-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px;
  gap: 10px;
}

.guide-nav-btns {
  display: flex;
  gap: 8px;
}

.guide-btn {
  background: var(--btn-bg, rgba(20, 50, 65, 0.6));
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 8px;
  color: var(--text-secondary, #aac);
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.guide-btn:hover {
  background: var(--btn-hover, rgba(0, 200, 220, 0.25));
  color: var(--text-primary, #eef);
  border-color: rgba(0, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.15);
}

.guide-btn-skip {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  padding: 6px 12px;
}

.guide-btn-skip:hover {
  color: #e88;
  border-color: rgba(255, 100, 100, 0.3);
}

.guide-btn-next {
  background: rgba(0, 180, 200, 0.25);
  border-color: rgba(0, 255, 255, 0.4);
  color: #0ff;
  font-weight: 600;
}

.guide-btn-next:hover {
  background: rgba(0, 210, 230, 0.35);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.guide-btn-finish {
  background: rgba(0, 200, 150, 0.25) !important;
  border-color: rgba(0, 255, 200, 0.5) !important;
  color: #5fefcf !important;
}

.guide-btn-finish:hover {
  background: rgba(0, 230, 180, 0.4) !important;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.35) !important;
}

.guide-btn-action {
  background: rgba(0, 180, 200, 0.25);
  border-color: rgba(0, 255, 255, 0.4);
  color: #0ff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 28px;
}

.guide-btn-action:hover {
  background: rgba(0, 210, 230, 0.35);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.guide-btn-prev {
  font-size: 12px;
  padding: 7px 12px;
}

/* ---- 成功反馈层 ---- */
.guide-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 30, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.guide-success-overlay.guide-success-show {
  opacity: 1;
  transform: scale(1);
}

.guide-success-icon {
  font-size: 40px;
  animation: guideSuccessPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.guide-success-text {
  font-size: 18px;
  font-weight: 700;
  color: #5fefcf;
  letter-spacing: 1px;
}

@keyframes guideSuccessPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.guide-bubble-footer {
  transition: opacity 0.25s ease;
}

/* ---- 3D 标注标签 ---- */
.guide-3d-label {
  animation: guideLabelPulse 2s ease-in-out infinite;
}

@keyframes guideLabelPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---- 帮助面板中的「进入教程」按钮 ---- */
.help-header-guide-btn {
  background: rgba(0, 200, 220, 0.2);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 8px;
  color: #0ff;
  font-size: 13px;
  padding: 5px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: system-ui, sans-serif;
  margin-left: auto;
  margin-right: 8px;
  white-space: nowrap;
}

.help-header-guide-btn:hover {
  background: rgba(0, 230, 250, 0.3);
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}

/* ---- F2 轻量提示（教程结束后的浮动小条）---- */
.guide-f2-hint {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 9400;
  background: rgba(14, 24, 34, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 20px;
  padding: 8px 22px;
  color: #cde;
  font-size: 14px;
  font-family: system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 255, 255, 0.1);
  white-space: nowrap;
}

.guide-f2-hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.guide-f2-hint kbd {
  background: rgba(0, 255, 255, 0.15);
  color: #0ff;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.guide-f2-hint:hover {
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 255, 255, 0.2);
}

/* ---- 响应式 ---- */
@media (max-width: 600px) {
  .guide-bubble {
    min-width: 260px;
    max-width: 320px;
  }
  .guide-bubble-body {
    font-size: 12px;
    padding: 10px 14px 4px;
  }
  .guide-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}
