/* 代码对比(diff-) —— 本工具自己的样式, 共用表单套件见 ../shared/kit.css */

.diff-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.diff-side { min-width: 0; }
.diff-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }

/* 编辑器 = 高亮层在下、透明输入在上; 两者同字体同行高同内边距, 滚动由 JS 同步 */
.diff-editor { position: relative; height: 26rem; border: 1px solid var(--cv-line); border-radius: 8px; background: var(--cv-canvas); overflow: hidden; }
.diff-overlay, .diff-input {
  position: absolute; inset: 0; margin: 0; border: 0; padding: 8px 10px;
  font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre; overflow: auto;
}
.diff-overlay { color: var(--cv-ink-3); background: transparent; pointer-events: none; z-index: 0; }
.diff-input { z-index: 1; width: 100%; height: 100%; resize: none; background: transparent; color: transparent; caret-color: var(--cv-ink); }
.diff-input::selection { background: rgba(2, 132, 199, .25); }
.diff-input:focus { outline: none; }

.diff-line { display: block; min-height: 20px; }
.diff-line i.diff-ln { display: inline-block; width: 2.6em; margin-right: 8px; font-style: normal; text-align: right; color: #9ca3af; user-select: none; }
.diff-del { background: var(--no-soft); }
.diff-add { background: var(--ok-soft); }

.diff-foot { margin-top: 12px; }
.diff-chip { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--cv-line); background: #fff; font-size: 12px; color: var(--cv-ink-2); }
.diff-chip--del { background: var(--no-soft); border-color: #f3c1c3; color: var(--no); }
.diff-chip--add { background: var(--ok-soft); border-color: #9fd3ba; color: var(--ok); }

@media (min-width: 1100px) {
  .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
