/* ===================================================================
   加盟商代理表单（首页 index.html / 联系我们 contactUs.html 共用）
   样式对齐「联系我们」表单：.form-group / .form-control / .required

   注意：contactUs.css 里有 `.main .form-group div { height: 24px }`（权重 0,2,1），
   index.css 里有 `.form-group div { height: 24px }`（权重 0,1,1）。
   代理字段高度需自适应，故以下覆盖规则统一用 #contactForm 前缀（含 ID，权重 1,x,x）压过它们。
   =================================================================== */

/* ---------- 页签切换 ---------- */
.form-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 40px;
  width: 100%;
  margin-bottom: 40px;
  /* bootstrap 的 .form-switch 自带 padding-left: 2.5em（开关组件用），需清零才能贴左 */
  padding-left: 0;
  text-align: left;
}

.form-switch-item {
  position: relative;
  padding-bottom: 12px;
  color: #262626;
  font-size: 24px;
  line-height: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.form-switch-item:hover {
  color: #ea5520;
}

.form-switch-item.act {
  color: #ea5520;
  font-weight: 700;
}

.form-switch-item.act::after {
  position: absolute;
  /* 原 -1px 是为了压住 .form-switch 的底部边框，边框已去掉，改回 0 */
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff622a 0%, #ea5520 100%);
  border-radius: 2px;
  content: "";
}

/* ---------- 页签面板容器 ---------- */
/* 保持与 #contactForm 一致的 flex 换行布局，让两组字段排版完全相同 */
#contactForm .form-pane {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: flex-start;
  width: 100%;
}

/* 覆盖 .form-group div 的固定 24px 高度，代理控件高度需自适应 */
#contactForm .agency-multi-select,
#contactForm .agency-region-grid {
  height: auto;
  min-height: 40px;
  margin-bottom: 0;
}

/* ---------- 意向产品多选 ---------- */
#contactForm .agency-multi-select {
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

#contactForm .agency-multi-trigger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 5px 32px 5px 10px;
  border: 1px solid #d4d7d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

#contactForm .agency-multi-trigger:focus,
#contactForm .agency-multi-select.is-open .agency-multi-trigger {
  border-color: #ea5520;
  outline: 0;
}

#contactForm .agency-multi-placeholder {
  color: #b5bdca;
  font-size: 14px;
  line-height: 24px;
}

#contactForm .agency-multi-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid #ffc5a3;
  border-radius: 4px;
  background: #fff6f0;
  color: #ea5520;
  font-size: 13px;
  line-height: 22px;
}

#contactForm .agency-multi-chip-remove {
  font-style: normal;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

#contactForm .agency-multi-arrow {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  pointer-events: none;
  transform: rotate(45deg);
}

#contactForm .agency-multi-select.is-open .agency-multi-arrow {
  border-color: #ea5520;
  transform: translateY(2px) rotate(225deg);
}

#contactForm .agency-multi-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  /* 防页面 .form-group div{height:24px} 把下拉面板压成一小条 */
  height: auto;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

#contactForm .agency-multi-select.is-open .agency-multi-panel,
#contactForm .agency-single-select.is-open .agency-multi-panel {
  display: block;
}

#contactForm .agency-multi-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  /* 防 .form-group div{height:24px} 把选项压矮，保证一行选项完整可见 */
  height: auto;
  min-height: 36px;
  padding: 8px 12px;
  color: #262626;
  font-size: 14px;
  cursor: pointer;
}

#contactForm .agency-multi-option:hover {
  background: #fff6f0;
}

#contactForm .agency-multi-option.is-selected {
  color: #ea5520;
  font-weight: 600;
}

#contactForm .agency-multi-option-check {
  width: 10px;
  height: 10px;
}

#contactForm .agency-multi-option-check::after {
  display: none;
  width: 5px;
  height: 9px;
  border-right: 2px solid #ea5520;
  border-bottom: 2px solid #ea5520;
  content: "";
  transform: rotate(45deg);
}

