/* Compare Two Lists（ct-）：通用按钮、输入框、卡片、徽章、toast 用 kit.css 的类，这里只写布局和本工具的细节 */

/* kit 的 .textarea/.input 是 width:100% + padding，不设 border-box 会撑出卡片 */
.ct-list .textarea, .ct-split .ct-custom-sep { box-sizing: border-box; }
.ct-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ct-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.ct-section-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--primary); }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }

/* 两个输入列表左右并排 */
.ct-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 32px; }
.ct-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ct-list-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ct-list-title, .ct-options-title { color: var(--primary); }
.ct-list-title, .ct-count, .ct-result-title, .ct-result-count { flex: none; white-space: nowrap; }
.ct-file { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.ct-file .ct-ico { width: 12px; height: 12px; }
.ct-file-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn.ct-icon-btn { position: relative; flex: none; width: 40px; padding: 0; }
.ct-upload-btn { margin-left: auto; }
.btn.ct-upload-btn:hover:not(:disabled) { color: var(--primary); }
.btn.ct-clear-btn:hover:not(:disabled) { color: var(--danger); }
.ct-spinner { width: 16px; height: 16px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: ct-spin .8s linear infinite; }
@keyframes ct-spin { to { transform: rotate(360deg); } }

.ct-split { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-split-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.ct-split .ct-split-select { width: 140px; }
.ct-split .ct-custom-sep { flex: 1 1 120px; width: auto; min-width: 0; }

/* 选项：两列网格，标题占满一行 */
.ct-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.ct-options-title { grid-column: 1 / -1; }

/* 四个结果区：2×2 */
.ct-results-title { margin-bottom: 16px; }
.ct-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ct-result { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
[data-result="onlyInListA"] { --ct-tone: var(--primary); --ct-tone-soft: var(--primary-soft); }
[data-result="onlyInListB"] { --ct-tone: var(--accent); --ct-tone-soft: var(--accent-soft); }
[data-result="inBothLists"] { --ct-tone: var(--ok); --ct-tone-soft: var(--ok-soft); }
[data-result="allItems"] { --ct-tone: var(--text); --ct-tone-soft: var(--soft); }
.ct-result-head { display: flex; align-items: center; gap: 8px; }
.ct-result-title { color: var(--ct-tone); }
.ct-result-head .ct-result-count { background: var(--ct-tone-soft); color: var(--ct-tone); }
.ct-sort-btn { margin-left: auto; }
.btn.ct-sort-btn.is-active { background: var(--ct-tone-soft); color: var(--ct-tone); }
.ct-copied-ico { color: var(--ok); }

.ct-result-list, .ct-empty { box-sizing: border-box; margin: 0; min-height: 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ct-result-list { max-height: 300px; overflow-y: auto; padding: 12px 12px 12px 32px; list-style: disc; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ct-result-list li + li { margin-top: 4px; }
.ct-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.ct-empty .ct-ico { width: 32px; height: 32px; color: var(--ct-tone); opacity: .35; }

@media (max-width: 640px) {
  .ct-lists, .ct-options, .ct-results { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ct-head { margin-bottom: 16px; }
  .ct-lists, .ct-options { margin-bottom: 24px; }
}