/* 制度表单中心（D-08）：只定义本模块特有布局，按钮/面板沿用系统样式与变量，暗色主题自动跟随。 */

.form-center { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.fc-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.fc-tab {
  min-height: 44px; padding: 9px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: 6px 6px 0 0;
}
.fc-tab:hover { color: var(--text); background: var(--panel2); }
.fc-tab.active { color: var(--brand2); border-bottom-color: var(--brand); font-weight: 600; }
.fc-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.fc-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fc-intro { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.fc-intro b { color: var(--text); }

.fc-bulk {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 9px; background: var(--panel2);
}
.fc-bulk b { font-size: 13px; margin-right: 8px; }
.fc-bulk .muted { font-size: 12px; }

.fc-group { display: flex; flex-direction: column; gap: 9px; }
.fc-group-title {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--text); margin: 0;
}
.fc-count {
  font-size: 11px; font-weight: 500; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

.fc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 10px; }
.fc-card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.fc-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.fc-card-main {
  display: flex; flex-direction: column; gap: 5px; padding: 13px 14px; width: 100%;
  text-align: left; border: 0; background: transparent; font: inherit; color: var(--text); cursor: pointer;
}
.fc-card.delegated { background: var(--panel2); }
.fc-card.locked .fc-card-title { color: var(--muted); }
.fc-card.locked .fc-card-main { cursor: not-allowed; }
.fc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-code { font-size: 11px; font-weight: 700; color: var(--brand2); letter-spacing: .3px; }
.fc-fields { font-size: 11px; color: var(--muted); }
.fc-badge {
  font-size: 10px; font-weight: 700; color: var(--accent); background: var(--warn-soft);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.fc-card-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.fc-card-basis, .fc-card-why { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.fc-card-why { border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 2px; }
.fc-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 14px; border-top: 1px solid var(--line); background: var(--panel2);
}
.fc-tag { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.fc-tag-ok { background: #dcfce7; color: #15803d; }
.fc-tag-locked { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.fc-tag-delegated { background: var(--warn-soft); color: var(--accent); }
[data-theme="dark"] .fc-tag-ok { background: #123322; color: #6ee7a8; }
.fc-grant-btn { font-size: 11.5px; white-space: nowrap; }

.fc-sign-hint { margin: 0 0 10px; }
.fc-sign-pad {
  border: 1px dashed var(--line); border-radius: 9px; padding: 8px;
  background: var(--panel); min-height: 190px;
}
.fc-sign-row { margin-top: 14px; }
.fc-sign-row:first-of-type { margin-top: 0; }
.fc-sign-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 6px; }
.fc-sign-bad {
  color: var(--danger); font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--danger); border-radius: 999px; padding: 0 8px;
}

/* 填写权限分配 */
.fc-grant-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-grant-bar input[type="search"] {
  flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px;
}
.fc-grant-bar input[type="search"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fc-grant-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px;
  max-height: 420px; overflow: auto; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.fc-grant-item { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.fc-grant-item:hover { background: var(--panel2); }
.fc-grant-item input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 填写区 */
.fc-editor { display: flex; flex-direction: column; gap: 14px; }
.fc-editor-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.fc-editor-head h2 { font-size: 17px; font-weight: 600; margin: 0 0 3px; }
.fc-editor-head p { margin: 0; }
.fc-note {
  padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--warn-soft); color: var(--text); font-size: 12.5px; line-height: 1.7;
}
.fc-warn {
  padding: 10px 12px; border: 1px solid var(--danger); border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 12.5px;
}
.fc-section h3 { margin: 0 0 12px; font-size: 13.5px; font-weight: 600; }
.fc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }

.fc-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fc-label { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.fc-req { color: var(--danger); font-style: normal; margin-left: 3px; }
.fc-fld input[type="text"], .fc-fld input[type="number"], .fc-fld input[type="date"],
.fc-fld select, .fc-fld textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 13px;
}
.fc-fld textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.fc-fld input:focus, .fc-fld select:focus, .fc-fld textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.fc-opts { display: flex; flex-wrap: wrap; gap: 7px 16px; padding-top: 3px; }
.fc-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.fc-opt input { width: 15px; height: 15px; accent-color: var(--brand); }

.fc-span2 { grid-column: span 2; }
.fc-span3 { grid-column: span 3; }
.fc-span4 { grid-column: span 4; }
.fc-span6 { grid-column: span 6; }
.fc-span8 { grid-column: span 8; }
.fc-span9 { grid-column: span 9; }
.fc-span12 { grid-column: span 12; }

/* 表格字段 */
.fc-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.fc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fc-table th, .fc-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.fc-table thead th { background: var(--panel2); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fc-table tbody tr:last-child td { border-bottom: 0; }
.fc-table input, .fc-table select {
  width: 100%; min-width: 76px; padding: 5px 6px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px;
}
.fc-table input:focus, .fc-table select:focus { outline: none; border-color: var(--brand); background: var(--panel); }
.fc-col-op { width: 44px; text-align: center; }
.fc-addrow { margin-top: 7px; }

.fc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.fc-hint { font-size: 11.5px; }

/* 记录与详情 */
.fc-records { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fc-records th, .fc-records td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; }
.fc-records thead th { background: var(--panel2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.fc-records tbody tr:last-child td { border-bottom: 0; }
.fc-nowrap { white-space: nowrap; }

.fc-st { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.fc-st-draft { background: var(--panel2); color: var(--muted); }
.fc-st-submitted { background: var(--brand-soft); color: var(--brand2); }
.fc-st-approved { background: #dcfce7; color: #15803d; }
.fc-st-rejected { background: var(--danger-soft); color: var(--danger); }
.fc-st-void { background: var(--panel2); color: var(--muted); text-decoration: line-through; }
[data-theme="dark"] .fc-st-approved { background: #123322; color: #6ee7a8; }

.fc-detail { width: 100%; border-collapse: collapse; font-size: 13px; }
.fc-detail th { width: 200px; padding: 8px 12px; text-align: left; vertical-align: top; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); }
.fc-detail td { padding: 8px 12px; border-bottom: 1px solid var(--line); word-break: break-word; }
.fc-detail tr:last-child th, .fc-detail tr:last-child td { border-bottom: 0; }

@media (max-width: 860px) {
  .fc-span2, .fc-span3, .fc-span4 { grid-column: span 6; }
  .fc-span6, .fc-span8, .fc-span9 { grid-column: span 12; }
}
@media (max-width: 560px) {
  .fc-cards { grid-template-columns: 1fr; }
  .fc-span2, .fc-span3, .fc-span4, .fc-span6 { grid-column: span 12; }
  .fc-detail th { width: 120px; }
  .fc-tab { flex: 1 1 calc(50% - 8px); text-align: center; }
  .fc-actions button { min-height: 42px; }
}

/* Form designer controls share one rendering contract with the filling page. */
.kfc-field{display:flex;flex-direction:column;gap:9px;min-width:0}.kfc-inline{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.kfc-inline>label,.kfc-inline>input{flex:1;min-width:110px}.kfc-field label{display:flex;flex-direction:column;gap:6px}.kfc-field input,.kfc-field select,.kfc-field textarea{max-width:100%;min-width:0;width:100%;box-sizing:border-box}.kfc-field input[type=checkbox],.kfc-field input[type=radio]{width:auto}.kfc-help,.kfc-status{font-size:12px;line-height:1.6;color:var(--muted,#64748b);white-space:pre-wrap}.kfc-status:not(:empty){padding:6px 8px;background:rgba(37,99,235,.06);border-radius:4px}.kfc-description{padding:16px;background:rgba(37,99,235,.045);border-left:3px solid #3b82f6;line-height:1.7}.kfc-description p{white-space:pre-wrap;margin:6px 0 0;overflow-wrap:anywhere}.kfc-file-list{list-style:none;margin:0;padding:0;display:grid;gap:7px}.kfc-file-list li{display:flex;align-items:center;gap:8px;min-width:0}.kfc-file-list .link{overflow-wrap:anywhere;text-align:left;flex:1}.kfc-upload{border:1px dashed #94a3b8;border-radius:5px;padding:12px;color:var(--muted,#64748b)}.kfc-upload input{font-size:12px}.kfc-selected{display:flex;flex-wrap:wrap;gap:6px;min-height:30px;align-items:center}.kfc-selected>span{padding:3px 7px;border-radius:4px;background:rgba(37,99,235,.07)}.kfc-picker,.kfc-candidate{border:1px solid var(--ctl-border,#dce0e6);padding:12px;border-radius:5px;display:grid;gap:12px}.kfc-picker[hidden],.kfc-candidate[hidden]{display:none}.kfc-picker-items{display:grid;gap:8px;max-height:240px;overflow:auto}.kfc-picker-items label{flex-direction:row;align-items:center}.kfc-cascade{display:flex;gap:8px;flex-wrap:wrap}.kfc-cascade select{flex:1;min-width:100px}.kfc-vertical{flex-direction:column;align-items:flex-start}.kfc-field .handwritten-signature{width:100%;box-sizing:border-box}.kfc-field input[readonly]{background:rgba(128,128,128,.06)}
@media(max-width:600px){.kfc-field{grid-column:1/-1}.kfc-inline>label{min-width:100%;}.kfc-cascade{flex-direction:column}.kfc-file-list li{flex-wrap:wrap}}
@media print{[data-web-hint],.kfc-help,.kfc-status,.kfc-upload,.kfc-picker,.kfc-candidate,[data-kfc-pick],[data-kfc-locate],[data-kfc-assist],[data-kfc-remove]{display:none!important}input::placeholder,textarea::placeholder{color:transparent!important;opacity:0!important}}
.kfc-file-list li .kfc-image-preview{display:block;max-width:100%;max-height:320px;object-fit:contain;flex-basis:100%;border:1px solid #dde2ea;border-radius:4px}.kfc-file-list li:has(.kfc-image-preview){flex-wrap:wrap}
