.ai-panel {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.ai-panel h6 { margin: 0 0 10px 0; font-weight: 600; color: #333; }

.ai-panel h6 i { color: #667eea; }

.ai-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ai-draft-card {
    margin-top: 10px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.ai-draft-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    font-size: 13px;
    margin-bottom: 8px;
}

.ai-history { margin-top: 12px; }

.ai-history ul { margin: 6px 0 0 0; padding-left: 18px; color: #666; font-size: 12px; }

.ai-history li { margin-bottom: 2px; }

.ai-history a { color: #666; text-decoration: none; }

.ai-history a:hover { color: #667eea; }

.ai-history a.ai-history-active { color: #667eea; font-weight: 600; }

.ai-config-guide {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px dashed #e0a800;
    border-radius: 6px;
    background: #fffbea;
    color: #7a5c00;
    font-size: 13px;
    line-height: 1.6;
}

.ai-config-guide a { color: #667eea; font-weight: 600; text-decoration: none; }

.ai-config-guide i { color: #e0a800; margin-right: 4px; }

/* 操作失败内联错误区（红色系，与 .ai-config-guide 同级视觉语言） */
.ai-error {
    margin-top: 10px;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fdecea;
    color: #a71d2a;
}
.ai-error-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #a71d2a;
}
.ai-error-head i { margin-right: 4px; }
.ai-error-close {
    width: 22px;
    height: 22px;
    line-height: 18px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #a71d2a;
    font-size: 16px;
}
.ai-error-close:hover { background: #f5c6cb; color: #842029; }
.ai-error-text { margin-top: 6px; font-size: 12px; line-height: 1.6; word-break: break-word; }

/* 质量检查结构化卡片 */
.ai-quality { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-label { font-size: 13px; color: #555; font-weight: 500; }

.quality-score { font-size: 18px; font-weight: 700; }

.quality-score.score-good { color: #28a745; }
.quality-score.score-mid { color: #ffc107; }
.quality-score.score-bad { color: #dc3545; }
.quality-score.score-none { color: #868e96; }

.quality-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.quality-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }

.quality-bar-fill.score-good { background: #28a745; }
.quality-bar-fill.score-mid { background: #ffc107; }
.quality-bar-fill.score-bad { background: #dc3545; }
.quality-bar-fill.score-none { background: #868e96; }

.quality-section { border-top: 1px dashed #dee2e6; padding-top: 8px; }

.quality-section-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 4px; }

.quality-section-title i { color: #667eea; margin-right: 4px; }

.quality-section ul { margin: 0; padding-left: 20px; font-size: 13px; color: #555; }

.quality-section li { margin-bottom: 2px; }

.ai-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-panel-header h6 { margin: 0; font-weight: 600; color: #333; }
.ai-config-link { font-size: 12px; color: #667eea; text-decoration: none; }
.ai-config-link:hover { text-decoration: underline; }
.ai-current-model {
    display: flex; align-items: center; gap: 4px; font-size: 13px; color: #555;
    background: #f0f3ff; border: 1px solid #e0e6ff; border-radius: 6px;
    padding: 6px 10px; margin-bottom: 10px;
}
.ai-current-model i { color: #667eea; }
.ai-model-name { font-weight: 600; color: #333; }
.ai-model-source { color: #888; font-size: 12px; }
.ai-risk {
    margin-top: 12px; border: 1px solid #ffe0a3; border-radius: 6px;
    padding: 10px 12px; background: #fffbea;
}
.ai-risk-title { font-size: 13px; font-weight: 600; color: #7a5c00; margin-bottom: 6px; }
.ai-risk-title i { color: #e0a800; margin-right: 4px; }
.ai-risk p { margin: 0 0 6px 0; font-size: 12px; color: #7a5c00; line-height: 1.6; }
.ai-risk ul { margin: 0; padding-left: 18px; font-size: 12px; color: #7a5c00; line-height: 1.7; }
.ai-risk li { margin-bottom: 2px; }

/* 自定义模型配置覆盖层（参考 Lifecycle.razor 的 form-modal 模式，z-index 盖过对话框宿主） */
.form-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}
.form-modal-container {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 12px;
    width: 900px;
    max-width: 94vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.form-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}
.form-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}
.form-modal-close:hover {
    background: #e9ecef;
    color: #333;
}
.form-modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}
.form-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* 非 AI 类型子文件灰色提示（DocumentAiPanel 使用） */
.ai-disabled-note {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.6;
}
.ai-disabled-note i { color: #adb5bd; margin-right: 4px; }
