/* 公共样式 - 使用纯CSS，配合Lessjs组件库 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0 solid;
}

body {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  color: #333;
  /* 禁止滚动边界回弹 */
  overscroll-behavior: none;
  /* 兼容 iOS Safari */
  -webkit-overflow-scrolling: touch;
}

/**
 * 覆盖 SPZ 框架 (spz.min.js) 动态注入的样式：
 *   html, html body { height: auto !important }
 *   html.i-spzhtml-doc > body { overflow: visible !important }
 * 使用更高特异性确保覆盖生效，防止 iOS Safari 页面弹性回弹
 */
html:root {
  height: 100% !important;
  overflow: hidden !important;
}

html:root>body.shoplazza-ai-builder {
  height: 100% !important;
  overflow: hidden !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.chat-btn {
  --chat-btn-bg-color: #4d74ed;
}

.chat-btn.chat-btn-color-dangerous {
  --chat-btn-bg-color: #ff7784;
}

/* 按钮样式 */
.chat-btn {
  display: flex;
  padding: 14px 20px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--chat-btn-bg-color, #4d74ed);
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
}

.chat-btn.chat-btn-primary {
  background: #1890ff;
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* 隐藏类 - 使用CSS实现，不依赖JS */
.hidden {
  display: none !important;
}

/* 弹窗遮罩层 - 使用:target伪类控制显示，纯CSS实现，无需JS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay:target {
  display: flex;
}

/* PC端弹窗 */
.modal-dialog {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* 关闭按钮 */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.modal-close:hover {
  color: #333;
}

/* 响应式布局 - 断点定义 */
/* 移动端：< 768px */
/* PC端：>= 768px */

/* PC端特定样式 */
@media (min-width: 960px) {
  .mobile-only {
    display: none !important;
  }

  .hide-desktop {
    display: none !important;
  }
}

/* 移动端特定样式 */
@media (max-width: 959px) {
  .pc-only {
    display: none !important;
  }

  .hide-mobile {
    display: none !important;
  }

  /* 移动端表单输入框样式优化 */
  .form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 16px;
  }

  /* 移动端按钮样式优化 */
  .btn {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 44px;
  }
}

.shoplazza-ai-builder .i-spzhtml-toast-global {
  max-width: 320px;
  width: max-content;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

/* 全局 错误 toast 黑字白底 样式 */
.chat-global-toast {
  width: max-content;
  max-width: 86%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  display: inline-flex;
  padding: 12px 20px;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: #27293A;
  background: #fff;
  box-shadow: 0 4px 10px 8px rgba(24, 23, 62, 0.04),
    0 10px 40px 0 rgba(24, 23, 62, 0.25);
}

.icon-error-circle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF4D50;
  color: #FFF;
}

/* 全局 错误 toast 黑字白底 样式 */

/* 全局 tooltip 样式 */
.shoplazza-ai-builder .i-spzhtml-tooltip-inner {
  padding: 8px;
  font-size: 14px;
  border-radius: 4px;
  background: #222;
}
/* 全局 tooltip 样式 */

/* 全局 onboarding 按钮样式 */
.onboarding-btn-primary {
  background: var(--btn-primary-bg-color);
}

.onboarding-btn-primary:hover {
  background: var(--btn-primary-bg-color-hover);
}

.onboarding-btn-primary:active {
  background: var(--btn-primary-bg-color-active);
}

.register-btn-secondary {
  background: var(--btn-secondary-bg-color);
}

.register-btn-secondary:hover {
  background: var(--btn-secondary-bg-color-hover);
}

.register-btn-secondary:active {
  background: var(--btn-secondary-bg-color-active);
}

/* 全局 onboarding 按钮样式 */

.shoplazza-ai-page .i-spzhtml-sidebar-mask {
  background-color: rgba(0, 0, 0, .7);
}

.shoplazza-logo {
  color: #FF0000;
}