/* ==========================================================================
   fields.css —— 险种差异化表单渲染引擎样式（.fr-*）
   ========================================================================== */
.fr-form { font-size: 13px; color: var(--ink); }

/* ---- 险种头 ---- */
.fr-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: linear-gradient(90deg, #f0f5ff 0%, #f7faff 60%, #fff 100%);
  border: 1px solid #d6e4ff; border-radius: 8px;
}
.fr-head b { font-size: 14px; color: #1256a6; }
.fr-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: #1256a6; color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
}
.fr-fam { font-size: 11.5px; color: #fff; background: #5b8ff9; padding: 1px 7px; border-radius: 9px; }
.fr-desc { flex-basis: 100%; font-size: 12px; color: #6b7a90; line-height: 1.5; }

/* ---- 分区 ---- */
.fr-sec { margin-bottom: 14px; border: 1px solid #e6ebf2; border-radius: 8px; overflow: hidden; background: #fff; }
.fr-sec-hd {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: #f6f8fb; border-bottom: 1px solid #e6ebf2;
}
.fr-sec-t { font-size: 13px; font-weight: 700; color: #26332c; position: relative; padding-left: 9px; }
.fr-sec-t::before {
  content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
  border-radius: 2px; background: #1256a6;
}
.fr-sec-s { font-size: 11.5px; color: #8a94a6; }
.fr-sec-hd .btn, .fr-sec-hd button[data-tbl-add] { margin-left: auto; }

/* ---- 字段网格 ---- */
.fr-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px; padding: 12px 14px;
}
.fr-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fr-row.span2 { grid-column: 1 / -1; }
.fr-label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: #48566b; }
.fr-label .req::after, .fr-label.req > span::after { content: '*'; color: #d4380d; margin-left: 2px; }
.fr-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%; background: #dfe6f0; color: #5b6b85;
  font-size: 9px; font-style: normal; cursor: help;
}
.fr-body { display: flex; flex-direction: column; gap: 3px; }

/* ---- 控件 ---- */
.fr-ctl, .fr-tctl {
  width: 100%; box-sizing: border-box; padding: 6px 9px;
  border: 1px solid #d9e0ea; border-radius: 6px; background: #fff;
  font-size: 13px; color: #26332c; font-family: inherit; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.fr-ctl:focus, .fr-tctl:focus { outline: none; border-color: #1256a6; box-shadow: 0 0 0 3px rgba(18,86,166,.1); }
textarea.fr-ctl { resize: vertical; min-height: 52px; }
.fr-ctl.is-err { border-color: #ff7875; background: #fff7f7; }
.fr-input-wrap { position: relative; }
.fr-input-wrap.has-unit .fr-ctl { padding-right: 42px; }
.fr-unit {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: #8a94a6; pointer-events: none;
}
.fr-note { font-size: 11px; color: #8a94a6; line-height: 1.45; }
.fr-err { font-size: 11.5px; color: #d4380d; }

/* ---- 单选胶囊 ---- */
.fr-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.fr-radio, .fr-check, .fr-term {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border: 1px solid #d9e0ea; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 12.5px; color: #48566b;
  transition: all .15s; user-select: none;
}
.fr-radio i, .fr-check i, .fr-term i {
  width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #b9c3d2; flex: none;
}
.fr-check i, .fr-term i { border-radius: 3px; }
.fr-radio.on, .fr-check.on, .fr-term.on { border-color: #1256a6; background: #eef4ff; color: #1256a6; }
.fr-radio.on i, .fr-check.on i, .fr-term.on i {
  background: #1256a6; border-color: #1256a6; box-shadow: inset 0 0 0 2px #fff;
}
.fr-checks { display: flex; gap: 7px; flex-wrap: wrap; }

/* ---- 件数表 ---- */
.fr-table { width: 100%; border-collapse: collapse; }
.fr-table th {
  font-size: 11.5px; font-weight: 600; color: #6b7a90; text-align: left;
  padding: 7px 10px; background: #fafbfd; border-bottom: 1px solid #e6ebf2;
}
.fr-table td { padding: 5px 8px; border-bottom: 1px dashed #eef1f6; }
.fr-table tr:last-child td { border-bottom: 0; }
.fr-tdel {
  width: 22px; height: 22px; border-radius: 5px; border: 1px solid #e8ecf2;
  background: #fff; color: #98a3b3; cursor: pointer; font-size: 14px; line-height: 1;
}
.fr-tdel:hover { color: #d4380d; border-color: #ffc9c9; background: #fff5f5; }
button[data-tbl-add] {
  border: 1px solid #c7d7f0; background: #f2f7ff; color: #1256a6;
  padding: 3px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
button[data-tbl-add]:hover { background: #e6f0ff; }

/* ---- 特别约定 ---- */
.fr-terms { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px 0; }
.fr-term { align-items: flex-start; padding: 6px 11px; line-height: 1.55; }
.fr-term span { flex: 1; }
.fr-term i { margin-top: 3px; }
.fr-term-extra { margin: 8px 14px 12px; width: calc(100% - 28px); }

/* ---- 附件 ---- */
.fr-attach { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; }
.fr-at {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  border: 1px dashed #cfd8e4; border-radius: 7px; background: #fbfcfe;
  font-size: 12.5px; color: #48566b; cursor: pointer;
}
.fr-at.req span::after { content: '*'; color: #d4380d; }
.fr-at i {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; background: #eef2f8; color: #7c8ba0; font-style: normal; font-size: 11px;
}
.fr-at em { font-size: 11px; color: #98a3b3; font-style: normal; }
.fr-at.on { border-style: solid; border-color: #52c41a; background: #f6ffed; color: #237804; }
.fr-at.on i { background: #52c41a; color: #fff; }

/* ---- 风险提示 ---- */
.fr-risk { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fr-risk-i {
  font-size: 12px; padding: 5px 10px; border-radius: 6px; line-height: 1.5;
  border-left: 3px solid #faad14; background: #fffbe6; color: #874d00;
}
.fr-risk-i.bad { border-color: #ff4d4f; background: #fff1f0; color: #a8071a; }
.fr-risk-i.info { border-color: #1890ff; background: #e6f4ff; color: #0958d9; }
.fr-risk-i.ok { border-color: #52c41a; background: #f6ffed; color: #237804; }

/* ---- 识别高亮 ---- */
.fr-row.is-hit { position: relative; }
.fr-row.is-hit .fr-ctl, .fr-row.is-hit .fr-radios {
  box-shadow: 0 0 0 2px rgba(250,173,20,.35);
  border-radius: 6px; animation: frHit 1.4s ease-out;
}
@keyframes frHit { 0% { box-shadow: 0 0 0 5px rgba(250,173,20,.5); } 100% { box-shadow: 0 0 0 2px rgba(250,173,20,.35); } }

/* ---- 移动端适配 ---- */
@media (max-width: 720px) {
  .fr-grid { grid-template-columns: 1fr; gap: 9px; padding: 10px; }
  .fr-head { padding: 9px 11px; }
  .fr-sec-hd { padding: 7px 11px; }
  .fr-terms, .fr-attach { padding-left: 11px; padding-right: 11px; }
  .fr-term-extra { margin-left: 11px; margin-right: 11px; width: calc(100% - 22px); }
}