/* ==========================================================
   MACLIGHT - "Need Customization" / "Inquiry" 入口 + 询盘弹窗
   除首页外全站启用（由 JS 按 URL 判定）
   ========================================================== */

/* ---------- 1. 横向提示条（首次出现，9 秒后自动收起） ---------- */
#mlcqBanner {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999;
  box-sizing: border-box;
  display: none;                 /* 由 JS 置为 flex */
  align-items: center;
  gap: 13px;
  width: 364px;
  padding: 15px 40px 15px 16px;
  background: #f2fbf7;
  border: 1px solid #d8f0e6;
  border-left: 5px solid #46d8ad;
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  user-select: none;
  transition: opacity .28s ease, transform .28s ease;
}
#mlcqBanner:hover {
  box-shadow: 0 14px 40px rgba(0, 0, 0, .26);
  border-left-color: #2ec79a;
}
#mlcqBanner.is-in { animation: mlcqBannerIn .45s cubic-bezier(.2, .8, .25, 1); }
#mlcqBanner.is-out { opacity: 0; transform: translate(30px, -50%); }

@keyframes mlcqBannerIn {
  from { opacity: 0; transform: translate(46px, -50%); }
  to   { opacity: 1; transform: translate(0, -50%); }
}

.mlcq-bn-ico {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #46d8ad;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mlcq-bn-txt { display: block; min-width: 0; }
.mlcq-bn-ico svg { stroke: #fff; }
.mlcq-bn-txt b {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .2px;
  color: #14352b;
}
.mlcq-bn-txt i {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
  line-height: 1.35;
  color: #6b7880;
}
.mlcq-bn-x {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a3aeb4;
  font-family: inherit;
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
}
.mlcq-bn-x:hover { background: #f2f5f6; color: #1f2a30; }

/* ---------- 2. 右侧竖条（纵向常驻，默认半透明） ---------- */
#mlcqTab {
  display: none;                 /* .is-on 时显示 */
  position: fixed;
  right: 0;
  top: calc(50% + 120px);        /* 整组再下移一个按钮的位置 */
  transform: translateY(-50%);
  z-index: 999999;
  box-sizing: border-box;
  flex-direction: column;        /* 三角在上，文字在下 */
  align-items: center;
  gap: 7px;
  width: 36px;
  padding: 14px 10px;
  background: #31363c;
  color: #d8dedb;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1;
  letter-spacing: .5px;
  border-radius: 6px 0 0 6px;
  border-left: 3px solid rgba(70, 216, 173, .55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
  cursor: pointer;
  user-select: none;
  opacity: .45;
  transition: opacity .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
#mlcqTab .mlcq-tab-txt {
  display: block;
  writing-mode: vertical-rl;     /* 竖排只作用于文字块，容器仍用 flex 上下排 */
  text-orientation: mixed;
}
#mlcqTab .mlcq-tab-tri {
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;   /* 朝下，颜色跟随文字 */
}
#mlcqTab.is-on { display: flex; }
#mlcqTab.is-in { animation: mlcqTabIn .4s ease; }
#mlcqTab:hover,
#mlcqTab:focus {
  opacity: 1;
  background: #46d8ad;
  color: #14352b;
  border-left-color: #14352b;
  outline: none;
}
@keyframes mlcqTabIn {
  from { opacity: 0; transform: translate(100%, -50%); }
  to   { opacity: .45; transform: translate(0, -50%); }
}

/* ---------- 2b. 侧边 Inquiry 入口：先横向绿条，5 秒后转竖向灰条 ---------- */
#mlcqInquiryTab {
  display: none;
  position: fixed;
  right: 0;
  bottom: calc(50% - 13px);      /* 与 Need 条 gap 23px；整组再下移一个按钮位置 */
  z-index: 999999;
  box-sizing: border-box;
  align-items: center;
  gap: 8px;
  height: 38px;                  /* 横向态尺寸 */
  padding: 0 16px 0 13px;
  background: #46d8ad;           /* 与原 .page-btn 同色 */
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .4px;
  white-space: nowrap;
  border-radius: 6px 0 0 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  cursor: pointer;
  user-select: none;
  transition: background-color .4s ease, color .4s ease, opacity .4s ease, box-shadow .25s ease;
}
#mlcqInquiryTab .mlcq-tri {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #fff;
}
#mlcqInquiryTab .mlcq-tri-v {
  display: none;                 /* 竖向态才用 */
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;   /* 朝下 */
}
#mlcqInquiryTab .mlcq-inq-v {
  display: none;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

#mlcqInquiryTab.is-on { display: flex; }
#mlcqInquiryTab.is-on.is-muted {
  display: flex;
  flex-direction: column;        /* 三角在上，文字在下 */
  align-items: center;
  gap: 7px;
}
/* 横向 → 竖向切换时先淡出，避免尺寸跳变 */
#mlcqInquiryTab.is-swapping { opacity: 0 !important; transition: opacity .17s ease; }

/* 5 秒后：转灰并改回竖向排列，与 Need Customization 完全同款 */
#mlcqInquiryTab.is-muted {
  width: 36px;
  height: auto;
  padding: 14px 10px;
  background: #31363c;
  color: #d8dedb;
  opacity: .45;
  border-left: 3px solid rgba(70, 216, 173, .55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
  /* 竖排态字重/字距与 Need Customization 完全一致（横向绿条仍是粗体） */
  font-weight: 400;
  letter-spacing: .5px;
}
#mlcqInquiryTab.is-muted .mlcq-tri,
#mlcqInquiryTab.is-muted .mlcq-inq-txt { display: none; }
#mlcqInquiryTab.is-muted .mlcq-tri-v,
#mlcqInquiryTab.is-muted .mlcq-inq-v { display: block; }

