/* MIR AI助手样式文件 */
/* 创建时间: 2025-01-14 */
/* 版本: 1.0.0 */

/* ==================== 基础样式重置 ==================== */
.ai-assistant-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ai-assistant-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    color: #333;
}

/* ==================== 动画效果 ==================== */
@keyframes ai-pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.7; 
    }
}

@keyframes ai-fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes ai-fadeInStep {
    from { 
        opacity: 0; 
        transform: translateX(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes ai-spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

@keyframes ai-loading {
    0% { 
        transform: translateX(-100%); 
    }
    100% { 
        transform: translateX(100%); 
    }
}

/* ==================== 主要布局容器 ==================== */
.ai-app-container {
    display: flex;
    height: calc(100vh - 120px); /* 减去导航栏高度 */
    background: #fff;
    justify-content: center;
    padding: 0 20px;
    margin-top: 20px;
}

.ai-main-panel {
    flex: none;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

/* ==================== 顶部标题栏 ==================== */
.ai-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.ai-app-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.ai-app-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.ai-header-actions {
    display: flex;
    gap: 8px;
}

.ai-header-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ai-header-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.ai-header-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ai-header-btn.primary:hover {
    background: #2563eb;
}

.ai-header-btn.history {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.ai-header-btn.history:hover {
    background: #d97706;
}

/* ==================== 聊天区域 ==================== */
.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 95%;
    animation: ai-fadeIn 0.3s ease-out;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.wide {
    max-width: 98%;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: #3b82f6;
    color: white;
}

.ai-message.ai .ai-message-avatar {
    background: #f3f4f6;
    color: #6b7280;
}

.ai-message-content {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    line-height: 1.5;
    font-size: 14px;
    width: 100%;
    min-width: 300px;
}

.ai-message.user .ai-message-content {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* ==================== 选项卡片 ==================== */
.ai-option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ai-option-card {
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.ai-option-card:hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ai-option-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ai-option-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.ai-option-desc {
    font-size: 12px;
    color: #6b7280;
}

/* ==================== 专家选择网格 ==================== */
.ai-expert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ai-expert-card {
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    text-align: center;
}

.ai-expert-card:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
}

/* ==================== Todo清单 ==================== */
.ai-todo-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.ai-todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ai-todo-title {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-todo-controls {
    display: flex;
    gap: 8px;
}

.ai-control-btn {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.ai-control-btn:hover {
    background: #f3f4f6;
}

.ai-control-btn.pause {
    background: #fbbf24;
    color: white;
    border-color: #fbbf24;
}

.ai-control-btn.play {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.ai-control-btn.stop {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.ai-todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.ai-todo-status {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.ai-todo-status.pending {
    background: #f3f4f6;
    border: 2px solid #d1d5db;
}

.ai-todo-status.running {
    background: #3b82f6;
    color: white;
    animation: ai-pulse 2s infinite;
}

.ai-todo-status.completed {
    background: #10b981;
    color: white;
}

.ai-todo-text {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.ai-todo-item.completed .ai-todo-text {
    text-decoration: line-through;
    color: #9ca3af;
}

/* ==================== 步骤指示器 ==================== */
.ai-step {
    padding: 4px 0;
    transition: all 0.3s ease;
    animation: ai-fadeInStep 0.3s ease-out;
}

.ai-step.active {
    color: #3b82f6;
    font-weight: 600;
}

/* ==================== 模式选择卡片 ==================== */
.ai-mode-card {
    flex: 1;
    max-width: 300px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: all 0.2s ease;
}

.ai-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ==================== 输入区域 ==================== */
.ai-input-area {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.ai-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-input-field {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.ai-input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ai-send-btn {
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    height: 40px;
}

.ai-send-btn:hover {
    background: #2563eb;
}

.ai-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ==================== 初始欢迎界面 ==================== */
.ai-welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.ai-welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-bottom: 24px;
}

.ai-welcome-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.ai-welcome-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.5;
}

.ai-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.ai-quick-action {
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.ai-quick-action:hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-2px);
}

.ai-action-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.ai-action-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.ai-action-desc {
    font-size: 12px;
    color: #6b7280;
}

/* ==================== 搜索内容选择 ==================== */
.ai-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ai-content-type-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    text-align: center;
}

.ai-content-type-card:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
}

.ai-selection-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin: 12px auto 0;
    transition: all 0.3s ease;
}

.ai-selection-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    min-height: 60px;
}

/* ==================== 数据表格和项目 ==================== */
.ai-data-item {
    padding: 12px;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fef3c7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-data-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.ai-selected-item {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f0f9ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #3b82f6;
}

/* ==================== 标签页系统 ==================== */
.ai-result-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.ai-tab-btn.active {
    background: #3b82f6;
    color: white;
    border-radius: 6px 6px 0 0;
}

.ai-tab-btn:not(.active) {
    background: #f3f4f6;
    color: #6b7280;
}

.ai-tab-btn:not(.active):hover {
    background: #e5e7eb;
}

/* ==================== 思考过程动画 ==================== */
.ai-thinking-process {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    animation: ai-pulse 2s infinite;
}

.ai-progress-steps {
    font-size: 14px;
    color: #64748b;
}

/* ==================== 文件上传区域 ==================== */
.ai-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.ai-upload-area:hover {
    border-color: #3b82f6;
    background: #f8faff;
}

/* ==================== 历史记录模态框 ==================== */
.ai-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-history-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-history-item:hover {
    border-color: #3b82f6;
    background: #f8faff;
}

/* ==================== 工具类样式 ==================== */
.ai-hidden {
    display: none !important;
}

.ai-text-center {
    text-align: center;
}

.ai-text-left {
    text-align: left;
}

.ai-text-right {
    text-align: right;
}

.ai-mb-16 {
    margin-bottom: 16px;
}

.ai-mt-16 {
    margin-top: 16px;
}

.ai-p-16 {
    padding: 16px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .ai-app-container {
        padding: 0 10px;
        height: calc(100vh - 80px);
    }
    
    .ai-main-panel {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .ai-expert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ai-selection-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ai-quick-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ai-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .ai-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .ai-chat-messages {
        padding: 16px;
    }
    
    .ai-input-area {
        padding: 12px 16px;
    }
    
    .ai-message {
        max-width: 100%;
    }
    
    .ai-message-content {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .ai-expert-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-option-cards {
        grid-template-columns: 1fr;
    }
    
    .ai-app-title {
        font-size: 16px;
    }
    
    .ai-header-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==================== 滚动条样式 ==================== */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== 打印样式 ==================== */
@media print {
    .ai-header,
    .ai-input-area,
    .ai-header-actions {
        display: none;
    }
    
    .ai-main-panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .ai-chat-messages {
        overflow: visible;
        height: auto;
    }
}
