/* 系统弹窗 — 替代浏览器 alert / confirm */

body.tc-dialog-open {
  overflow: hidden;
}

.tc-dialog[hidden] {
  display: none !important;
}

.tc-dialog {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tc-dialog__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.tc-dialog__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--tc-white, #fff);
  border: 1px solid var(--tc-card-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  animation: tc-dialog-in 0.2s ease;
}

.tc-dialog__hd {
  padding: 16px 20px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--tc-text-title, #1a1a1a);
}

.tc-dialog__bd {
  padding: 12px 20px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--tc-text, #333);
  white-space: pre-wrap;
  word-break: break-word;
}

.tc-dialog__ft {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 16px;
}

.tc-btn--danger {
  background: var(--tc-danger, #e34d59);
  border-color: var(--tc-danger, #e34d59);
  color: #fff;
}

.tc-btn--danger:hover {
  background: #c9353f;
  border-color: #c9353f;
  color: #fff;
}

@keyframes tc-dialog-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tc-dialog__panel {
    animation: none;
  }
}

/* 表单校验 — 替代浏览器原生提示 */
.tc-form-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--tc-danger, #e34d59);
}

.tc-input.is-invalid,
.tc-input--inline.is-invalid,
.tc-input--code.is-invalid,
.t-input.is-invalid,
select.tc-input.is-invalid,
select.tc-input--inline.is-invalid {
  border-color: var(--tc-danger, #e34d59) !important;
  box-shadow: 0 0 0 1px rgba(227, 77, 89, 0.15);
}

.tc-form-item--checkbox.is-invalid-wrap .tc-form-label--checkbox,
.tc-form-item--checkbox .tc-form-label--checkbox:has(+ input.is-invalid),
.tc-form-item--checkbox:has(input.is-invalid) .tc-form-label--checkbox {
  color: var(--tc-danger, #e34d59);
}
