.tf-btn {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  padding: 5px;
  margin: 0;
  color: var(--tf-text-primary);
  cursor: pointer;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border-color-strong);
  border-radius: 5px;

  svg {
    width: 16px;
    height: 16px;
    fill: currentcolor;
  }

  &:hover {
    border: 1px solid var(--tf-primary-color);
  }
}

.tf-btn.tf-btn-primary {
  color: var(--tf-loop-handle-text);
  background: var(--tf-primary-color);

  &:hover {
    background: var(--tf-primary-color-hover);
    border: 1px solid var(--tf-border-color-strong);
  }
}

.tf-input,
.tf-textarea {
  box-sizing: border-box;
  display: flex;
  padding: 5px 8px;
  overflow-y: hidden;
  line-height: normal;
  color: var(--tf-text-primary);
  resize: vertical;
  outline: none;
  background: var(--tf-bg-input);
  border: 1px solid var(--tf-border-color-strong);
  border-radius: 5px;

  &::placeholder {
    font-size: 12px;
    color: var(--tf-text-muted);
  }

  /* 获得焦点时的样式 */
  &:focus {
    border-color: var(--tf-primary-color);
    box-shadow: var(--tf-focus-shadow);
  }

  /* 禁用时的样式 */
  &[disabled] {
    color: var(--tf-text-disabled);
    cursor: not-allowed;
    background-color: var(--tf-bg-input-disabled);
  }
}

.tf-select {
  display: flex;
  width: 100%;
  min-width: 0;

  &-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 32px;
    padding: 4px 10px;
    font-size: 13px;
    color: var(--tf-text-primary);
    cursor: pointer;
    background: var(--tf-bg-input);
    border: 1px solid var(--tf-border-color);
    border-radius: 6px;
    transition: all 0.2s;

    &:hover {
      border-color: var(--tf-border-color-strong);
    }

    &:focus,
    &.active {
      border-color: var(--tf-primary-color);
      box-shadow: var(--tf-focus-shadow);
    }

    &-value {
      display: flex;
      flex: 1;
      align-items: center;
      min-width: 0;
      height: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 12px;
      white-space: nowrap;
    }

    &-arrow {
      display: flex;
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      margin-left: 4px;
      color: var(--tf-text-secondary);
    }

    &-placeholder {
      color: var(--tf-text-muted);
    }
  }

  &-content {
    display: none; /* 现在改用 .tf-select-wrapper */
  }
}

.tf-checkbox {
  width: 14px;
  height: 14px;
}

.tf-tabs {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background: var(--tf-bg-muted);
  border: none;
  border-radius: 5px;

  .tf-tabs-item {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    font-size: 14px;
    color: var(--tf-text-secondary);
    cursor: pointer;
    border-radius: 5px;
  }

  .tf-tabs-item.active {
    font-weight: 500;
    color: var(--tf-text-primary);
    background: var(--tf-bg-surface);
    box-shadow: var(--tf-shadow-soft);
  }
}

h3.tf-heading {
  margin-top: 2px;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tf-text-primary);
}

.tf-collapse {
  border: none;
  border-radius: 5px;

  /* padding: 5px; */

  &-item {
    &-title {
      display: flex;
      align-items: center;
      font-size: 14px;
      cursor: pointer;

      &-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        padding: 3px;
        margin-right: 10px;
        color: var(--tf-icon-color);
        background: var(--tf-icon-bg);
        border-radius: 5px;

        svg {
          width: 22px;
          height: 22px;
          color: var(--tf-icon-color);
        }
      }

      &-arrow {
        display: block;
        width: 16px;
        height: 16px;
        margin-left: auto;
      }
    }

    &-description {
      margin: 10px 0;
      font-size: 12px;
      color: var(--tf-text-muted);
    }
  }
}
