/* ═══════════════════════════════════════════════════
   文本比对 — 样式
   ═══════════════════════════════════════════════════ */

.diff-container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }
.diff-header { text-align: center; margin-bottom: 24px; }
.diff-header h2 { font-size: 26px; color: #1a1a2e; margin-bottom: 6px; }
.diff-header p { color: #9ca3af; font-size: 14px; }

/* 输入区域 */
.input-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.input-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; }
.input-panel h3 { font-size: 16px; color: #1a1a2e; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.input-panel h3 .badge { font-size: 12px; padding: 2px 8px; border-radius: 4px; color: #fff; }
.badge-a { background: #dc3545; } .badge-b { background: #28a745; }
.input-panel textarea { width: 100%; height: 200px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; font-size: 13px; font-family: 'Courier New', Consolas, monospace; resize: vertical; line-height: 1.5; }
.input-panel textarea:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.panel-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar button { padding: 8px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.btn-compare { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font-size: 16px; padding: 10px 32px; }
.btn-compare:hover { box-shadow: 0 4px 16px rgba(102,126,234,0.4); transform: translateY(-1px); }
.btn-secondary { background: #f0f0f0; color: #555; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-paste { background: #e8f0fe; color: #2563eb; font-size: 12px; padding: 4px 10px; }
.btn-upload { background: #fef3c7; color: #92400e; font-size: 12px; padding: 4px 10px; }

.view-toggle { display: flex; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.view-toggle button { padding: 6px 16px; border: none; background: #fff; color: #666; cursor: pointer; font-size: 13px; border-right: 1px solid #e5e7eb; }
.view-toggle button:last-child { border-right: none; }
.view-toggle button.active { background: #667eea; color: #fff; }

/* 统计信息 */
.stats-box { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; padding: 16px; background: #f8f9fa; border-radius: 12px; border: 1px solid #e5e7eb; }
.stat-item { text-align: center; }
.stat-num { font-size: 24px; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.stat-num.add { color: #059669; }
.stat-num.del { color: #dc3545; }
.stat-num.mod { color: #d97706; }

/* 结果区域 */
.result-area { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; max-height: 600px; overflow-y: auto; font-family: 'Courier New', Consolas, monospace; font-size: 13px; line-height: 1.7; display: none; }

/* 统一视图（行内diff） */
.diff-line { padding: 2px 8px; white-space: pre-wrap; word-break: break-all; border-bottom: 1px solid #f0f0f0; }
.diff-line.add { background: #d4edda; }
.diff-line.add::before { content: "+ "; color: #059669; font-weight: bold; }
.diff-line.del { background: #f8d7da; }
.diff-line.del::before { content: "- "; color: #dc3545; font-weight: bold; }
.diff-line.equal { background: #fff; }
.diff-line.equal::before { content: "  "; }

.diff-word-add { background: #a3e635; padding: 0 2px; border-radius: 2px; }
.diff-word-del { background: #fca5a5; padding: 0 2px; border-radius: 2px; text-decoration: line-through; }

/* 左右对照视图 */
.side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.side-cell { padding: 4px 8px; border-bottom: 1px solid #f0f0f0; min-height: 1.5em; white-space: pre-wrap; word-break: break-all; }
.side-cell.left { border-right: 1px solid #e5e7eb; }
.side-cell.add { background: #d4edda; }
.side-cell.del { background: #f8d7da; }
.side-cell.empty { background: #f8f9fa; color: #ccc; }

.export-bar { text-align: center; margin-top: 20px; }

@media (max-width: 768px) {
    .input-panels { grid-template-columns: 1fr; }
    .side-by-side { grid-template-columns: 1fr; }
    .side-cell.left { border-right: none; }
}
