/* ===== 列表表格 =====
   首页数据表的表头、行高、操作按钮和底部说明；列宽主要在 views.js 的 colgroup 中改。 */
.review-table-card {
  background: #fff;
  border: 1px solid var(--wb-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--wb-shadow-sm);
}

.review-table-wrap { overflow-x: auto; overflow-y: hidden; }

.review-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 920px;
}

.review-table th {
  text-align: left;
  padding: 12px 10px;
  background: #f8fbff;
  border-bottom: 1px solid var(--wb-border);
  color: var(--wb-text-tertiary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.review-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  font-size: 14px;
  color: var(--wb-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-table tbody tr:hover { background: #fafcff; }

.review-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--wb-text);
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
}

.review-action-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-height: 30px;
  white-space: nowrap;
}

.review-action-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.review-action-btn.edit { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.review-action-btn.edit:hover { background: #f1f5f9; border-color: #cbd5e1; }
.review-action-btn.withdraw { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.review-action-btn.withdraw:hover { background: #fef3c7; border-color: #fbbf24; }

.review-action-view {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.review-action-view:hover { color: #1d4ed8; text-decoration: underline; }

.review-table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #fbfdff;
  color: #64748b;
  font-size: 13px;
  border-top: 1px solid #e2e8f0;
}

/* ===== 审核状态标签 =====
   状态到 class 的对应关系在 core/model.js 的 getCaseListStatusClass() 中。 */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.pending  { color: #c2410c; background: #fff7ed; border-color: #fdba74; }
.status-pill.approved { color: #047857; background: #ecfdf5; border-color: #86efac; }
.status-pill.rejected { color: #dc2626; background: #fef2f2; border-color: #fca5a5; }
.status-pill.offline  { color: #64748b; background: #f8fafc; border-color: #cbd5e1; }

/* ===== 空数据状态 =====
   当首页没有任何场景需求时显示。文字在 views.js 的 renderCaseList() 中修改。 */
.profile-empty-state {
  padding: 44px 24px;
  text-align: center;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

/* ===== 表单通用组件 =====
   左侧卡片、输入框、文本域、下拉框、单选/多选和提交按钮的统一样式。 */
.sd-form-page { max-width: 860px; }

.sd-form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.sd-form-card-header {
  font-weight: 700;
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8f0fe;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sd-form-card-header::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: #2563eb;
  display: inline-block;
}

.sd-form-field { margin-bottom: 16px; }
.sd-form-field:last-child { margin-bottom: 0; }

.sd-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.sd-form-label .required-star { color: #dc2626; margin-left: 2px; }

.db-field-name {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eef4fb;
  color: #64748b;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.sd-form-input,
.sd-form-select,
.sd-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

.sd-form-input:focus,
.sd-form-select:focus,
.sd-form-textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.14);
}

.sd-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.sd-form-textarea { resize: vertical; min-height: 90px; }

.sd-form-hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }

.sd-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sd-form-grid.three { grid-template-columns: repeat(3, 1fr); }

.db-sync-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  line-height: 1.7;
}

.system-field-preview {
  margin-top: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.system-field-preview summary {
  padding: 12px 14px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.system-field-preview pre {
  margin: 0;
  padding: 0 14px 14px;
  color: #334155;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

.sd-form-choice-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sd-form-choice-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.sd-form-coop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.sd-form-coop-tag {
  border: 1px solid #dbe4f0;
  padding: 7px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.sd-form-coop-tag:hover { border-color: #93c5fd; background: #eff6ff; color: #2563eb; }
.sd-form-coop-tag input[type="checkbox"]:checked + span { color: #2563eb; font-weight: 600; }

.sd-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.sd-form-submit-btn {
  background: #2563eb;
  color: #fff;
  padding: 10px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sd-form-submit-btn:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.25); }

/* ===== 驳回/详情提示 =====
   重新编辑已驳回记录时，表单上方的醒目提示样式。 */
.sd-detail-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
}
.sd-detail-alert.denied { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.sd-detail-alert.rejected { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.sd-detail-alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ===== 旧版 AI 结果组件 =====
   ai.js 中旧版建议预览所用；当前右侧对话助手主要样式在 scene-demand.css。 */
.ai-panel {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 16px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ===== 全局轻提示动画 =====
   showToast() 动态生成提示元素，这里只定义进场动画。 */
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 场景需求表格专项规则 =====
   覆盖通用表格的列宽和长文本显示方式。 */
.scene-needs-table th:last-child,
.scene-needs-table td:last-child { width: 200px; min-width: 200px; }
.scene-needs-table th:nth-last-child(2),
.scene-needs-table td:nth-last-child(2) { width: 84px; min-width: 84px; }
.scene-needs-table td:nth-child(5) { white-space: nowrap; vertical-align: top; }
.scene-needs-table .review-action-cell { flex-wrap: nowrap; }

/* ===== 详情页 =====
   详情页顶部摘要、字段卡片和长文本展示。字段顺序在 form.js 的 renderDetailPage() 修改。 */
.sd-detail-wrapper { padding-bottom: 20px; }
.sd-detail-topbar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}
.sd-detail-topbar-actions { display: flex; gap: 8px; }
.sd-detail-hero {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 16px;
}
.sd-detail-hero-title { font-size: 22px; font-weight: 800; color: #111827; margin-bottom: 6px; }
.sd-detail-hero-meta { font-size: 13px; color: #64748b; display: flex; gap: 16px; flex-wrap: wrap; }
.sd-detail-field-block { margin-bottom: 18px; }
.sd-detail-field-label { font-size: 13px; font-weight: 700; color: #6b7280; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.sd-detail-field-value { font-size: 15px; color: #1e293b; line-height: 1.7; }
.sd-detail-field-value--changed { font-size: 15px; color: #1e293b; line-height: 1.7; background: #fffbeb; padding: 6px 10px; border-radius: 6px; border: 1px solid #fcd34d; }
.sd-detail-field-original { font-size: 13px; color: #9ca3af; margin-top: 6px; padding: 8px; background: #f9fafb; border-radius: 6px; }
.sd-indicator-changed-badge {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
}
