/* ===== 询盘表单弹窗样式 ===== */

.fm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
}
.fm-modal[aria-hidden="false"] {
  pointer-events: auto;
}

.fm-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(8, 18, 30, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .26s ease;
}
.fm-modal[aria-hidden="false"] .fm-mask { opacity: 1; }

.fm-panel {
  position: absolute;
  z-index: 2;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

/* 移动端：底部升起 */
@media (max-width: 768px) {
  .fm-modal { display: block; visibility: hidden; transition: visibility 0s linear .34s; }
  .fm-modal[aria-hidden="false"] { visibility: visible; transition: visibility 0s; }

  .fm-panel {
    left: 0; right: 0; bottom: 0;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(103%);
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px);
  }
  .fm-modal[aria-hidden="false"] .fm-panel { transform: translateY(0); }
}

/* 桌面端：居中弹窗（虽然桌面走滚动，留着备用） */
@media (min-width: 769px) {
  .fm-modal { display: none !important; }
}

.fm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #EDF2F8;
  flex: 0 0 auto;
  position: relative;
}
/* 顶部把手 */
.fm-head::before {
  content: '';
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 4px;
  border-radius: 2px;
  background: #DDE6EF;
}
.fm-head b {
  font-size: 17px;
  color: #1B2733;
  padding-top: 6px;
}
.fm-close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer;
  color: #7A8694;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}
.fm-close svg { width: 20px; height: 20px; }

.fm-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 20px 20px;
  flex: 1 1 auto;
}

.fm-tip {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #6B7480;
}

.fm-form { display: flex; flex-direction: column; gap: 14px; }
.fm-row { display: flex; gap: 12px; }
.fm-row > .fm-field { flex: 1; min-width: 0; }

.fm-field { display: flex; flex-direction: column; gap: 6px; }
.fm-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: #3A4553;
}
.fm-req { color: #D64545; }

.fm-field input,
.fm-field select,
.fm-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  /* iOS 不缩放 */
  font-size: 16px !important;
  line-height: 1.4;
  font-family: inherit;
  color: #1B2733;
  background: #F7F9FC;
  border: 1px solid #DDE5EE;
  border-radius: 9px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
  appearance: none;
}
.fm-field textarea { resize: vertical; min-height: 96px; }
.fm-field input:focus,
.fm-field select:focus,
.fm-field textarea:focus {
  background: #fff;
  border-color: #2C6BFF;
  box-shadow: 0 0 0 3px rgba(44, 107, 255, .13);
}
.fm-field input::placeholder,
.fm-field textarea::placeholder { color: #9AA6B4; }

.fm-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #C0631F, #A8531C);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, opacity .18s;
}
.fm-submit:active { transform: scale(.98); }
.fm-submit:disabled { cursor: wait; }

.fm-msg {
  font-size: 13.5px;
  line-height: 1.6;
  min-height: 0;
}
.fm-msg.ok { color: #1A8A4A; }
.fm-msg.err { color: #C23B3B; }

.fm-note {
  font-size: 12px;
  line-height: 1.65;
  color: #86909C;
  text-align: center;
}
.fm-note a { color: #1D6FD0; text-decoration: none; }

body.fm-open { overflow: hidden; }

/* ===== 深色模式 ===== */
@media (prefers-color-scheme: dark) {
  .fm-panel { background: #161E2A !important; }
  .fm-head { border-bottom-color: #253040 !important; }
  .fm-head::before { background: #3A4758 !important; }
  .fm-head b { color: #E8EDF3 !important; }
  .fm-close { color: #A8B4C4 !important; }
  .fm-tip { color: #93A1B3 !important; }
  .fm-field label { color: #C8D3E0 !important; }
  .fm-req { color: #FF8A8A !important; }
  .fm-field input,
  .fm-field select,
  .fm-field textarea {
    background: #0F1620 !important;
    border-color: #2A3546 !important;
    color: #E8EDF3 !important;
  }
  .fm-field input:focus,
  .fm-field select:focus,
  .fm-field textarea:focus {
    background: #131A24 !important;
    border-color: #6BA8F0 !important;
    box-shadow: 0 0 0 3px rgba(107, 168, 240, .18) !important;
  }
  .fm-field input::placeholder,
  .fm-field textarea::placeholder { color: #5A6878 !important; }
  .fm-msg.ok { color: #5BE49B !important; }
  .fm-msg.err { color: #FF7A7A !important; }
  .fm-note { color: #7A8694 !important; }
  .fm-note a { color: #7FB8F5 !important; }
  .fm-mask { background: rgba(0, 0, 0, .68) !important; }
}


/* ===== 弹窗表单示例提示 ===== */
.fm-hint {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: #86909C;
  margin-left: 4px;
}
@media (prefers-color-scheme: dark) {
  .fm-hint { color: #8A97A8 !important; }
}


/* ===== 弹窗表单提示 v3 ===== */
.fm-opt {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: #93A1B3;
  margin-left: 5px;
}
.fm-hint { display: none !important; }

@media (prefers-color-scheme: dark) {
  .fm-opt { color: #8A97A8 !important; }
}
