/* 通用工具样式 - 供编码/文本/实用类工具复用 */
.tc-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 960px;
}
.tc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}
.tc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.tc-label {
  font-size: 13px;
  color: #6b7280;
  min-width: 64px;
}
.tc-input,
.tc-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  outline: none;
  color: #1f2937;
}
.tc-input:focus,
.tc-select:focus {
  border-color: #2563eb;
}
.tc-area {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.tc-area:focus {
  border-color: #2563eb;
}
.tc-btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  line-height: 34px;
}
.tc-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.tc-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.tc-btn.primary:hover {
  background: #1d4ed8;
  color: #fff;
}
.tc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tc-out {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 40px;
  box-sizing: border-box;
}
.tc-hint {
  font-size: 12px;
  color: #9ca3af;
}
.tc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.tc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tc-field > label {
  font-size: 12px;
  color: #6b7280;
}
.tc-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tc-err {
  font-size: 12px;
  color: #dc2626;
  min-height: 16px;
  line-height: 16px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .tc-wrap { gap: 10px; }
  .tc-card { padding: 12px; }
  .tc-label { min-width: 56px; font-size: 12px; }
  .tc-input, .tc-select { height: 34px; font-size: 13px; }
  .tc-btn { height: 34px; padding: 0 12px; font-size: 13px; line-height: 32px; }
  .tc-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .tc-row { gap: 8px; }
  .tc-area { min-height: 100px; font-size: 12px; }
}

@media (max-width: 480px) {
  .tc-card { padding: 10px; }
  .tc-btn { padding: 0 10px; font-size: 12px; }
  .tc-area { min-height: 80px; }
}

/* ============== 可搜索下拉框 combo 通用组件 ============== */
.combo { position: relative; flex: 1; min-width: 0; }
.combo-title {
  display: block; font-size: 13px; color: var(--text-3);
  margin-bottom: 4px; white-space: nowrap;
}
.combo-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; user-select: none;
  transition: border-color .15s; font-size: 14px; color: var(--text);
}
.combo-trigger:hover { border-color: var(--primary-border); }
.combo.open .combo-trigger { border-color: var(--primary); }
.combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-arrow { color: var(--text-3); transition: transform .2s; flex-shrink: 0; margin-left: 8px; }
.combo.open .combo-arrow { transform: rotate(180deg); }

.combo-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  margin-top: 2px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden;
}
.combo-search {
  position: relative; display: flex; align-items: center;
  padding: 6px; border-bottom: 1px solid var(--border);
}
.combo-search svg { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.combo-search-input {
  width: 100%; padding: 6px 8px 6px 28px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; background: var(--card); color: var(--text);
}
.combo-search-input:focus { outline: none; border-color: var(--primary); }
.combo-list {
  max-height: 280px; overflow-y: auto; padding: 4px 0;
}
.combo-group {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  padding: 6px 12px 2px; letter-spacing: .5px;
}
.combo-item {
  padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  transition: background .1s;
}
.combo-item:hover { background: var(--primary-soft); }
.combo-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.combo-item .ci-area { font-size: 11px; color: var(--text-3); }
.combo-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--text-3); }

@media (max-width: 768px) {
  .combo-list { max-height: 220px; }
}
@media (max-width: 480px) {
  .combo { width: 100%; }
}
