/* civil-method-statement.css — Method Statement 标准化参数录入
   颜色参考桌面 XAML: 主色 #1F5EFF, 危险色 #B42318, 边框 #AFC0D4, 背景白 */
.civil-method-statement-host { display: block; }

.ms-workbench {
  min-height: 640px;
  height: calc(100vh - 240px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  color: #17324d;
  font-size: 13px;
}

/* ---- 顶部标题栏 ---- */
.ms-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.ms-title h3 { margin: 0; font-size: 20px; font-weight: 600; color: #183b5b; }
.ms-subtitle { margin: 4px 0 0; color: #52616f; font-size: 12px; }
.ms-local-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #fff3cd;
  color: #8a6d1a;
  border: 1px solid #f0d878;
  font-size: 11px;
  font-weight: 600;
}
.ms-topbar-actions { display: flex; gap: 8px; }

/* ---- 通用按钮（桌面 PrimaryButton/DangerButton 对齐） ---- */
.ms-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #AFC0D4;
  border-radius: 5px;
  background: #fff;
  color: #17324d;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ms-btn:hover:not(:disabled) { background: #f4f8fb; }
.ms-btn:disabled { opacity: .5; cursor: not-allowed; }
.ms-btn.ms-primary { background: #1F5EFF; border-color: #1F5EFF; color: #fff; }
.ms-btn.ms-primary:hover:not(:disabled) { background: #1a52e0; }
.ms-btn.ms-danger { background: #B42318; border-color: #B42318; color: #fff; }
.ms-btn.ms-danger:hover:not(:disabled) { background: #991d14; }
.ms-btn.ms-mini { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---- 双栏布局：左 1fr / 右 1.2fr ---- */
.ms-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px;
}

/* ---- 左栏：方案记录列表 ---- */
.ms-record-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #AFC0D4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(41, 72, 107, .06);
  overflow: hidden;
}
.ms-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebf1;
  background: #fafcfe;
}
.ms-panel-title { font-size: 15px; font-weight: 600; color: #183b5b; }
.ms-msno { margin-left: 10px; color: #52616f; font-size: 12px; font-weight: 400; }
.ms-search { display: flex; gap: 6px; align-items: center; }
.ms-search input {
  width: 200px;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid #b9c9db;
  border-radius: 5px;
  padding: 0 9px;
  font: inherit;
  color: #17324d;
}
.ms-table-scroll { min-height: 0; overflow: auto; }
.ms-record-list table { width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 12.5px; }
.ms-record-list th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 9px; text-align: left;
  color: #38556f; background: #edf3f8;
  border-bottom: 1px solid #ccd9e6;
  white-space: nowrap;
}
.ms-record-list td { padding: 7px 9px; border-bottom: 1px solid #e5ebf1; vertical-align: top; }
.ms-record-list tbody tr { cursor: pointer; }
.ms-record-list tbody tr:hover, .ms-record-list tbody tr.selected { background: #eaf2ff; }
.ms-empty { text-align: center; color: #778a9d; padding: 28px !important; }

/* ---- 右栏：参数录入表单 ---- */
.ms-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #AFC0D4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(41, 72, 107, .06);
  overflow: hidden;
}
.ms-form-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ms-form-scroll { min-height: 0; overflow: auto; padding: 12px; }

/* ---- 表单字段网格 ---- */
.ms-form-grid { display: grid; gap: 10px; margin-bottom: 12px; }
.ms-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-field {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #526b83;
}
.ms-field.ms-block { margin-bottom: 10px; }
.ms-field input,
.ms-field select,
.ms-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #b9c9db;
  border-radius: 5px;
  padding: 7px 9px;
  font: inherit;
  font-weight: 400;
  color: #17324d;
  background: #fff;
}
.ms-field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.ms-field input:focus,
.ms-field select:focus,
.ms-field textarea:focus { outline: none; border-color: #1F5EFF; box-shadow: 0 0 0 2px rgba(31, 94, 255, .12); }
.ms-req { color: #b91c1c; font-style: normal; margin-left: 2px; }

/* ---- 工程规模参数 3 列网格 ---- */
.ms-scale-grid { margin-bottom: 10px; }
.ms-section-title {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #183b5b;
  border-left: 3px solid #1F5EFF;
  padding-left: 8px;
}

/* ---- 适用规范 多选 checkbox ---- */
.ms-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px;
  padding: 8px 10px;
  border: 1px solid #e5ebf1;
  border-radius: 5px;
  background: #fafcfe;
  margin-bottom: 12px;
}
.ms-checkbox { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 12.5px; color: #17324d; cursor: pointer; }
.ms-checkbox input { margin: 0; }

/* ---- 明细子表（关键设备/持证人员/附件） ---- */
.ms-sub-table {
  border: 1px solid #e5ebf1;
  border-radius: 6px;
  margin-bottom: 12px;
  background: #fff;
}
.ms-sub-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #f4f8fb;
  border-bottom: 1px solid #e5ebf1;
  font-weight: 600;
  color: #183b5b;
  font-size: 13px;
}
.ms-sub-table-scroll { max-height: 220px; overflow: auto; }
.ms-sub-table table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12.5px; }
.ms-sub-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 6px 8px; text-align: left;
  color: #38556f; background: #edf3f8;
  border-bottom: 1px solid #ccd9e6;
  white-space: nowrap;
}
.ms-sub-table td { padding: 4px 6px; border-bottom: 1px solid #eef2f6; }
.ms-sub-table td input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 6px;
  font: inherit;
  color: #17324d;
  background: transparent;
}
.ms-sub-table td input:focus { outline: none; border-color: #1F5EFF; background: #fff; }
.ms-row-idx { text-align: center; color: #778a9d; width: 36px; }
.ms-row-del { text-align: center; width: 44px; }
.ms-mini-btn {
  height: 24px;
  padding: 0 8px;
  border: 1px solid #AFC0D4;
  border-radius: 4px;
  background: #fff;
  color: #17324d;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ms-mini-btn:hover { background: #f4f8fb; }
.ms-mini-btn.ms-del { color: #B42318; border-color: #f0b9b9; background: #fff4f4; }
.ms-mini-btn.ms-del:hover { background: #fee; }

/* ---- 校验提示 ---- */
.ms-validation-summary {
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid #f0b9b9;
  border-radius: 5px;
  background: #fff4f4;
  color: #b91c1c;
  font-size: 12.5px;
}
.ms-error {
  display: grid; gap: 3px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid #f0b9b9;
  border-radius: 5px;
  background: #fff4f4;
  color: #9f2929;
  font-size: 12.5px;
}

/* ---- 导出预览区 ---- */
.ms-preview-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.ms-preview textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  border: 1px solid #b9c9db;
  border-radius: 5px;
  padding: 9px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #17324d;
  background: #fafcfe;
  resize: vertical;
}

/* ---- 底部状态条 ---- */
.ms-status {
  padding: 8px 12px;
  border: 1px solid #c8d8e8;
  border-radius: 6px;
  background: #f4f8fb;
  font-size: 12.5px;
  color: #52616f;
}

/* ---- 响应式 ---- */
@media (max-width: 1100px) {
  .ms-workbench { height: auto; }
  .ms-layout { grid-template-columns: 1fr; }
  .ms-record-list { min-height: 320px; }
  .ms-form { min-height: 520px; }
  .ms-grid-2, .ms-scale-grid { grid-template-columns: 1fr; }
}
