DiffPreviewPanel.css•4.22 kB
.diff-preview-panel {
display: flex;
flex-direction: column;
height: 100%;
background: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 8px;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border-bottom: 1px solid #e0e0e0;
background: #f8f9fa;
}
.panel-header h3 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: #333;
}
.view-mode-toggle {
display: flex;
border: 1px solid #d0d0d0;
border-radius: 4px;
overflow: hidden;
}
.view-mode-toggle button {
padding: 6px 12px;
border: none;
background: #fff;
color: #666;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
}
.view-mode-toggle button:hover {
background: #f0f0f0;
}
.view-mode-toggle button.active {
background: #2196f3;
color: white;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
color: #999;
}
.empty-icon {
font-size: 48px;
margin-bottom: 16px;
}
.changes-list {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.change-item {
margin-bottom: 8px;
border: 1px solid #e0e0e0;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}
.change-item:hover {
border-color: #2196f3;
box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}
.change-item.selected {
border-color: #2196f3;
box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}
.change-header {
display: flex;
align-items: center;
padding: 12px;
gap: 8px;
}
.change-icon {
font-size: 16px;
}
.change-title {
flex: 1;
font-weight: 500;
color: #333;
}
.change-type {
padding: 2px 8px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
}
.change-type.add {
background: #e8f5e9;
color: #2e7d32;
}
.change-type.delete {
background: #ffebee;
color: #c62828;
}
.change-type.modify {
background: #fff9c4;
color: #f57c00;
}
.change-type.format {
background: #e3f2fd;
color: #1565c0;
}
.change-preview {
border-top: 1px solid #f0f0f0;
padding: 16px;
background: #fafafa;
}
/* Side-by-Side View */
.diff-side-by-side {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 16px;
}
.diff-column {
border: 1px solid #e0e0e0;
border-radius: 4px;
overflow: hidden;
}
.diff-header {
padding: 8px 12px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}
.diff-header.before {
background: #ffebee;
color: #c62828;
}
.diff-header.after {
background: #e8f5e9;
color: #2e7d32;
}
.diff-content {
padding: 12px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 13px;
line-height: 1.4;
white-space: pre-wrap;
min-height: 60px;
}
.diff-content.before {
background: #fff5f5;
}
.diff-content.after {
background: #f9fff9;
}
/* Inline View */
.diff-inline {
margin-bottom: 16px;
}
.diff-line {
display: flex;
align-items: flex-start;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 13px;
line-height: 1.4;
margin-bottom: 2px;
}
.line-marker {
width: 20px;
text-align: center;
font-weight: bold;
flex-shrink: 0;
}
.line-content {
flex: 1;
padding: 4px 8px;
white-space: pre-wrap;
}
.diff-line.deleted {
background: #ffebee;
}
.diff-line.deleted .line-marker {
color: #c62828;
}
.diff-line.added {
background: #e8f5e9;
}
.diff-line.added .line-marker {
color: #2e7d32;
}
.change-reason {
margin-top: 12px;
padding: 12px;
background: #f0f7ff;
border-left: 4px solid #2196f3;
border-radius: 4px;
font-size: 13px;
}
.confidence-indicator {
display: flex;
align-items: center;
gap: 8px;
margin-top: 12px;
font-size: 12px;
color: #666;
}
.confidence-bar {
flex: 1;
height: 6px;
background: #e0e0e0;
border-radius: 3px;
overflow: hidden;
}
.confidence-fill {
height: 100%;
background: linear-gradient(90deg, #f44336 0%, #ff9800 50%, #4caf50 100%);
transition: width 0.3s ease;
}
/* 响应式设计 */
@media (max-width: 768px) {
.diff-side-by-side {
grid-template-columns: 1fr;
}
.panel-header {
flex-direction: column;
gap: 12px;
align-items: stretch;
}
.view-mode-toggle {
align-self: center;
}
}