#contactForm .agency-multi-option.is-selected .agency-multi-option-check::after {
  display: block;
}

/* ---------- 地区区域三级联动（与意向产品同款自定义下拉，单选） ---------- */
#contactForm .agency-region-grid {
  display: flex;
  gap: 10px;
  width: 100%;
}

#contactForm .agency-single-select {
  position: relative;
  box-sizing: border-box;
  flex: 1 1 0;
  min-width: 0;
  /* 覆盖 .form-group div{height:24px} */
  height: auto;
  margin-bottom: 0;
}

#contactForm .agency-single-select .agency-multi-trigger {
  flex-wrap: nowrap;
}

#contactForm .agency-single-text {
  overflow: hidden;
  color: #262626;
  font-size: 14px;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#contactForm .agency-single-text.is-placeholder {
  color: #b5bdca;
}

#contactForm .agency-single-select.is-disabled .agency-multi-trigger {
  background: #f5f5f5;
  cursor: not-allowed;
}

#contactForm .agency-single-select.is-disabled .agency-single-text {
  color: #b5bdca;
}

#contactForm .agency-single-select .agency-multi-option > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 长地名悬浮快速预览浮层（仅截断时出现） */
.agency-name-tooltip {
  position: fixed;
  z-index: 9999;
  box-sizing: border-box;
  max-width: 280px;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.agency-name-tooltip.is-show {
  opacity: 1;
}

/* ---------- 图形验证码：输入框内嵌验证码图 ----------
   目标样式：整组就是一只「普通输入框」（与其他 .form-control 同宽同高）——
   文字输入区在左、验证码图片内嵌在输入框右侧，图片本身无边框。
   captcha.js 渲染结构：
   .cerify-code-panel
     .verify-code（验证码字符区，可点击刷新）
     .verify-code-area > .verify-input-area > input.varify-input-code
   页面旧规则 .form-group div / .verify-code{width:110px!important} 等会用
   #mpanel2 前缀 + !important 逐层压过。 */
#mpanel2 {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  height: 40px !important;
  border: 1px solid #d4d7d9;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 0;
}

#mpanel2:focus-within {
  border-color: #ea5520;
}

#mpanel2 .cerify-code-panel {
  display: flex;
  flex-direction: row-reverse !important; /* 图在右、输入区在左 */
  align-items: stretch;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  overflow: visible;
  margin-bottom: 0;
  gap: 0;
}

/* 验证码字符区：内嵌于输入框右侧，图片无边框，点击可刷新 */
#mpanel2 .verify-code {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100px !important;
  height: 100% !important;
  line-height: 38px !important;
  text-align: center;
  font-size: 20px;
  letter-spacing: 5px;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 0;
}

/* 文字输入区：撑满剩余宽度 */
#mpanel2 .verify-code-area {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: 100% !important;
  margin-bottom: 0;
}

#mpanel2 .verify-input-area {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: 100% !important;
  padding-right: 0;
  margin-bottom: 0;
}

/* 输入框本体：无边框（外框由 #mpanel2 承担） */
#mpanel2 .varify-input-code {
  display: block !important;
  visibility: visible !important;
  box-sizing: border-box;
  width: 100%;
  height: 100% !important;
  padding: 0 12px;
  border: none !important;
  border-radius: 0;
  background: transparent;
  color: #262626;
  font-size: 14px;
  outline: 0;
  box-shadow: none;
}

#mpanel2 .varify-input-code::placeholder {
  color: #b5bdca;
}

#mpanel2 .verify-change-area {
  display: none !important;
}

/* ---------- 响应式 ---------- */
@media only screen and (max-width: 768px) {
  .form-switch {
    gap: 24px;
    margin-bottom: 24px;
  }

  .form-switch-item {
    padding-bottom: 8px;
    font-size: 16px;
  }

  #contactForm .agency-region-grid {
    flex-direction: column;
    gap: 10px;
  }

  #contactForm .agency-single-select {
    flex: none;
    width: 100%;
  }
}
