/* =====================================================================
   shenbao.css —— 申报书自动生成模块专用样式
   依赖 style.css 基础样式（topbar / container / steps / panel / btn 等）
   ===================================================================== */

/* ===== 填写规范 折叠面板 ===== */
.fill-guide {
  background: #fffbf0;
  border: 1px solid #f5d99b;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.fill-guide summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #b07a14;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fill-guide summary::-webkit-details-marker { display: none; }
.fill-guide summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform .2s;
}
.fill-guide[open] summary::before { transform: rotate(90deg); }
.guide-list {
  margin-top: 14px;
  padding-left: 0;
  list-style: none;
}
.guide-list li {
  font-size: 13px;
  color: #5d4a1a;
  line-height: 1.8;
  padding: 4px 0 4px 20px;
  position: relative;
}
.guide-list li::before {
  content: '·';
  position: absolute;
  left: 6px;
  font-weight: 700;
  color: #b07a14;
}
.guide-list strong { color: #8a5a00; }

/* ===== Tab 导航（编辑区）===== */
.edit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.edit-tab-btn {
  padding: 9px 16px;
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all .15s;
}
.edit-tab-btn:hover { color: var(--primary); }
.edit-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.edit-tab-content { display: none; }
.edit-tab-content.active { display: block; }

/* ===== 申报人信息 / 企业信息 网格 ===== */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px 18px;
}
.field-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-item.full { grid-column: 1 / -1; }
.field-item label {
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
}
.field-item input,
.field-item select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  min-width: 0;
  background: #fff;
}
.field-item input:focus,
.field-item select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.field-divider {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 10px 0 4px;
}

/* ===== 动态表格 ===== */
.dyn-table-wrap {
  margin-bottom: 8px;
  overflow-x: auto;
}
.dyn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dyn-table th,
.dyn-table td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}
.dyn-table th {
  background: var(--primary-light);
  color: #1a4f7a;
  white-space: nowrap;
  font-weight: 600;
  font-size: 12px;
}
.dyn-table th.col-num { width: 36px; text-align: center; }
.dyn-table th.col-action { width: 56px; text-align: center; }
.dyn-table td.col-num { text-align: center; color: var(--gray); font-weight: 600; }
.dyn-table td.col-action { text-align: center; }
.dyn-table input,
.dyn-table textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 5px 6px;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  resize: vertical;
  box-sizing: border-box;
}
.dyn-table input:hover,
.dyn-table textarea:hover {
  border-color: #c8d4e0;
  background: #fff;
}
.dyn-table input:focus,
.dyn-table textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 1px var(--primary-light);
}
.dyn-table .empty-row td {
  text-align: center;
  color: var(--gray);
  padding: 16px;
  font-size: 13px;
}
.dyn-add-row { margin-top: 8px; }

