/* doc-mgmt-ai.css - V7.6-Step5 文档管理AI功能样式 */
/* 包含dm76基础样式 + AI卡片/结果/批量操作样式 */

/* ==================== dm76 基础布局 ==================== */
.dm76-page { display: flex; flex-direction: column; height: 100%; background: #f8fafc; }
.dm76-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #fff; border-bottom: 1px solid #e5e7eb; min-height: 48px; }
.dm76-topbar-left { display: flex; align-items: center; gap: 12px; }
.dm76-topbar-right { display: flex; align-items: center; gap: 8px; }
.dm76-title { font-size: 16px; font-weight: 700; color: #1f2937; }

.dm76-body { display: flex; flex: 1; overflow: hidden; }
.dm76-sidebar { width: 200px; background: #fff; border-right: 1px solid #e5e7eb; padding: 8px; overflow-y: auto; position: relative; transition: width 0.2s; }
.dm76-sidebar.collapsed { width: 0; padding: 0; overflow: hidden; }
.dm76-sidebar-toggle { position: absolute; right: -12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 50%; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; font-size: 10px; }

.dm76-zone-list { margin-bottom: 12px; }
.dm76-zone-item { padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #374151; transition: background 0.15s; }
.dm76-zone-item:hover { background: #f0fdf4; }
.dm76-zone-item.active { background: #dcfce7; color: #166534; font-weight: 600; }
.dm76-zone-name { font-weight: 500; }
.dm76-zone-count { font-size: 11px; color: #9ca3af; }

.dm76-site-list { margin-top: 4px; padding-left: 16px; }
.dm76-site-item { padding: 4px 8px; font-size: 12px; color: #6b7280; border-radius: 4px; cursor: pointer; }
.dm76-site-item:hover { background: #f3f4f6; }
.dm76-site-item.active { background: #dbeafe; color: #1d4ed8; }

.dm76-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dm76-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.dm76-toolbar-left { display: flex; align-items: center; gap: 8px; }
.dm76-toolbar-right { display: flex; align-items: center; gap: 8px; }

.dm76-search-input { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; width: 220px; outline: none; }
.dm76-search-input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

.dm76-select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; background: #fff; }
.dm76-select-sm { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; background: #fff; }

.dm76-doclist { flex: 1; overflow-y: auto; padding: 8px 16px; }
.dm76-empty { text-align: center; padding: 60px 20px; color: #9ca3af; }
.dm76-empty i { font-size: 48px; margin-bottom: 12px; display: block; }

/* 统计栏 */
.dm76-footer { display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: #fff; border-top: 1px solid #e5e7eb; font-size: 12px; color: #6b7280; }
.dm76-stat-ok { color: #16a34a; }
.dm76-stat-warn { color: #ca8a04; }
.dm76-stat-err { color: #dc2626; }

/* 记录行 */
.dm76-record { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.1s; }
.dm76-record:hover { background: #f0fdf4; }
.dm76-record.selected { background: #dcfce7; }
.dm76-record-status { font-size: 14px; }
.dm76-record-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm76-record-flags { display: flex; gap: 4px; align-items: center; }
.dm76-flag { font-size: 11px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.dm76-flag-ok { background: #dcfce7; color: #166534; }
.dm76-flag-warn { background: #fef3c7; color: #92400e; }
.dm76-flag-err { background: #fee2e2; color: #991b1b; }
.dm76-flag-na { background: #f3f4f6; color: #9ca3af; }
.dm76-flag-muted { background: #f9fafb; color: #d1d5db; }

/* 章节分组 */
.dm76-chapter { margin-bottom: 4px; }
.dm76-chapter-header { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; color: #374151; }
.dm76-chapter-header:hover { background: #f3f4f6; }
.dm76-chapter-arrow { font-size: 10px; width: 16px; text-align: center; }
.dm76-chapter-icon { font-size: 14px; }
.dm76-chapter-title { flex: 1; }
.dm76-chapter-stats { display: flex; gap: 4px; font-size: 11px; font-weight: 400; }
.dm76-chapter-body { padding-left: 16px; }
.dm76-ms { padding: 0 4px; }
.dm76-ms-ok { color: #16a34a; }
.dm76-ms-warn { color: #ca8a04; }
.dm76-ms-err { color: #dc2626; }
.dm76-ms-na { color: #9ca3af; }

/* 超期 */
.dm76-overdue-section { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.dm76-overdue-header { padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.dm76-overdue-list { padding: 4px 8px; }
.dm76-overdue-item { padding: 4px 8px; font-size: 12px; cursor: pointer; display: flex; justify-content: space-between; border-radius: 4px; }
.dm76-overdue-item:hover { background: #fef3c7; }
.dm76-overdue-empty { text-align: center; font-size: 12px; color: #9ca3af; padding: 8px; }
.dm76-arrow { font-size: 10px; }

/* 详情面板 */
.dm76-detail { position: fixed; right: -400px; top: 0; width: 400px; height: 100%; background: #fff; border-left: 1px solid #e5e7eb; z-index: 200; transition: right 0.25s ease; display: flex; flex-direction: column; box-shadow: -4px 0 16px rgba(0,0,0,0.06); }
.dm76-detail.open { right: 0; }
.dm76-detail-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; font-size: 15px; font-weight: 600; }
.dm76-detail-body { flex: 1; overflow-y: auto; padding: 16px; }
.dm76-btn-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #9ca3af; padding: 4px 8px; }
.dm76-btn-close:hover { color: #374151; }

.dm76-detail-section { margin-bottom: 16px; }
.dm76-detail-section-title { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #f3f4f6; }
.dm76-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dm76-detail-field { display: flex; flex-direction: column; gap: 2px; }
.dm76-detail-label { font-size: 11px; color: #9ca3af; }
.dm76-detail-value { font-size: 13px; color: #1f2937; }
.dm76-detail-empty { text-align: center; padding: 12px; color: #d1d5db; font-size: 12px; }

/* 文件列表 */
.dm76-file-list { margin-bottom: 8px; }
.dm76-file-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12px; }
.dm76-file-icon { color: #6b7280; }
.dm76-file-name { flex: 1; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm76-file-date { color: #9ca3af; font-size: 11px; }
.dm76-file-actions { display: flex; gap: 2px; }

/* QC反馈 */
.dm76-qc-item { padding: 8px; background: #fefce8; border-radius: 6px; margin-bottom: 6px; }
.dm76-qc-header { font-size: 12px; font-weight: 600; color: #92400e; margin-bottom: 4px; }
.dm76-qc-date { font-weight: 400; color: #9ca3af; margin-left: 8px; }
.dm76-qc-comment { font-size: 12px; color: #78350f; }

/* 按钮 */
.dm76-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; }
.dm76-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dm76-btn-primary { background: #2563eb; color: #fff; }
.dm76-btn-primary:hover { background: #1d4ed8; }
.dm76-btn-ghost { background: transparent; color: #374151; border-color: #d1d5db; }
.dm76-btn-ghost:hover { background: #f3f4f6; }
.dm76-btn-outline { background: #fff; color: #374151; border-color: #d1d5db; }
.dm76-btn-outline:hover { background: #f9fafb; }
.dm76-btn-sm { padding: 4px 8px; font-size: 12px; }
.dm76-btn-xs { padding: 2px 6px; font-size: 11px; border: 1px solid #e5e7eb; border-radius: 4px; background: #fff; cursor: pointer; color: #6b7280; }
.dm76-btn-xs:hover { background: #f3f4f6; color: #374151; }

/* 初始化提示 */
.dm76-init-prompt { display: flex; align-items: center; justify-content: center; flex: 1; }
.dm76-init-box { text-align: center; padding: 40px; }
.dm76-init-icon { font-size: 48px; color: #d1d5db; margin-bottom: 16px; }

/* ==================== V7.6-Step5: AI功能样式 ==================== */

/* AI按钮区 */
.dm76-ai-section { background: #f0f9ff; border-radius: 8px; padding: 12px; }
.dm76-ai-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.dm76-btn-ai { background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%); color: #fff; border: none; font-size: 12px; padding: 6px 10px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s; }
.dm76-btn-ai:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.dm76-btn-ai:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* AI结果展示区 */
.dm76-ai-result { margin-top: 10px; display: none; }
.dm76-ai-result[style*="block"] { display: block; }

/* AI卡片 */
.dm76-ai-card { background: #fff; border: 1px solid #e0e7ff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(37,99,235,0.08); }
.dm76-ai-card-title { font-size: 14px; font-weight: 700; padding: 10px 14px; background: linear-gradient(135deg, #eff6ff, #f5f3ff); color: #1e40af; border-bottom: 1px solid #e0e7ff; }
.dm76-ai-card-body { padding: 12px 14px; }
.dm76-ai-card-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #e0e7ff; background: #fafafe; }

/* AI字段 */
.dm76-ai-field { display: flex; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px solid #f3f4f6; }
.dm76-ai-field:last-child { border-bottom: none; }
.dm76-ai-field label { min-width: 70px; color: #6b7280; font-weight: 500; flex-shrink: 0; }
.dm76-ai-field span { color: #1f2937; word-break: break-all; }
.dm76-ai-old { color: #9ca3af; text-decoration: line-through; }
.dm76-ai-new { color: #1e40af; font-weight: 600; }
.dm76-ai-ok { color: #16a34a; font-weight: 600; }
.dm76-ai-err { color: #dc2626; font-weight: 600; }

/* AI问题列表 */
.dm76-ai-issues { margin-top: 8px; }
.dm76-ai-issue { background: #fff; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
.dm76-ai-issue-header { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.dm76-ai-issue-detail { font-size: 11px; color: #6b7280; margin-bottom: 2px; }
.dm76-ai-issue-suggestion { font-size: 11px; color: #2563eb; }

/* AI备选归档 */
.dm76-ai-alternatives { margin-top: 8px; border-top: 1px dashed #d1d5db; padding-top: 8px; }
.dm76-ai-alt-title { font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 4px; }
.dm76-ai-alt-item { padding: 4px 8px; font-size: 12px; color: #4b5563; cursor: pointer; border-radius: 4px; margin-bottom: 2px; }
.dm76-ai-alt-item:hover { background: #eff6ff; color: #1e40af; }

/* 批量操作下拉菜单 */
.dm76-batch-dropdown { position: absolute; right: 0; top: 100%; z-index: 100; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px 0; min-width: 180px; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.dm76-batch-item { padding: 8px 14px; font-size: 13px; cursor: pointer; color: #374151; }
.dm76-batch-item:hover { background: #f0fdf4; color: #166534; }
