/* Text Compare（tc-）：颜色只用 kit 变量；新增 = --ok，删除 = --danger，修改 = --primary */
.tc-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tc-input, .tc-options, .tc-actions { margin-bottom: 32px; }
.tc-section-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--text); }
.tc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }

.tc-error { margin: 0 0 16px; padding: 12px; border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 14px; overflow-wrap: anywhere; }

.tc-pair { display: grid; gap: 24px; }
@media (min-width: 768px) { .tc-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 输入卡片 */
.tc-text .tc-text-title { margin-bottom: 12px; }
.tabs.tc-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 16px; }
.tc-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.tc-text .textarea { display: block; box-sizing: border-box; }
.tc-text .textarea:disabled { opacity: .5; cursor: not-allowed; }

.tc-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; padding: 24px; border: 2px dashed var(--border); border-radius: var(--radius); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.tc-drop:hover { border-color: var(--primary); }
.tc-drop:has(.tc-file-input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tc-drop.is-loaded { border-color: var(--primary); background: var(--primary-soft); }
.tc-drop.is-disabled { opacity: .7; cursor: not-allowed; }
.tc-file-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.tc-drop-state { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; }
.tc-drop-icon { width: 32px; height: 32px; margin-bottom: 4px; color: var(--muted); }
.tc-drop-main { margin-bottom: 4px; font-size: 14px; color: var(--text); }
.tc-drop-hint { font-size: 12px; color: var(--muted); }
.tc-drop-formats { margin-top: 12px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tc-file-name { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-bottom: 4px; color: var(--primary); font-weight: 600; overflow-wrap: anywhere; }
.tc-drop-ok { font-size: 12px; color: var(--ok); }

.btn.tc-icon-btn { box-sizing: border-box; width: 32px; height: 32px; min-height: 32px; padding: 0; }
.btn.tc-clear-text { display: flex; margin: 16px 0 0 auto; color: var(--danger); }
.btn.tc-clear-text:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }

/* 选项 */
.tc-options { display: grid; gap: 16px; }
.tc-options-title { grid-column: 1 / -1; }
@media (min-width: 640px) { .tc-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .tc-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tc-options .check:has(input:disabled) { opacity: .7; cursor: not-allowed; }
.tc-help { display: inline-flex; margin-left: -4px; color: var(--muted); }
.tc-help .tc-icon { width: 14px; height: 14px; }

/* 操作按钮 + 进度 */
.tc-actions { display: flex; justify-content: center; gap: 16px; }
.btn.tc-clear-all { color: var(--danger); }
.btn.tc-clear-all:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.tc-progress-box { max-width: 448px; margin: 0 auto 32px; text-align: center; }
.tc-progress-text { margin: 8px 0 0; font-size: 14px; }
.tc-bar { display: block; width: 100%; height: 8px; border: 0; border-radius: var(--radius-sm); background: var(--soft); overflow: hidden; -webkit-appearance: none; appearance: none; }
.tc-bar::-webkit-progress-bar { background: var(--soft); }
.tc-bar::-webkit-progress-value { background: var(--primary); border-radius: var(--radius-sm); transition: width .3s; }
.tc-bar::-moz-progress-bar { background: var(--primary); border-radius: var(--radius-sm); }
@keyframes tc-spin { to { transform: rotate(360deg); } }
.tc-spin { animation: tc-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .tc-spin { animation: none; } }

/* 结果 */
.tc-results { padding-top: 32px; border-top: 1px solid var(--border); }
.tc-results > .tc-section-title { margin-bottom: 24px; }
.tc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.tc-stats-title { grid-column: 1 / -1; }
@media (min-width: 768px) { .tc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tc-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tc-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 12px; border-radius: var(--radius-sm); background: var(--soft); text-align: center; }
.tc-stat .tc-bar { margin: 4px 0; background: var(--border); }
.tc-stat .tc-bar::-webkit-progress-bar { background: var(--border); }
.tc-stat-label { font-size: 14px; color: var(--muted); }
.tc-stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--text); }
.tc-tone-primary { color: var(--primary); }
.tc-tone-ok { color: var(--ok); }
.tc-tone-danger { color: var(--danger); }

.tc-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.btn.tc-copy { width: 40px; height: 40px; min-height: 40px; }
.tc-diff { max-height: 500px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 14px/22px var(--mono); }
.tc-diff-table { width: 100%; border-collapse: collapse; }
.tc-diff-table td { padding: 4px 8px; vertical-align: top; }
.tc-line-no { width: 1%; border-right: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; user-select: none; }
.tc-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-badge-cell { width: 1%; text-align: right; white-space: nowrap; }
.tc-diff .tc-badge { background: var(--card); color: inherit; }
.tc-added { background: var(--ok-soft); color: var(--ok); }
.tc-deleted { background: var(--danger-soft); color: var(--danger); }
.tc-modified { background: var(--primary-soft); color: var(--primary); }
.tc-ins { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.tc-del { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); text-decoration: line-through; }
.tc-empty-line { color: var(--muted); font-style: italic; }
.tc-diff-table .tc-no-results { padding: 32px 16px; text-align: center; color: var(--muted); font-family: var(--font); }

.tc-copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .tc-actions .btn { flex: 1 1 0; }
  .tc-drop { padding: 16px; }
}