/* ===== 长文本 + 字数计数器 ===== */
.char-field { margin-bottom: 22px; }
.char-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a4f7a;
  margin-bottom: 6px;
}
.char-field textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  box-sizing: border-box;
}
.char-field textarea.large { min-height: 220px; }
.char-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.char-meta { margin-top: 4px; }
.char-counter {
  display: inline-block;
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
}
.char-counter.ok { color: var(--green); }
.char-counter.warn-under { color: #e67e22; }
.char-counter.warn-over { color: var(--red); }
.char-hint {
  display: inline-block;
  margin-left: 12px;
  font-size: 12px;
  color: var(--gray);
}

/* ===== 证件照预览 ===== */
.photo-section { margin-bottom: 24px; }
.photo-section h3 { font-size: 15px; margin-bottom: 12px; }
.photo-preview-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.photo-preview {
  width: 100px;
  height: 150px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8f9fa;
  flex-shrink: 0;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-preview.empty .photo-placeholder {
  color: var(--gray);
  font-size: 12px;
}
.photo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== 材料分类摘要 / 警告 ===== */
.summary-wrap,
.warnings-wrap { margin-top: 20px; }
.summary-wrap h3,
.warnings-wrap h3 { font-size: 15px; margin-bottom: 10px; }
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
}
.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.cat-badge.basic { background: #e8f4fc; color: var(--primary); }
.cat-badge.project { background: #e6f4ea; color: var(--green); }
.cat-badge.achievement { background: #fef3e6; color: #b07a14; }
.cat-badge.photo { background: #f0e6fc; color: #6c3fa0; }
.cat-badge.signature { background: #fce6f0; color: #a23; }
.cat-badge.other { background: #eef; color: #4a4a8a; }
.summary-item .count { font-weight: 700; color: var(--primary); }
.summary-item .names { color: var(--gray); font-size: 12px; flex: 1; }
.warnings-list { list-style: none; padding: 0; }
.warnings-list li {
  font-size: 13px;
  color: #8a5a00;
  padding: 8px 12px;
  background: #fff3cd;
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid #f0ad4e;
  line-height: 1.6;
}

/* ===== 生成区 ===== */
.gen-summary { margin-bottom: 20px; }
.gen-summary p { font-size: 14px; color: #555; line-height: 1.8; }
.gen-info {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
}
.gen-info strong { color: var(--primary); }
.gen-result { margin-top: 20px; }
.gen-success {
  padding: 16px;
  background: #e6f4ea;
  border-radius: 8px;
  border-left: 4px solid var(--green);
  font-size: 14px;
  line-height: 1.8;
}
.gen-success a { color: var(--primary); font-weight: 600; text-decoration: none; }
.gen-success a:hover { text-decoration: underline; }
.gen-error {
  padding: 16px;
  background: #fdecea;
  border-radius: 8px;
  border-left: 4px solid var(--red);
  font-size: 14px;
  line-height: 1.8;
  color: var(--red);
}
.gen-loading {
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--primary);
}

/* ===== 文件夹信息 ===== */
.folder-info {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary);
}
.folder-info .file-count { font-weight: 700; }

/* ===== 解析进度 ===== */
.parse-progress {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.prog-line {
  font-size: 13px;
  padding: 3px 0;
  color: #555;
}
.prog-line .prog-stage {
  display: inline-block;
  width: 70px;
  font-weight: 600;
  color: var(--primary);
}

/* 行内复选框（视觉识别开关） */
.chk-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}
.chk-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

/* 字数补写提示条 */
.expand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 16px;
  background: #fef5e7;
  border-left: 3px solid #e67e22;
  border-radius: 4px;
  font-size: 13px;
  color: #8a5a00;
}
.expand-bar .btn { flex: 0 0 auto; }
.expand-bar #expandStatus { color: #666; }

/* 解析倒计时条 */
.parse-countdown {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eef3fb;
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 严重告警（如 AI 解析失败、未读到任何文本） */
.warnings-list li.warn-severe {
  color: #c0392b;
  font-weight: 600;
  background: #fdecea;
  border-left: 3px solid var(--red);
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* 成功类提示（视觉识别完成等） */
.warnings-list li.warn-ok {
  color: #1e8449;
  font-weight: 600;
  background: #f0f9f2;
  border-left: 3px solid var(--green);
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ===== 填写规范与合规审查 ===== */
.audit-clean {
  color: var(--green);
  font-weight: 600;
  padding: 12px 14px;
  background: #f0f9f2;
  border: 1px solid #cfe9d6;
  border-radius: 6px;
}
.audit-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.audit-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.audit-badge.error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.audit-badge.warn  { background: #fef5e7; color: #b9770e; border: 1px solid #f6e0b8; }
.audit-badge.info  { background: #eef3fb; color: #2c6cb0; border: 1px solid #cddff5; }

.audit-list { list-style: none; padding: 0; margin: 0; }
.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-left: 3px solid #ddd;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}
.audit-item:hover { background: #f7f9fc; }
.audit-item.error { border-left-color: var(--red); }
.audit-item.warn  { border-left-color: #e67e22; }
.audit-item.info  { border-left-color: #5b8fd6; }
.audit-item .audit-level {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #f2f2f2;
  color: #555;
}
.audit-item.error .audit-level { background: #fdecea; color: #c0392b; }
.audit-item.warn  .audit-level { background: #fef5e7; color: #b9770e; }
.audit-item.info  .audit-level { background: #eef3fb; color: #2c6cb0; }
.audit-item .audit-cat {
  flex: 0 0 auto;
  color: #888;
  font-size: 12px;
  padding-top: 1px;
}
.audit-item .audit-msg { flex: 1 1 auto; color: #333; }
.audit-item .audit-src {
  flex: 0 0 auto;
  color: #aaa;
  font-size: 11px;
  padding-top: 1px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.spec-card {
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fcfcfd;
}
.spec-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--primary);
}
.spec-card ul { margin: 0; padding-left: 18px; }
.spec-card li { font-size: 12.5px; line-height: 1.7; color: #444; }
.spec-src {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 3px;
  background: #eef3fb;
  color: #2c6cb0;
  font-size: 11px;
}

/* 从审查结果跳转时的字段高亮 */
.field-flash {
  outline: 2px solid #e67e22 !important;
  outline-offset: 1px;
  transition: outline-color 0.3s ease;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .field-grid { grid-template-columns: 1fr; }
  .photo-preview-wrap { flex-direction: column; }
  .edit-tabs { flex-wrap: nowrap; overflow-x: auto; }
}
