/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #e4e4e7;
}
.container { max-width: 1600px; margin: 0 auto; padding: 8px 12px; height: 100vh; display: flex; flex-direction: column; }
header { text-align: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.1); position: relative; }
h1 { font-size: 1.1rem; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0; }

/* 三列布局 */
.main-layout { display: grid; grid-template-columns: 300px 1fr 280px; gap: 12px; flex: 1; overflow: hidden; padding-top: 12px; }

/* 侧边栏通用样式 */
.sidebar { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 14px; backdrop-filter: blur(10px); display: flex; flex-direction: column; overflow: hidden; }
.sidebar h2 { font-size: 0.9rem; margin: 10px 0 8px 0; color: #a78bfa; display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* 左侧边栏特殊布局 */
.left-sidebar { display: grid; grid-template-rows: auto 1fr; gap: 12px; overflow: hidden; }
.left-sidebar-top { display: flex; flex-direction: column; overflow: hidden; max-height: 45vh; }
.left-sidebar-bottom { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 12px; backdrop-filter: blur(10px); overflow-y: auto; }

/* 状态指示器 */
.status-indicator { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(34, 197, 94, 0.1); border-radius: 8px; font-size: 0.85rem; }
.status-indicator.disconnected { background: rgba(239, 68, 68, 0.1); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
.status-indicator.disconnected .status-dot { background: #ef4444; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.workspace-path { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 8px; font-family: 'Monaco', monospace; font-size: 0.75rem; word-break: break-all; }

/* Todo 列表 */
.todo-list { flex: 1; overflow-y: auto; margin-top: 10px; min-height: 0; }
.todo-item { padding: 10px; margin-bottom: 6px; border-radius: 8px; background: rgba(255,255,255,0.04); border-left: 3px solid #6b7280; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.todo-item:hover { background: rgba(255,255,255,0.07); }
.todo-item.in-progress { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.todo-item.completed { border-left-color: #22c55e; opacity: 0.5; }

/* 语音控制面板 */
.voice-control { display: flex; flex-direction: column; gap: 10px; }
.record-buttons { display: flex; gap: 10px; }
.record-btn { flex: 1; padding: 12px; border: none; border-radius: 10px; cursor: pointer; font-size: 0.9rem; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.record-btn.start { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.record-btn.start:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); }
.record-btn.start:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.record-btn.stop { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); color: white; }
.record-btn.stop:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4); }
.record-btn.stop:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.record-btn.short-start { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; }
.record-btn.short-start:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4); }
.record-btn.short-start.recording { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); animation: pulse-short 1.5s infinite; }
@keyframes pulse-short { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* 实时转写显示 */
.live-transcription { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 18px; min-height: 60px; font-size: 0.95rem; line-height: 1.6; }
.live-transcription.placeholder { color: #a1a1aa; font-style: italic; }
.live-transcription .text { color: #fbbf24; }

/* 文字池 */
.text-pool-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; max-height: 25vh; }
.text-pool-list { flex: 1; overflow-y: auto; margin-top: 8px; }
.text-pool-item { padding: 8px; margin-bottom: 6px; border-radius: 6px; background: rgba(255,255,255,0.03); border-left: 3px solid #6b7280; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; display: flex; gap: 6px; align-items: flex-start; }
.text-pool-item:hover { background: rgba(255,255,255,0.06); }
.text-pool-item.selected { background: rgba(59, 130, 246, 0.2); border-left-color: #3b82f6; }
.text-pool-item .checkbox { width: 16px; height: 16px; border: 2px solid #6b7280; border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.text-pool-item.selected .checkbox { background: #3b82f6; border-color: #3b82f6; }
.text-pool-item .checkbox::after { content: '✓'; color: white; font-size: 10px; display: none; }
.text-pool-item.selected .checkbox::after { display: block; }
.text-pool-item .time { color: #71717a; font-size: 0.7rem; flex-shrink: 0; }
.text-pool-item .text-content { flex: 1; word-break: break-word; line-height: 1.4; }

/* 文字池操作按钮 */
.pool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pool-btn { padding: 8px 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.pool-btn.select-all { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.pool-btn.select-all:hover { background: rgba(59, 130, 246, 0.3); }
.pool-btn.clear { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.pool-btn.clear:hover { background: rgba(239, 68, 68, 0.3); }
.pool-btn.send { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; }
.pool-btn.send:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3); }
.pool-btn.planner { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); color: white; }
.pool-btn.planner:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(167, 139, 250, 0.3); }
.pool-btn.refine { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.pool-btn.refine:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3); }

/* 任务规划助手控制面板 - 精简版 */
.task-planner-panel { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.planner-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.planner-title { font-size: 0.7rem; color: #a78bfa; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.planner-switch { position: relative; width: 32px; height: 16px; }
.planner-switch input { opacity: 0; width: 0; height: 0; }
.planner-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: rgba(107, 114, 128, 0.5); border-radius: 20px; transition: all 0.3s; }
.planner-slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: all 0.3s; }
.planner-switch input:checked + .planner-slider { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.planner-switch input:checked + .planner-slider:before { transform: translateX(16px); }
.planner-settings { display: none; gap: 5px; flex-direction: column; }
.planner-settings.show { display: flex; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 0.7rem; }
.setting-row label { color: #a1a1aa; flex: 1; }
.setting-row input { width: 45px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-radius: 3px; padding: 3px 5px; color: #e4e4e7; font-size: 0.7rem; text-align: center; }
.setting-row input:focus { border-color: #667eea; outline: none; }
.planner-status { font-size: 0.6rem; color: #a1a1aa; margin-top: 5px; }

/* 聊天容器 */
.chat-container { background: rgba(255,255,255,0.05); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(10px); }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.message { max-width: 85%; padding: 12px 14px; border-radius: 10px; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.user { align-self: flex-end; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.message.assistant { align-self: flex-start; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); }
.message.system { align-self: center; background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3); font-size: 0.88rem; max-width: 90%; }
.message .content { line-height: 1.7; word-wrap: break-word; font-size: 0.95rem; }
.message .content code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-family: 'Monaco', monospace; }
.tool-display { background: rgba(0,0,0,0.3); border-radius: 8px; padding: 14px; margin: 10px 0; font-family: 'Monaco', monospace; font-size: 0.88rem; }
.tool-name { color: #f59e0b; font-weight: bold; }
.download-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 10px 18px; background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; text-decoration: none; border-radius: 8px; font-size: 0.95rem; transition: all 0.3s; }
.download-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4); }

/* 输入区域 */
.input-area { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 10px; }
.input-area input { flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 10px 14px; color: #e4e4e7; font-size: 0.95rem; outline: none; }
.input-area input:focus { border-color: #667eea; background: rgba(255,255,255,0.12); }
.send-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; border-radius: 8px; padding: 10px 24px; color: white; font-size: 0.95rem; cursor: pointer; transition: all 0.3s; }
.send-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* 打字指示器 */
.typing-indicator { display: inline-flex; gap: 6px; padding: 12px 16px; }
.typing-indicator span { width: 8px; height: 8px; background: #667eea; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* 录音状态 */
.recording-status { padding: 10px; background: rgba(239, 68, 68, 0.1); border-radius: 8px; text-align: center; font-size: 0.85rem; color: #fca5a5; display: none; }
.recording-status.active { display: block; animation: pulse 1.5s infinite; }

/* ==================== 任务调度器样式 - 精简版 ==================== */
/* 任务统计面板 */
.task-stats-panel { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.stats-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stats-title { font-size: 0.7rem; color: #a78bfa; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stat-item { text-align: center; padding: 5px; background: rgba(255,255,255,0.05); border-radius: 5px; }
.stat-value { font-size: 0.85rem; font-weight: bold; color: #e4e4e7; }
.stat-label { font-size: 0.55rem; color: #9ca3af; margin-top: 2px; }
.stat-item.pending .stat-value { color: #6b7280; }
.stat-item.running .stat-value { color: #3b82f6; }
.stat-item.completed .stat-value { color: #22c55e; }
.stat-item.failed .stat-value { color: #ef4444; }

/* 进度条 */
.progress-bar { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); transition: width 0.3s; }

/* 任务列表 */
.scheduler-task-list { flex: 1; overflow-y: auto; margin-top: 8px; max-height: 25vh; }
.scheduler-task-card { padding: 8px; margin-bottom: 6px; border-radius: 6px; background: rgba(255,255,255,0.03); border-left: 3px solid #6b7280; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; position: relative; }
.scheduler-task-card:hover { background: rgba(255,255,255,0.06); }
.scheduler-task-card.selected { background: rgba(59, 130, 246, 0.15); border-left-color: #3b82f6; }

/* 任务状态样式 */
.scheduler-task-card.status-pending { border-left-color: #6b7280; }
.scheduler-task-card.status-queued { border-left-color: #a78bfa; }
.scheduler-task-card.status-running { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.scheduler-task-card.status-paused { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.scheduler-task-card.status-completed { border-left-color: #22c55e; opacity: 0.7; }
.scheduler-task-card.status-failed { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.scheduler-task-card.status-cancelled { border-left-color: #9ca3af; opacity: 0.5; }

/* 任务卡片内容 */
.task-card-header { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 4px; gap: 6px; }
.task-checkbox { width: 14px; height: 14px; border: 2px solid #6b7280; border-radius: 3px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.task-checkbox:hover { border-color: #3b82f6; }
.task-checkbox.checked { background: #3b82f6; border-color: #3b82f6; }
.task-checkbox::after { content: '✓'; color: white; font-size: 9px; display: none; }
.task-checkbox.checked::after { display: block; }
.task-category { font-size: 0.6rem; padding: 2px 5px; border-radius: 3px; background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.task-category.code_review { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.task-category.file_search { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.task-category.qa { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.task-category.code_optimize { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.task-category.bug_fix { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.task-priority { font-size: 0.6rem; padding: 2px 5px; border-radius: 3px; font-weight: bold; }
.task-priority.p1 { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.task-priority.p2 { background: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.task-priority.p3 { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.task-priority.p4, .task-priority.p5 { background: rgba(107, 114, 128, 0.3); color: #d1d5db; }

.task-content { margin-bottom: 4px; line-height: 1.3; word-break: break-word; font-size: 0.75rem; }
.task-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.65rem; color: #9ca3af; }
.task-time { display: flex; align-items: center; gap: 4px; }
.task-status-badge { display: flex; align-items: center; gap: 4px; }
.task-status-icon { width: 8px; height: 8px; border-radius: 50%; }
.status-running .task-status-icon { background: #3b82f6; animation: pulse 1s infinite; }
.status-paused .task-status-icon { background: #f59e0b; }

/* 任务操作按钮 */
.task-actions { display: flex; gap: 3px; margin-top: 6px; }
.task-action-btn { padding: 3px 6px; border: none; border-radius: 3px; cursor: pointer; font-size: 0.65rem; transition: all 0.2s; background: rgba(255,255,255,0.1); color: #d1d5db; }
.task-action-btn:hover { background: rgba(255,255,255,0.2); }
.task-action-btn.btn-primary { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.task-action-btn.btn-danger { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.task-action-btn.btn-success { background: rgba(34, 197, 94, 0.3); color: #86efac; }

/* 批量操作栏 */
.batch-actions { display: none; padding: 8px; background: rgba(0,0,0,0.3); border-radius: 6px; margin-bottom: 8px; }
.batch-actions.show { display: flex; gap: 4px; flex-wrap: wrap; }
.batch-select-all { display: flex; align-items: center; gap: 6px; padding: 6px; margin-bottom: 6px; font-size: 0.7rem; cursor: pointer; }
.batch-checkbox { width: 14px; height: 14px; border: 2px solid #6b7280; border-radius: 3px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; cursor: pointer; }
.batch-checkbox.checked { background: #3b82f6; border-color: #3b82f6; }
.batch-checkbox::after { content: '✓'; color: white; font-size: 9px; display: none; }
.batch-checkbox.checked::after { display: block; }

/* 任务详情面板 */
.task-detail-panel { display: none; position: fixed; top: 0; right: -400px; width: 400px; height: 100vh; background: rgba(15, 12, 41, 0.98); backdrop-filter: blur(20px); border-left: 1px solid rgba(255,255,255,0.1); padding: 20px; overflow-y: auto; transition: right 0.3s, width 0.3s; z-index: 1000; }
.task-detail-panel.show { display: block; right: 0; }
.task-detail-panel.fullscreen { width: 100vw; }
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.detail-header-actions { display: flex; gap: 8px; align-items: center; }
.detail-btn { background: rgba(255,255,255,0.1); border: none; color: #9ca3af; font-size: 1rem; cursor: pointer; padding: 6px 10px; border-radius: 6px; transition: all 0.2s; }
.detail-btn:hover { background: rgba(255,255,255,0.2); color: #e4e4e7; }
.detail-close { background: none; border: none; color: #9ca3af; font-size: 1.5rem; cursor: pointer; }
.detail-close:hover { color: #e4e4e7; }
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: 0.8rem; color: #a78bfa; margin-bottom: 10px; font-weight: 500; }
.detail-log { font-family: 'Monaco', monospace; font-size: 0.75rem; line-height: 1.6; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px; max-height: 300px; overflow-y: auto; }
.detail-result { background: rgba(34, 197, 94, 0.1); padding: 12px; border-radius: 8px; font-size: 0.85rem; line-height: 1.6; }
.detail-error { background: rgba(239, 68, 68, 0.1); padding: 12px; border-radius: 8px; font-size: 0.85rem; line-height: 1.6; color: #fca5a5; }

/* 执行结果分块样式 */
.result-block { margin-bottom: 12px; border-radius: 6px; overflow: hidden; }
.result-block-header { padding: 6px 10px; font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.result-block-header .toggle-icon { transition: transform 0.2s; }
.result-block-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.result-block-content { padding: 10px; font-size: 0.8rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.result-block-content.collapsed { max-height: 100px; overflow: hidden; position: relative; }
.result-block-content.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); pointer-events: none; }
.result-block .expand-btn { display: none; padding: 4px 8px; font-size: 0.7rem; background: rgba(255,255,255,0.1); border: none; color: #9ca3af; border-radius: 4px; cursor: pointer; margin-top: 4px; }
.result-block-content.collapsed + .expand-btn { display: inline-block; }
.result-block.plan .result-block-header { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.result-block.plan .result-block-content { background: rgba(59, 130, 246, 0.05); }
.result-block.process .result-block-header { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.result-block.process .result-block-content { background: rgba(251, 191, 36, 0.05); }
.result-block.final .result-block-header { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.result-block.final .result-block-content { background: rgba(34, 197, 94, 0.05); }
.result-block.summary .result-block-header { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.result-block.summary .result-block-content { background: rgba(168, 85, 247, 0.05); }

/* 代码块样式 */
.result-code { background: rgba(0, 0, 0, 0.4); padding: 8px; border-radius: 4px; font-family: 'Monaco', monospace; font-size: 0.75rem; margin: 6px 0; overflow-x: auto; border-left: 3px solid #6b7280; white-space: pre-wrap; }
.summary-item { padding: 4px 0; color: #86efac; }
.list-item { padding: 2px 0; }
.result-block-content p { margin: 0 0 8px 0; }
.result-block-content p:last-child { margin-bottom: 0; }
.detail-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; font-size: 0.75rem; }
.detail-meta-item { display: flex; justify-content: space-between; }
.detail-meta-label { color: #9ca3af; }
.detail-meta-value { color: #e4e4e7; }

/* 加载动画 */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.loading-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* 空状态 */
.empty-state { text-align: center; padding: 20px 15px; color: #71717a; font-size: 0.75rem; }
.empty-state-icon { font-size: 1.5rem; margin-bottom: 8px; opacity: 0.5; }
.empty-state-text { margin-bottom: 10px; }
.empty-state-action { display: inline-block; padding: 6px 12px; background: rgba(59, 130, 246, 0.2); color: #93c5fd; border-radius: 5px; cursor: pointer; transition: all 0.2s; font-size: 0.75rem; }
.empty-state-action:hover { background: rgba(59, 130, 246, 0.3); }

/* ==================== Settings Modal ==================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; backdrop-filter: blur(5px); }
.modal-content {
    background: #1e1e2e;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    margin: 5vh auto;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-header { padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); }
.modal-header h2 { margin: 0; font-size: 1.1rem; color: #fff; display: flex; align-items: center; gap: 10px; }
.modal-body { flex: 1; display: flex; overflow: hidden; }

/* Agent 列表侧边栏 */
.agent-sidebar { width: 180px; background: rgba(0,0,0,0.3); border-right: 1px solid rgba(255,255,255,0.05); padding: 10px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.agent-sidebar-header { padding: 8px 5px; font-size: 0.75rem; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; }
.agent-item {
    padding: 10px 12px;
    text-align: left;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.agent-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.agent-item.active { background: rgba(118, 75, 162, 0.25); color: #a78bfa; }
.agent-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: #a78bfa; border-radius: 0 2px 2px 0; }
.agent-status { font-size: 0.7rem; }
.agent-status.active { color: #4ade80; }
.agent-sidebar-actions { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 5px; }
.agent-action-btn { padding: 8px 12px; background: rgba(255,255,255,0.05); border: none; color: #a1a1aa; border-radius: 6px; cursor: pointer; font-size: 0.8rem; text-align: left; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.agent-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* 角色切换侧边栏 */
.role-sidebar { width: 160px; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.05); padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.role-tab {
    padding: 10px 12px;
    text-align: left;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.role-tab:hover { background: rgba(255,255,255,0.05); color: #fff; }
.role-tab.active { background: rgba(118, 75, 162, 0.2); color: #a78bfa; border-left: 3px solid #a78bfa; }

/* 编辑区域 */
.editor-area { flex: 1; display: flex; flex-direction: column; padding: 15px 20px; gap: 10px; min-width: 0; }
.agent-meta { display: flex; gap: 15px; margin-bottom: 5px; }
.agent-meta-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.agent-meta-label { font-size: 0.75rem; color: #71717a; }
.agent-meta-input { background: #181825; border: 1px solid rgba(255,255,255,0.1); color: #e4e4e7; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem; outline: none; }
.agent-meta-input:focus { border-color: #764ba2; }
.agent-meta-input:disabled { opacity: 0.6; cursor: not-allowed; }
.prompt-textarea {
    flex: 1;
    background: #181825;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e4e4e7;
    padding: 15px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 200px;
}
.prompt-textarea:focus { border-color: #764ba2; }
.prompt-hint { font-size: 0.75rem; color: #71717a; }

.modal-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); }
.modal-footer-left { display: flex; gap: 8px; }
.modal-footer-right { display: flex; gap: 10px; }
.btn-save { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; padding: 8px 20px; color: white; border-radius: 6px; cursor: pointer; font-weight: 500; transition: opacity 0.2s; font-size: 0.9rem; }
.btn-save:hover { opacity: 0.9; }
.btn-cancel { background: transparent; border: 1px solid rgba(255,255,255,0.2); padding: 8px 16px; color: #ccc; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-cancel:hover { background: rgba(255,255,255,0.05); }
.btn-danger { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.3); padding: 8px 16px; color: #fca5a5; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.3); }
.btn-secondary { background: rgba(255,255,255,0.1); border: none; padding: 8px 16px; color: #ccc; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-reset { background: rgba(251, 191, 36, 0.2); border: 1px solid rgba(251, 191, 36, 0.3); padding: 8px 16px; color: #fcd34d; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-reset:hover { background: rgba(251, 191, 36, 0.3); }

/* Settings Button */
.settings-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 100;
    font-size: 1.2rem;
}
.settings-btn:hover { background: rgba(255,255,255,0.2); transform: rotate(30deg); border-color: rgba(255,255,255,0.3); }

/* 当前激活 Agent 标记 */
.active-agent-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: rgba(74, 222, 128, 0.2); color: #4ade80; border-radius: 4px; font-size: 0.7rem; }
.active-agent-dot { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; }

/* ==================== 自定义弹窗样式 ==================== */
.custom-dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.custom-dialog-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.custom-dialog {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    min-width: 320px;
    max-width: 480px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.custom-dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-dialog-icon {
    font-size: 1.5rem;
}

.custom-dialog-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e4e4e7;
}

.custom-dialog-body {
    padding: 20px;
    color: #d4d4d8;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.custom-dialog-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: flex-end;
}

.custom-dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.custom-dialog-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-dialog-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.custom-dialog-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #d4d4d8;
}

.custom-dialog-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-dialog-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.custom-dialog-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* 弹窗类型样式 */
.custom-dialog-overlay.type-info .custom-dialog-icon::before { content: 'ℹ️'; }
.custom-dialog-overlay.type-success .custom-dialog-icon::before { content: '✅'; }
.custom-dialog-overlay.type-warning .custom-dialog-icon::before { content: '⚠️'; }
.custom-dialog-overlay.type-error .custom-dialog-icon::before { content: '❌'; }
.custom-dialog-overlay.type-question .custom-dialog-icon::before { content: '❓'; }

/* 自定义输入弹窗样式 */
.custom-prompt-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.custom-prompt-input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.custom-prompt-input::placeholder {
    color: #71717a;
}
