/*
 * [INPUT]: public/admin/editor.html - AI 助手与聊天/补丁预览 DOM 结构
 * [INPUT]: public/admin/assets/js/editor/ai/*.js - AI 交互状态 class
 * [OUTPUT]: AI 助手面板与编辑区红绿 Diff 视觉样式
 * [POS]: 编辑器 AI 专属样式层（从 components.css 拆分）
 *
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

.ai-assistant-panel { border: 1px solid #e5e5e5; border-radius: 10px; background: #fff; padding: 12px; }
.ai-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.ai-compose-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ai-action-btn, .ai-run-btn { border: 1px solid #111; background: #fff; color: #111; border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-action-btn:hover, .ai-run-btn:hover { background: #111; color: #fff; }
.ai-action-btn:disabled, .ai-run-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ai-model-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; margin: 10px 0; }
.ai-model-label { display: inline-flex; align-items: center; font-size: 12px; color: #666; font-weight: 600; }
.ai-provider-select, .ai-model-input { width: 100%; }
.ai-history-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ai-history-list { margin-top: 8px; border: 1px solid #e5e5e5; border-radius: 8px; max-height: 180px; overflow-y: auto; background: #fafafa; }
.ai-history-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #ececec; font-size: 12px; color: #444; }
.ai-history-item:last-child { border-bottom: none; }
.ai-history-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history-empty { padding: 10px; font-size: 12px; color: #888; text-align: center; }
.ai-history-restore { border: 1px solid #222; background: #fff; color: #222; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.ai-history-restore:hover { background: #111; color: #fff; }
.ai-status-text { margin-top: 8px; font-size: 12px; color: #666; min-height: 18px; }
.ai-status-text.is-error { color: #dc2626; }
.ai-chat-panel { margin-top: 10px; border: 1px solid #ececec; border-radius: 8px; padding: 8px; background: #fafafa; }
.ai-chat-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.ai-chat-list { max-height: 160px; overflow-y: auto; border: 1px solid #e8e8e8; border-radius: 6px; background: #fff; padding: 8px; }
.ai-chat-empty { font-size: 12px; color: #888; line-height: 1.5; }
.ai-chat-item { margin-bottom: 8px; font-size: 12px; line-height: 1.5; }
.ai-chat-item:last-child { margin-bottom: 0; }
.ai-chat-role { display: inline-block; min-width: 40px; font-weight: 700; color: #111; }
.ai-chat-item.user .ai-chat-role { color: #333; }
.ai-chat-item.assistant .ai-chat-role { color: #000; }
#aiChatInput { margin-top: 8px; min-height: 56px; resize: vertical; }
.editor-inline-diff { margin: 8px 0 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; overflow: hidden; }
.editor-inline-diff-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; background: #fafafa; }
.editor-inline-diff-title { font-size: 12px; color: #444; font-weight: 600; }
.editor-inline-diff-actions { display: flex; gap: 8px; }
.editor-inline-diff-lines { max-height: 260px; overflow: auto; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; }
.editor-inline-diff-line { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 4px 6px; border-radius: 6px; margin-bottom: 2px; white-space: pre-wrap; word-break: break-word; }
.editor-inline-diff-line:last-child { margin-bottom: 0; }
.editor-inline-diff-prefix { font-weight: 700; text-align: center; color: #666; }
.editor-inline-diff-line.is-context { background: #f8f8f8; color: #333; }
.editor-inline-diff-line.is-remove { background: #fff1f2; color: #991b1b; }
.editor-inline-diff-line.is-remove .editor-inline-diff-prefix { color: #dc2626; }
.editor-inline-diff-line.is-add { background: #ecfdf3; color: #14532d; }
.editor-inline-diff-line.is-add .editor-inline-diff-prefix { color: #16a34a; }
.editor-inline-diff-line.is-ellipsis { background: transparent; color: #888; font-style: italic; }