#mlcqInquiryTab:not(.is-muted):hover,
#mlcqInquiryTab:not(.is-muted):focus {
  background: #2ec79a;
  outline: none;
}
#mlcqInquiryTab.is-muted:hover,
#mlcqInquiryTab.is-muted:focus {
  background: #46d8ad;
  color: #14352b;
  opacity: 1;
  border-left-color: #14352b;
  outline: none;
}

/* 进场动画：竖向灰条必须停在 .45，否则会先满不透明（发黑）再跳成半透明 */
#mlcqInquiryTab.is-in:not(.is-muted) { animation: mlcqTabInTop .35s ease; }
#mlcqInquiryTab.is-in.is-muted { animation: mlcqTabInTopMuted .35s ease; }

@keyframes mlcqTabInTop {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mlcqTabInTopMuted {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: .45; transform: translateX(0); }
}

/* ---------- 3. 询盘弹窗（靠右，不遮罩，不锁页面滚动） ---------- */
#mlcqModal {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99999999;
  width: 462px;
  max-width: calc(100vw - 44px);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e6ebee;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  font-family: Arial, Helvetica, sans-serif;
  animation: mlcqPop .22s ease;
}
@keyframes mlcqPop {
  from { opacity: 0; transform: translate(26px, -50%); }
  to   { opacity: 1; transform: translate(0, -50%); }
}

.mlcq-head {
  position: relative;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #edf0f2;
}
.mlcq-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  color: #1f2a30;
  font-weight: 700;
}
.mlcq-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7880;
  line-height: 1.5;
}
.mlcq-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #98a3a9;
  font-size: 24px;
  line-height: 28px;
  cursor: pointer;
  border-radius: 4px;
}
.mlcq-close:hover { background: #f2f5f6; color: #1f2a30; }

.mlcq-body { padding: 18px 24px 22px; }

.mlcq-field { margin-bottom: 14px; }
.mlcq-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #43515a;
  font-weight: 600;
}
.mlcq-field label .mlcq-req { color: #d9534f; }
.mlcq-field label .mlcq-opt { font-weight: 400; color: #8c979d; }

/* 两列并排的字段（姓名 + 邮箱 / 数量 + 应用领域） */
.mlcq-row { display: flex; gap: 12px; }
.mlcq-row > .mlcq-field { flex: 1 1 0; min-width: 0; }

.mlcq-input,
.mlcq-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7dde2;
  border-radius: 4px;
  background: #fff;
  color: #1f2a30;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mlcq-input { height: 40px; padding: 0 11px; }
.mlcq-textarea { min-height: 92px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.mlcq-input:focus,
.mlcq-textarea:focus {
  outline: none;
  border-color: #46d8ad;
  box-shadow: 0 0 0 3px rgba(70, 216, 173, .16);
}
.mlcq-input::placeholder,
.mlcq-textarea::placeholder { color: #a8b2b8; }

.mlcq-code-row { display: flex; align-items: center; gap: 10px; }
.mlcq-code-row .mlcq-input { flex: 1; }
#mlcqCodeImg {
  width: 100px;
  height: 44px;
  border: 1px solid #d7dde2;
  border-radius: 4px;
  cursor: pointer;
  background: #f7f9fa;
  flex: 0 0 auto;
  image-rendering: -webkit-optimize-contrast;
}
.mlcq-code-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: #8c979d;
}

.mlcq-submit {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 4px;
  background: #1260aa;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background-color .15s ease;
}
.mlcq-submit:hover { background: #0f4f8c; }
.mlcq-submit:disabled { background: #8fa7bd; cursor: default; }

.mlcq-msg {
  display: none;
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.45;
}
.mlcq-msg.is-error { display: block; background: #fdf1f0; color: #b93b35; border: 1px solid #f5d3d0; }

/* ---------- 成功态 ---------- */
.mlcq-thanks { padding: 34px 26px 30px; text-align: center; }
.mlcq-check {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #46d8ad;
  color: #fff;
  font-size: 30px;
  line-height: 54px;
  font-weight: 700;
}
.mlcq-thanks h3 { margin: 0 0 8px; font-size: 19px; color: #1f2a30; }
.mlcq-thanks p { margin: 0; font-size: 14px; line-height: 1.6; color: #5d6b73; }
.mlcq-thanks .mlcq-submit { margin-top: 20px; }

/* /Inquiry/ 页面内联版感谢卡（无弹窗） */
.mlcq-thanks.mlcq-inline {
  max-width: 620px;
  padding: 40px 26px;
  background: #fff;
  border: 1px solid #e6ebee;
  border-radius: 8px;
}
.mlcq-thanks.mlcq-inline .mlcq-submit {
  width: auto;
  min-width: 150px;
  margin: 22px auto 0;
  padding: 0 30px;
}

/* ---------- 移动端：两个入口都隐藏（底部已有固定导航） ---------- */
@media (max-width: 767px) {
  #mlcqBanner,
  #mlcqTab,
  #mlcqInquiryTab { display: none !important; }
  #mlcqModal {
    right: 3vw;
    left: 3vw;
    width: auto;
    max-width: none;
    max-height: 86vh;
  }
  .mlcq-head { padding: 16px 18px 12px; }
  .mlcq-body { padding: 16px 18px 18px; }
  .mlcq-row { flex-direction: column; gap: 0; }
}
