/**
 * StoryTree 用户引导样式覆盖
 * 将 Driver.js 默认蓝色主题适配为 StoryTree 绿色主题 (#2d5d5a)
 */

/* ===== 遮罩层 ===== */
.driver-overlay {
  background: rgba(15, 23, 42, 0.65) !important;
}

/* ===== 弹窗容器 ===== */
.driver-popover {
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(45, 93, 90, 0.25), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(45, 93, 90, 0.15) !important;
  max-width: 360px !important;
  min-width: 280px !important;
  padding: 20px 24px !important;
}

/* ===== 弹窗标题 ===== */
.driver-popover-title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #2d5d5a !important;
}

/* ===== 弹窗描述 ===== */
.driver-popover-description {
  color: #4a5568 !important;
  line-height: 1.6 !important;
  font-size: 14px !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* ===== 进度条 ===== */
.driver-popover-progress-text {
  color: #2d5d5a !important;
  font-weight: 600 !important;
}

/* ===== 导航按钮 ===== */
.driver-popover-prev-btn {
  background: #f0f4f3 !important;
  color: #2d5d5a !important;
  border: 1px solid #c8d8d6 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.driver-popover-prev-btn:hover {
  background: #e0eae8 !important;
  border-color: #2d5d5a !important;
}

.driver-popover-next-btn {
  background: linear-gradient(135deg, #2d5d5a 0%, #3a7a76 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(45, 93, 90, 0.3) !important;
  transition: all 0.2s ease !important;
}

.driver-popover-next-btn:hover {
  background: linear-gradient(135deg, #245250 0%, #2d5d5a 100%) !important;
  box-shadow: 0 6px 16px rgba(45, 93, 90, 0.4) !important;
  transform: translateY(-1px) !important;
}

.driver-popover-close-btn {
  color: #2d5d5a !important;
}

.driver-popover-close-btn:hover {
  color: #1a3d3b !important;
}

/* ===== 跳过引导按钮 ===== */
.st-tour-skip-btn {
  background: transparent !important;
  color: #9ca3af !important;
  border: none !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border-radius: 6px !important;
  margin-left: 4px !important;
}

.st-tour-skip-btn:hover {
  color: #2d5d5a !important;
  background: #f0f4f3 !important;
}

/* ===== 高亮区域边框 ===== */
.driver-active-element {
  box-shadow: 0 0 0 4px rgba(45, 93, 90, 0.5), 0 0 20px 4px rgba(45, 93, 90, 0.15) !important;
  border-radius: 8px !important;
}

/* ===== 弹窗箭头 ===== */
.driver-popover-arrow-side-left,
.driver-popover-arrow-side-right,
.driver-popover-arrow-side-top,
.driver-popover-arrow-side-bottom {
  border-color: white !important;
}

/* ===== 暗黑模式 ===== */
@media (prefers-color-scheme: dark) {
  .driver-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
  }

  .driver-popover {
    background: #1f2937 !important;
    border-color: rgba(110, 231, 183, 0.2) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }

  .driver-popover-title {
    color: #6ee7b7 !important;
  }

  .driver-popover-description {
    color: #d1d5db !important;
  }

  .driver-popover-progress-text {
    color: #6ee7b7 !important;
  }

  .driver-popover-prev-btn {
    background: #374151 !important;
    color: #d1d5db !important;
    border-color: #4b5563 !important;
  }

  .driver-popover-prev-btn:hover {
    background: #4b5563 !important;
    border-color: #6ee7b7 !important;
    color: #6ee7b7 !important;
  }

  .driver-popover-next-btn {
    background: linear-gradient(135deg, #2d5d5a 0%, #059669 100%) !important;
    box-shadow: 0 4px 12px rgba(6, 150, 105, 0.3) !important;
  }

  .driver-popover-next-btn:hover {
    background: linear-gradient(135deg, #245250 0%, #047857 100%) !important;
    box-shadow: 0 6px 16px rgba(6, 150, 105, 0.4) !important;
  }

  .driver-popover-close-btn {
    color: #9ca3af !important;
  }

  .driver-popover-close-btn:hover {
    color: #f9fafb !important;
  }

  .st-tour-skip-btn {
    color: #6b7280 !important;
  }

  .st-tour-skip-btn:hover {
    color: #6ee7b7 !important;
    background: #374151 !important;
  }

  .driver-active-element {
    box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.4) !important;
  }

  .driver-popover-arrow-side-left,
  .driver-popover-arrow-side-right,
  .driver-popover-arrow-side-top,
  .driver-popover-arrow-side-bottom {
    border-color: #1f2937 !important;
  }
}

/* ===== 按钮文字不换行（全局，确保任何分辨率都单行显示） ===== */
.driver-popover-prev-btn,
.driver-popover-next-btn,
.st-tour-skip-btn,
.driver-popover-progress-text {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.driver-popover-footer {
  display: flex;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

/* 单步高亮模式隐藏导航按钮（通过 popoverClass 控制） */
.driver-popover.st-highlight-only .driver-popover-footer {
  display: none !important;
}

/* ===== 概念引导高亮步骤（含操作按钮） ===== */
.driver-popover.st-concept-highlight .driver-popover-footer {
  display: none !important;
}

.st-concept-highlight-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(45, 93, 90, 0.1);
}

.st-concept-highlight-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #2d5d5a 0%, #3a7a76 100%);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(45, 93, 90, 0.3);
}

.st-concept-highlight-cta:hover {
  background: linear-gradient(135deg, #245250 0%, #2d5d5a 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 93, 90, 0.4);
}

.st-concept-highlight-dismiss {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: transparent;
  color: #9ca3af;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.st-concept-highlight-dismiss:hover {
  color: #2d5d5a;
  background: #f0f4f3;
}

@media (prefers-color-scheme: dark) {
  .st-concept-highlight-actions {
    border-top-color: rgba(110, 231, 183, 0.15);
  }

  .st-concept-highlight-cta {
    background: linear-gradient(135deg, #2d5d5a 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(6, 150, 105, 0.3);
  }

  .st-concept-highlight-dismiss {
    color: #6b7280;
  }

  .st-concept-highlight-dismiss:hover {
    color: #6ee7b7;
    background: #374151;
  }
}

/* ===== 移动端响应式 (375px 适配) ===== */
@media (max-width: 480px) {
  .driver-popover {
    max-width: calc(100vw - 24px) !important;
    min-width: unset !important;
    border-radius: 12px !important;
    margin: 0 12px !important;
    padding: 16px 18px !important;
  }

  .driver-popover-title {
    font-size: 15px !important;
  }

  .driver-popover-description {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  .driver-popover-prev-btn,
  .driver-popover-next-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .driver-popover-footer {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    justify-content: space-between !important;
  }

  .driver-popover-progress-text {
    font-size: 11px !important;
  }

  .st-tour-skip-btn {
    font-size: 11px !important;
    padding: 6px 6px !important;
  }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  .driver-popover-next-btn:hover,
  .driver-popover-prev-btn:hover {
    transform: none !important;
  }

  .driver-popover {
    transition: none !important;
  }
}

/* ===== 概念引导高亮模式：加快关闭响应 ===== */
.driver-popover.st-highlight-only ~ .driver-overlay,
.driver-popover.st-highlight-only {
  transition-duration: 0.1s !important;
}

