WordDiffViewer.css•3.63 kB
.word-diff-viewer {
display: flex;
flex-direction: column;
height: 100%;
background: #ffffff;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.word-diff-viewer-empty {
display: flex;
align-items: center;
justify-content: center;
height: 200px;
color: #999;
font-size: 14px;
}
.diff-viewer-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border-bottom: 1px solid #e0e0e0;
}
.diff-viewer-header h3 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: #333;
}
.header-controls {
display: flex;
align-items: center;
gap: 12px;
}
.sync-scroll-toggle {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: #666;
cursor: pointer;
}
.sync-scroll-toggle input[type="checkbox"] {
cursor: pointer;
}
.close-button {
width: 28px;
height: 28px;
border: none;
background: #f5f5f5;
border-radius: 4px;
color: #666;
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.close-button:hover {
background: #e0e0e0;
color: #333;
}
.diff-viewer-content {
display: flex;
flex: 1;
overflow: hidden;
}
.diff-pane {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.diff-separator {
width: 1px;
background: #e0e0e0;
}
.pane-header {
padding: 12px 16px;
background: #f8f9fa;
border-bottom: 1px solid #e0e0e0;
display: flex;
justify-content: space-between;
align-items: center;
}
.pane-header h4 {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #333;
}
.change-count {
font-size: 12px;
color: #666;
}
.pane-content {
flex: 1;
overflow-y: auto;
padding: 8px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 13px;
line-height: 1.6;
}
.diff-text {
white-space: pre-wrap;
word-break: break-word;
}
.diff-line {
display: flex;
padding: 2px 0;
transition: background-color 0.2s;
}
.diff-line:hover {
background-color: #f5f5f5;
}
.line-number {
display: inline-block;
width: 50px;
text-align: right;
padding-right: 12px;
color: #999;
user-select: none;
flex-shrink: 0;
}
.line-content {
flex: 1;
padding-left: 8px;
}
/* 修改类型样式 */
.diff-insert {
background-color: #E8F5E9;
border-left: 3px solid #4CAF50;
}
.diff-insert .line-content {
color: #2E7D32;
}
.diff-delete {
background-color: #FFEBEE;
border-left: 3px solid #F44336;
text-decoration: line-through;
}
.diff-delete .line-content {
color: #C62828;
}
.diff-modify {
background-color: #FFF9C4;
border-left: 3px solid #FFC107;
}
.diff-modify .line-content {
color: #F57C00;
}
.diff-format {
background-color: #E3F2FD;
border-left: 3px solid #2196F3;
}
.diff-format .line-content {
color: #1565C0;
}
/* 图例 */
.diff-viewer-legend {
display: flex;
gap: 16px;
padding: 12px 16px;
background: #f8f9fa;
border-top: 1px solid #e0e0e0;
font-size: 12px;
}
.legend-item {
display: flex;
align-items: center;
gap: 6px;
color: #666;
}
.legend-color {
width: 12px;
height: 12px;
border-radius: 2px;
}
.legend-insert {
background-color: #4CAF50;
}
.legend-delete {
background-color: #F44336;
}
.legend-modify {
background-color: #FFC107;
}
/* 滚动条样式 */
.pane-content::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.pane-content::-webkit-scrollbar-track {
background: #f1f1f1;
}
.pane-content::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 4px;
}
.pane-content::-webkit-scrollbar-thumb:hover {
background: #999;
}