/* 仿真参数公式输入：与站点纸张/公式体例保持一致 */
.pfx {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  vertical-align: middle;
}
.pfx-native {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.pfx-box {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.pfx-box:focus-within {
  border-color: #0e7490;
  box-shadow: 0 0 0 2px rgba(14, 116, 144, .12);
}
.pfx-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 5px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font-family: "Times New Roman", "STIX Two Text", "Songti SC", serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.35;
}
.pfx-input::selection { background: rgba(14, 116, 144, .18); }
.pfx-input.is-bad { color: #b91c1c; }
.pfx-fx {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  border: 0;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0e7490;
  font-family: "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pfx-fx:hover, .pfx.is-open .pfx-fx { background: #ecfeff; color: #155e75; }

.pfx-pop {
  position: fixed;
  z-index: 1400;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .2);
  color: #0f172a;
}
.pfx-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.pfx-pop-head b { font-size: 13px; }
.pfx-pop-head span { color: #64748b; font-size: 10px; line-height: 1.35; text-align: right; }
.pfx-quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.pfx-sym {
  min-width: 32px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b;
  font-family: "Times New Roman", "Songti SC", serif;
  font-size: 13px;
  cursor: pointer;
}
.pfx-sym:hover { border-color: #0e7490; background: #ecfeff; color: #0e7490; }
.pfx-preview {
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fbfdff;
  color: #0e7490;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: auto;
}
.pfx-preview.is-bad { color: #b91c1c; font-size: 11.5px; line-height: 1.45; }
.pfx-preview-value { display: inline-block; margin-right: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pfx-preview-math { display: inline-block; color: #334155; }
.pfx-msg { min-height: 14px; margin: 5px 0 8px; color: #94a3b8; font-size: 10px; line-height: 1.35; }
.pfx-msg.is-bad { color: #b91c1c; }
.pfx-foot { display: flex; justify-content: flex-end; gap: 6px; }

/* 原 native 控件里的 output 仍保留，作为模型读数/旧逻辑的数值出口 */
.native-ctl .pfx + output,
.lab-insp-ctl .pfx + output {
  align-self: center;
}
.builder-param .pfx { width: 158px; }
.native-controls .pfx { margin-top: 4px; }
.cwb-field .pfx-input,
.cwb-field .pfx-box {
  border: 1px solid #cbd5e1;
}
.cwb-field .pfx-box { padding: 0; }
.cwb-field .pfx-input {
  width: 100%;
  padding: 5px 7px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.cwb-field .pfx-input:focus { outline: 0; box-shadow: none; }

@media (max-width: 760px) {
  .pfx-pop { padding: 10px; border-radius: 10px; }
  .pfx-pop-head span { display: none; }
  .pfx-input { font-size: 16px; }
  .pfx-fx { width: 34px; font-size: 14px; }
}
