/* 输入框 */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}
.field > label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.field-required > label::after {
  content: '*';
  color: var(--danger);
  margin-left: 4px;
}

.input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-md);
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}
.input::placeholder { color: var(--text-tertiary); opacity: 1; }
.input:hover { border-color: rgba(255, 255, 255, .22); background: var(--bg-overlay); }
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .22);
}
.input:disabled { opacity: .55; cursor: not-allowed; }
.input.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

textarea.input {
  height: auto;
  padding: 12px 14px;
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23a0a0b8' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* 带图标 */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap > .input {
  padding-left: 40px;
}
.input-wrap > .input.input-suffix-pad {
  padding-right: 40px;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.input-suffix {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.input-suffix:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, .06);
}

.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.field-error {
  font-size: 12px;
  color: var(--danger);
}

/* checkbox / radio */
.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkbox input, .radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

/* switch 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.switch input { display: none; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  transition: background var(--dur-base) var(--ease-out);
}
.switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--dur-base) var(--ease-out);
}
.switch input:checked + .switch-slider {
  background: var(--grad-primary);
}
.switch input:checked + .switch-slider::before {
  left: 21px;
  background: var(--text-on-accent);
}
