/* ============ 文本差异对比 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、form-textarea等）已由 common.css 统一提供 */

/* ---- 容器 ---- */
#diff-container {
    margin-bottom: 15px;
}

/* ---- 左右两栏 flex 布局 ---- */
#diff-container > .section-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#diff-container > .section-row > .settings-card {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 差异统计徽章 ---- */
.diff-stats-inline {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-left: 12px;
}

.stat-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.stat-badge.added {
    background: #d1fae5;
    color: #059669;
}

.stat-badge.removed {
    background: #fee2e2;
    color: #dc2626;
}

.stat-badge.changed {
    background: #fef3c7;
    color: #d97706;
}

/* ---- 差异视图 ---- */
.diff-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #3d3d3d;
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
}

.diff-column {
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diff-column-header {
    padding: 10px 15px;
    background: #2d2d2d;
    font-size: 13px;
    font-weight: 600;
    color: #d4d4d4;
    border-bottom: 1px solid #3d3d3d;
    flex-shrink: 0;
}

.diff-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
    flex: 1;
}

.diff-line {
    display: flex;
    min-height: 22px;
}

.diff-line.same {
    background: transparent;
    color: #d4d4d4;
}

.diff-line.removed {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

.diff-line.added {
    background: rgba(5, 150, 105, 0.15);
    color: #6ee7b7;
}

.diff-line.changed {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

.diff-line.empty {
    background: #252526;
    opacity: 0.5;
}

/* ---- 行指示符 ---- */
.line-indicator {
    width: 24px;
    padding: 0 8px;
    text-align: center;
    font-weight: bold;
    flex-shrink: 0;
    user-select: none;
    color: inherit;
}

.diff-line.same .line-indicator {
    color: #6b7280;
}

.diff-line.removed .line-indicator {
    color: #ef4444;
}

.diff-line.added .line-indicator {
    color: #10b981;
}

.diff-line.changed .line-indicator {
    color: #f59e0b;
}

/* ---- 行号 ---- */
.line-number {
    width: 40px;
    padding: 0 8px;
    text-align: right;
    color: #858585;
    font-size: 12px;
    user-select: none;
    flex-shrink: 0;
    border-right: 1px solid #3d3d3d;
}

/* ---- 行内容 ---- */
.line-content {
    flex: 1;
    padding: 0 12px;
    white-space: pre-wrap;
    word-break: break-all;
    color: inherit;
}

/* ---- 字符高亮 ---- */
.diff-highlight {
    border-radius: 2px;
    padding: 0 1px;
}

.diff-highlight.removed {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.diff-highlight.added {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ---- 空状态 ---- */
#diff-container .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #9ca3af;
}

#diff-container .empty-state-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

#diff-container .empty-state-desc {
    font-size: 14px;
    color: #888;
}

/* ---- 功能说明信息区 ---- */
#app > .info-section {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #diff-container > .section-row {
        flex-direction: column;
        gap: 12px;
    }

    .diff-view {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 500px;
    }

    #app > .info-section {
        grid-template-columns: 1fr;
    }
}
