/* 公共字段卡模块：标准字段卡、模板字段卡导航、查看与保存入口 */
.fc_card {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.fc_card_head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.fc_title {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.fc_actions,
.fc_badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.fc_actions.is-trailing {
  justify-content: flex-end;
}

.fc_detail_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

.fc_detail_btn:hover {
  background: #f1f5f9;
  color: #020617;
}

.fc_detail_btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fc_badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.fc_badge.is-bound,
.fc_badge.is-success,
.fc_badge.is-same {
  background: #dcfce7;
  color: #047857;
}

.fc_badge.is-pending,
.fc_badge.is-warn,
.fc_badge.is-candidate {
  background: #fff7ed;
  color: #c2410c;
}

.fc_badge.is-blue,
.fc_badge.is-tab {
  background: #eff6ff;
  color: #1d4ed8;
}

.fc_badge.is-danger,
.fc_badge.is-conflict {
  background: #fee2e2;
  color: #b91c1c;
}

.fc_value {
  min-width: 0;
  overflow: hidden;
  padding: 7px 8px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc_info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.fc_info_row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.fc_info_row strong {
  color: #334155;
  white-space: nowrap;
}

.fc_info_row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc_info_row.is-success,
.fc_info_row.is-same {
  background: #ecfdf5;
  color: #047857;
}

.fc_info_row.is-success strong,
.fc_info_row.is-same strong {
  color: #047857;
}

.fc_info_row.is-warn,
.fc_info_row.is-candidate {
  background: #fff7ed;
  color: #9a3412;
}

.fc_info_row.is-conflict {
  background: #fff7ed;
  color: #c2410c;
}

.fc_meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  min-width: 0;
}

.fc_meta_item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
}

.fc_meta_item b {
  white-space: nowrap;
}

.fc_meta_item span,
.fc_meta_item code {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-family: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_root {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.tfcm_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #f8fbff;
}

.tfcm_head strong {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
}

.tfcm_head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.tfcm_save_btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tfcm_body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.tfcm_nav {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tfcm_nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px dashed #d6e1ef;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tfcm_nav button.is-active {
  border-style: solid;
  border-color: #93b4ff;
  background: #edf4ff;
  color: #1d4ed8;
}

.tfcm_nav span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_nav strong {
  flex: 0 0 auto;
  min-width: 25px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  text-align: center;
}

.tfcm_nav button.is-active strong {
  background: #dbeafe;
  color: #1d4ed8;
}

.tfcm_content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.tfcm_summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tfcm_summary span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.tfcm_module {
  min-width: 0;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #ffffff;
}

.tfcm_section_panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  scroll-margin-top: 12px;
}

.tfcm_section_head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fbff;
}

.tfcm_section_head strong {
  min-width: 0;
  overflow: hidden;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_section_head span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.tfcm_section_modules {
  display: grid;
  gap: 10px;
}

.tfcm_module_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-bottom: 1px solid #e6edf6;
}

.tfcm_module_head strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_module_head span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.tfcm_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 9px;
  min-width: 0;
}

.tfcm_field_card {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  padding: 9px;
  border: 1px solid #d7e2ef;
  border-radius: 7px;
  background: #fbfdff;
}

.tfcm_field_card .fc_card_head,
.tfcm_field_card_head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.tfcm_field_card .fc_title,
.tfcm_field_card_head strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tfcm_field_card .fc_badge,
.tfcm_field_card_head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.tfcm_field_card .fc_badge.is-bound,
.tfcm_field_card_head span.is-bound {
  background: #dcfce7;
  color: #047857;
}

.tfcm_field_card .fc_badge.is-pending,
.tfcm_field_card_head span.is-pending {
  background: #fff7ed;
  color: #c2410c;
}

.tfcm_field_card .fc_value,
.tfcm_field_value {
  overflow: hidden;
  min-height: 32px;
  padding: 7px 8px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_field_card .fc_meta,
.tfcm_field_meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #64748b;
  font-size: 12px;
}

.tfcm_field_card .fc_meta_item.is-type span,
.tfcm_field_meta span {
  min-width: 0;
  overflow: hidden;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_field_card .fc_meta_item code,
.tfcm_field_meta code {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-family: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfcm_empty {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .tfcm_body,
  .tfcm_grid {
    grid-template-columns: 1fr;
  }

  .tfcm_nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
