:host { display: block; height: 100%; } .ai-response-container { display: flex; flex-direction: column; height: 100%; background: var(--mat-app-background-color, #f5f5f5); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } /* 头部工具栏 */ .header-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: white; border-bottom: 1px solid var(--mat-divider-color, #e0e0e0); min-height: 56px; box-sizing: border-box; } .session-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .type-indicator { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 16px; color: white; font-size: 12px; font-weight: 500; } .type-icon { font-size: 16px; width: 16px; height: 16px; line-height: 16px; } .type-label { line-height: 1; } .session-id, .timestamp, .empty-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mat-secondary-text-color, #666); } .empty-state { font-size: 14px; color: var(--mat-primary-text-color, #333); mat-icon { color: var(--mat-primary-color, #3f51b5); } } .toolbar-actions { display: flex; gap: 4px; } /* 内容区域 */ .content-area { flex: 1; overflow: auto; padding: 16px; background: white; transition: all 0.3s ease; &.streaming { background: linear-gradient(135deg, #f9f9ff 0%, #f0f8ff 100%); } &.collapsed { max-height: 200px; overflow: hidden; position: relative; &::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(to bottom, transparent, white); pointer-events: none; } } } .content-wrapper { min-height: 100%; } .response-content { font-size: 14px; line-height: 1.6; color: var(--mat-primary-text-color, #333); // Markdown样式增强 ::ng-deep { h1, h2, h3, h4 { margin-top: 1.2em; margin-bottom: 0.6em; color: var(--mat-primary-color, #3f51b5); } code { background: var(--mat-app-background-color, #f5f5f5); padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 0.9em; } pre { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 6px; overflow: auto; margin: 1em 0; code { background: transparent; padding: 0; border-radius: 0; font-size: 0.9em; line-height: 1.5; } } blockquote { border-left: 4px solid var(--mat-primary-color, #3f51b5); margin: 1em 0; padding-left: 1em; color: var(--mat-secondary-text-color, #666); font-style: italic; } ul, ol { padding-left: 1.5em; margin: 0.5em 0; } table { border-collapse: collapse; width: 100%; margin: 1em 0; th, td { border: 1px solid var(--mat-divider-color, #e0e0e0); padding: 8px 12px; text-align: left; } th { background: var(--mat-app-background-color, #f5f5f5); font-weight: 600; } } } } .streaming-indicator { margin-top: 20px; padding: 12px; background: rgba(33, 150, 243, 0.05); border-radius: 8px; border: 1px solid rgba(33, 150, 243, 0.2); .streaming-text { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--mat-primary-color, #3f51b5); mat-icon { font-size: 16px; width: 16px; height: 16px; line-height: 16px; animation: pulse 1.5s infinite; } } } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .response-complete { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding: 8px 12px; background: rgba(76, 175, 80, 0.1); border-radius: 8px; color: #2e7d32; font-size: 13px; mat-icon { color: #2e7d32; font-size: 16px; width: 16px; height: 16px; line-height: 16px; } } .no-response { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mat-secondary-text-color, #666); text-align: center; .empty-icon { font-size: 48px; width: 48px; height: 48px; line-height: 48px; margin-bottom: 16px; color: var(--mat-primary-color, #3f51b5); opacity: 0.3; } .hint { font-size: 12px; margin-top: 4px; color: var(--mat-secondary-text-color, #888); } } /* 响应历史 */ .response-history { border-top: 1px solid var(--mat-divider-color, #e0e0e0); background: var(--mat-app-background-color, #f5f5f5); max-height: 200px; overflow: auto; } .history-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 12px; font-weight: 500; color: var(--mat-secondary-text-color, #666); background: rgba(0, 0, 0, 0.02); border-bottom: 1px solid var(--mat-divider-color, #e0e0e0); } .history-list { padding: 8px; } .history-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: white; border-radius: 6px; margin-bottom: 6px; cursor: pointer; border-left: 3px solid; transition: all 0.2s ease; &:hover { background: var(--mat-app-background-color, #f5f5f5); transform: translateX(2px); } &:active { transform: translateX(0); } } .history-type-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: currentColor; opacity: 0.2; mat-icon { font-size: 16px; width: 16px; height: 16px; line-height: 16px; color: white; } } .history-content { flex: 1; overflow: hidden; } .history-session { font-size: 10px; color: var(--mat-secondary-text-color, #888); margin-bottom: 2px; } .history-preview { font-size: 11px; color: var(--mat-primary-text-color, #444); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .history-time { font-size: 10px; color: var(--mat-secondary-text-color, #888); white-space: nowrap; } /* 滚动条样式 */ ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--mat-divider-color, #ccc); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--mat-secondary-text-color, #999); } /* 响应式设计 */ @media (max-width: 768px) { .header-toolbar { flex-direction: column; align-items: stretch; gap: 8px; } .session-info { justify-content: space-between; } .toolbar-actions { align-self: flex-end; } }