/* ============================================================================
   图形验证码弹窗 · 主题层修复（插件升级/重装不受影响）
   ----------------------------------------------------------------------------
   问题：plugins/captcha/tp_captcha/logic/TpCaptchaLogic.php 的 describe() 输出的
        弹窗样式依赖宿主页面的 rem 基准。jyy 主题的 rem 基准是动态的
        （html font-size = clientWidth / 19.2，约 62~100px），与官方默认模板
        差异很大，插件弹窗在 jyy 主题下会缩成一小团（约 60px 宽）。
   方案：在主题侧用 px 重新锁死尺寸，全部 !important，
        优先级高于插件注入到 body 的 <style>，因此插件换回官方原版也照样生效。
   维护：以后调整验证码弹窗只改本文件，不要去改 plugins/captcha 里的 PHP。
   ============================================================================ */

/* ---------- 遮罩层 ---------- */
#captcha-outer {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 3000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.45) !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
  /* 插件自带 filter:alpha(opacity=60)，会建立层叠上下文并让子元素发虚，必须清掉 */
  filter: none !important;
  opacity: 1 !important;
}

/* ---------- 弹窗卡片 ---------- */
#captcha-outer > .captcha-content,
#captcha-outer > div {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0 !important;
  width: 440px !important;
  max-width: calc(100vw - 40px) !important;
  min-width: 0 !important;
  height: auto !important;
  box-sizing: border-box !important;
  background: #fff !important;
  padding: 24px 28px !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18) !important;
  overflow: visible !important;
  line-height: normal !important;
  text-align: left !important;
}

/* ---------- 标题 ---------- */
#captcha-outer .captcha-title {
  font-size: 18px !important;
  line-height: 26px !important;
  font-weight: 500 !important;
  color: #1e2736 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- 输入行 ---------- */
#captcha-outer .captcha-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-top: 16px !important;
  padding: 0 !important;
  line-height: normal !important;
}

#captcha-outer #captcha-input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 40px !important;
  margin: 0 10px 0 0 !important;
  padding: 0 12px !important;
  border: 1px solid #e3e6eb !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
  background: #fff !important;
  color: #1e2736 !important;
  font-size: 14px !important;
  line-height: normal !important;
  outline: none !important;
  transition: border-color 0.15s !important;
}
#captcha-outer #captcha-input:hover {
  border-color: #c4ccd8 !important;
}
#captcha-outer #captcha-input:focus {
  border-color: #0052d9 !important;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1) !important;
}
#captcha-outer #captcha-input::placeholder {
  color: #a5adba !important;
  font-size: 14px !important;
}

#captcha-outer #captcha-img {
  height: 40px !important;
  width: 120px !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  display: block !important;
  object-fit: fill !important;
  background: #f5f7fa !important;
}

/* ---------- 错误提示 ---------- */
#captcha-outer #captcha-error-text {
  color: #f5222d !important;
  font-size: 13px !important;
  line-height: 18px !important;
  min-height: 18px !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
}

/* ---------- 底部按钮 ---------- */
#captcha-outer .captcha-footer {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: stretch !important;
  margin-top: 20px !important;
  padding: 0 !important;
  gap: 0 !important;
}

#captcha-outer #check-btn,
#captcha-outer #cancel-btn {
  width: 96px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  line-height: normal !important;
  cursor: pointer !important;
  outline: none !important;
  transition: background 0.15s !important;
}

#captcha-outer #check-btn {
  margin: 0 !important;
  background: #0052d9 !important;
  color: #fff !important;
}
#captcha-outer #check-btn:hover {
  background: #3d7fff !important;
}

#captcha-outer #cancel-btn {
  margin: 0 0 0 12px !important;
  background: #e7e7e7 !important;
  color: #1e2736 !important;
}
#captcha-outer #cancel-btn:hover {
  background: #dcdcdc !important;
}

/* ---------- 移动端 ---------- */
@media screen and (max-width: 750px) {
  #captcha-outer {
    padding: 0 16px !important;
  }

  #captcha-outer > .captcha-content,
  #captcha-outer > div {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px !important;
  }

  #captcha-outer .captcha-main {
    flex-wrap: nowrap !important;
  }

  #captcha-outer #captcha-input {
    height: 44px !important;
    font-size: 16px !important;
  }

  #captcha-outer #captcha-img {
    height: 44px !important;
    width: 130px !important;
  }

  #captcha-outer .captcha-footer {
    flex-direction: column !important;
  }

  #captcha-outer #check-btn,
  #captcha-outer #cancel-btn {
    width: 100% !important;
    height: 44px !important;
    font-size: 16px !important;
    margin: 0 !important;
  }

  #captcha-outer #cancel-btn {
    margin-top: 12px !important;
  }
}
